diff --git a/.gitignore b/.gitignore index 70cebd19289..b1be96247a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +.vagrant +/dapps + # emacs *~ diff --git a/.npmignore b/.npmignore index cd75c6170bf..6579415ef23 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,8 @@ +.vagrant + # Demo demo +dapps # scripts scripts diff --git a/README.md b/README.md index 9305a1acde1..d009d2b8e33 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,51 @@ # Agoric Javascript Smart Contract Platform -## Getting Started +## Prerequisites + +### Vagrant + +To run a standardized Linux distribution with all the required development tools, you probably want [Vagrant](https://www.vagrantup.com/docs/): + +```sh +vagrant up --provider=docker +# or +vagrant up --provider=virtualbox +# then +vagrant ssh +``` + +The Vagrant setup has synchronized filesystem access with the workspace directory on your host system, so you can use your favourite IDE to modify the files, and just run Linux commands on the SSH connection. + + +### Developing on the current OS + +If you don't use Vagrant, you can develop on your own local operating system. NOTE: You will need Go 1.12 or newer to run the Agoric VM. ```sh # Install the agoric devtool. -# NOTE: If you can't do this, use `npx agoric` each time you see `agoric` npm install -g agoric +``` + +or: + +```sh +# Run the agoric devtool. +npx agoric [...options] +``` + +## Your first Agoric Dapp + +Here is a simple script for how to get started. + +```sh +cd dapps # Initialize your dapp project. -agoric init my-dapp +# Note: Change the `demo` name to something meaningful. +agoric init demo # Go to its directory. -cd my-dapp +cd demo # Install Javascript/Go dependencies. agoric install # Run the local vat machine. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000000..0b90c31b1ae --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,94 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +# +# Vagrant box for Debian with cosmic-swingset dependencies +# +# use one of: +# vagrant up --provider=docker +# vagrant up --provider=virtualbox + +NODE_VERSION = "12.x" +GO_VERSION = "1.12.7" + +CURRENT_DIR = File.dirname(__FILE__) + +$script = <