diff --git a/README.md b/README.md index 5272066afd7c3d1f2758f713af7cbe5a05aa80cd..5ded16ad8e66601f8b6eec29ded29b7f9ce53554 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Cuttlefish runs programs that are made of 'hunks' - each hunk is a small block o Hunks interface with the rest of the world through data ports - inputs and outputs - and their state variables. Each of these interfaces *is typed* - this helps us when we serialize messages (Cuttlefish is made for networks) - and helps everyone understand what hunks are meant to do. -Typing is rendered in `/typeset.js` - we can only connect outputs to inputs when a function exists here to copy data from the output-type to the input-type. These functions are directional! +Typing is rendered in `/typeset.js` - we can only connect outputs to inputs when a function exists here to copy data from the output-type to the input-type. These functions are directional! ### Flowcontrolled Runtime @@ -181,22 +181,26 @@ For a more involved example, see [the linechart](hunks/data/linechart.js). # Running Locally -To run Cuttlefish, I install node.js, and then it's http-server package. To install node.js, you can follow instructions [on the Nautilus page](https://gitlab.cba.mit.edu/squidworks/nautilus) and then run: +Cuttlefish emerges from a small node.js server, and the best way to develop / use it is still to run a local copy of this on your machine. -``npm install -g http-server`` +First, you should [install node.js](https://nodejs.org), if you're on a Mac / Unix (Raspberry Pi!), I would highly recommend [NVM](https://github.com/nvm-sh/nvm), and windows has [an installer](https://nodejs.org) that works brilliantly. -Now, from the cuttlefish directory, you should be able to do: +Then, we need to install a few packages. Clone this repo wherever you'd like in your machine, ``cd`` to that directory, and run: -``http-server`` +``npm install express`` -And a small program will start up, serving the files in the directory to any browser that you point at the address it lists. Now you're running cuttlefish. +If you just want to run the browser tools, you're now done. If you want to use CF to connect to hardware, do: -In most cases, the server will start on port 8080 of your local browser. You can just point your browser to: +``npm install ws`` -``http://localhost:8080/index.html`` +and -**not https** or your browser will reject the connection +``npm install serialport`` -And you should see the http-server handle a series of requests, as cuttlefish loads. +You can now run Cuttlefish by doing: + +``node cf`` + +It should then report an IP and port. One is your local address, if the browser you are using is on the same machine as the node process, and the other is the machine's outward facing IP. You should be able to point the browser to one of these IPs, and you're off and cuttling. ...