The following instructions overview the process of getting the software, building it, running a simple test network that produces blocks, account creation and uploading a sample contract to the blockchain.
The following instructions overview the process of getting the software, building it, running a simple test network that produces blocks, creating an account, and uploading a sample contract to the blockchain.
<aname="setup"></a>
## Setting up a build/development environment
...
...
@@ -55,13 +55,13 @@ The following instructions overview the process of getting the software, buildin
<aname="autobuild"></a>
### Automated build script
For Ubuntu 16.10 and MacOS Sierra, there is an automated build script that can install all dependencies and builds EOS.
For Ubuntu 16.10 and MacOS Sierra, there is an automated build script that can install all dependencies and build EOS.
It is called build.sh with following inputs.
It is called build.sh with the following inputs:
- architecture [ubuntu|darwin]
- optional mode [full|build]
The second optional input can be full or build where full implies that it installs dependencies and builds eos. If you omit this input then build script always installs dependencies and then builds eos.
The second optional input can be `full` or `build` where `full` implies that it installs dependencies and builds EOS. If you omit this input, then the build script will install dependencies and then builds EOS.
```bash
./build.sh <architecture> <optional mode>
...
...
@@ -83,7 +83,7 @@ Now you can proceed to the next step - [Creating and launching a single-node tes
<aname="automac"></a>
#### MacOS Sierra
Before running the script make sure you have updated XCode and brew:
Before running the script, make sure you have updated XCode and Homebrew:
```bash
xcode-select --install
...
...
@@ -259,7 +259,7 @@ Run the `create` command where `inita` is the account authorizing the creation o
@@ -335,13 +335,9 @@ Next verify the currency contract has the proper initial balance:
<aname="pushamessage"></a>
### Transfering funds with the sample "currency" contract
Anyone can send any message to any contract at any time, but the contracts may reject messages which are not given necessary permission. Messages are not
sent "from" anyone, they are sent "with permission of" one or more accounts and permission levels. The following commands shows a "transfer" message being
sent to the "currency" contract.
The content of the message is `'{"from":"currency","to":"inita","quantity":50}'`. In this case we are asking the currency contract to transfer funds from itself to
someone else. This requires the permission of the currency contract.
Anyone can send any message to any contract at any time, but the contracts may reject messages which are not given necessary permission. Messages are not sent "from" anyone, they are sent "with permission of" one or more accounts and permission levels. The following commands show a "transfer" message being sent to the "currency" contract.
The content of the message is `'{"from":"currency","to":"inita","quantity":50}'`. In this case we are asking the currency contract to transfer funds from itself to someone else. This requires the permission of the currency contract.
```bash
./eosc push message currency transfer '{"from":"currency","to":"inita","quantity":50}'--scope currency,inita --permission currency@active
...
...
@@ -353,10 +349,9 @@ Below is a generalization that shows the `currency` account is only referenced o
./eosc push message currency transfer '{"from":"${usera}","to":"${userb}","quantity":50}'--scope${usera},${userb}--permission${usera}@active
```
We specify the `--scope ...` argument to give the currency contract read/write permission to those users so it can modify their balances. In a future release scope
will be determined automatically.
We specify the `--scope ...` argument to give the currency contract read/write permission to those users so it can modify their balances. In a future release scope will be determined automatically.
As a confirmation of a successfully submitted transaction you will receive json output that includes a `transaction_id` field.
As confirmation of a successfully submitted transaction, you will receive JSON output that includes a `transaction_id` field.
<aname="readingcontract"></a>
### Reading sample "currency" contract balance
...
...
@@ -389,9 +384,9 @@ As expected, the receiving account **inita** now has a balance of **50** tokens,
<aname="localtestnet"></a>
## Running multi-node local testnet
To run a local testnet you can use a `launcher` application provided in `~/eos/build/programs/launcher` folder.
To run a local testnet you can use a `launcher` application provided in the `~/eos/build/programs/launcher` folder.
For testing purposes you will run 2 local production nodes talking to each other.
For testing purposes you will run two local production nodes talking to each other.
```bash
cd ~/eos/build
...
...
@@ -399,7 +394,7 @@ cp ../genesis.json ./
./programs/launcher/launcher -p2--skip-signature
```
This command will generate 2 data folders for each instance of the node: `tn_data_0` and `tn_data_1`.
This command will generate two data folders for each instance of the node: `tn_data_0` and `tn_data_1`.