After `docker-compose up`, two services named eosiod and walletd will be started. eosiod service would expose ports 8888 and 9876 to the host. walletd service does not expose any port to the host, it is only accessible to eosioc when runing eosioc is running inside the walletd container as described in "Execute eosioc commands" section.
After `docker-compose up`, two services named nodeos and walletd will be started. nodeos service would expose ports 8888 and 9876 to the host. walletd service does not expose any port to the host, it is only accessible to cleos when runing cleos is running inside the walletd container as described in "Execute cleos commands" section.
### Execute eosioc commands
### Execute cleos commands
You can run the `eosioc` commands via a bash alias.
You can run the `cleos` commands via a bash alias.
```bash
alias eosioc='docker-compose exec walletd /opt/eosio/bin/eosioc -H eosiod'
eosioc get info
eosioc get account inita
alias cleos='docker-compose exec walletd /opt/eosio/bin/cleos -H nodeos'
@@ -216,15 +216,15 @@ To run the test suite after building, run the `chain_test` executable in the `te
EOS comes with a number of programs you can find in `~/eos/build/programs`. They are listed below:
*eosiod - server-side blockchain node component
*eosioc - command line interface to interact with the blockchain
*nodeos - server-side blockchain node component
*cleos - command line interface to interact with the blockchain
* eosiowd - EOS wallet
* eosio-launcher - application for nodes network composing and deployment; [more on eosio-launcher](https://github.com/EOSIO/eos/blob/master/testnet.md)
<aname="singlenode"></a>
### Creating and launching a single-node testnet
After successfully building the project, the `eosiod` binary should be present in the `build/programs/eosiod` directory. Run `eosiod` -- it will probably exit with an error, but if not, close it immediately with <kbd>Ctrl-C</kbd>. If it exited with an error, note that `eosiod` created a directory named `data-dir` containing the default configuration (`config.ini`) and some other internals. This default data storage path can be overridden by passing `--data-dir /path/to/data` to `eosiod`. These instructions will continue to use the default directory.
After successfully building the project, the `nodeos` binary should be present in the `build/programs/nodeos` directory. Run `nodeos` -- it will probably exit with an error, but if not, close it immediately with <kbd>Ctrl-C</kbd>. If it exited with an error, note that `nodeos` created a directory named `data-dir` containing the default configuration (`config.ini`) and some other internals. This default data storage path can be overridden by passing `--data-dir /path/to/data` to `nodeos`. These instructions will continue to use the default directory.
Edit the `config.ini` file, adding/updating the following settings to the defaults already in place:
@@ -292,24 +292,24 @@ EOS comes with example contracts that can be uploaded and run for testing purpos
First, run the node
```bash
cd ~/eos/build/programs/eosiod/
./eosiod
cd ~/eos/build/programs/nodeos/
./nodeos
```
<aname="walletimport"></a>
### Setting up a wallet and importing account key
As you've previously added `plugin = eosio::wallet_api_plugin` into `config.ini`, EOS wallet will be running as a part of `eosiod` process. Every contract requires an associated account, so first, create a wallet.
As you've previously added `plugin = eosio::wallet_api_plugin` into `config.ini`, EOS wallet will be running as a part of `nodeos` process. Every contract requires an associated account, so first, create a wallet.
```bash
cd ~/eos/build/programs/eosioc/
./eosioc wallet create # Outputs a password that you need to save to be able to lock/unlock the wallet
cd ~/eos/build/programs/cleos/
./cleos wallet create # Outputs a password that you need to save to be able to lock/unlock the wallet
```
For the purpose of this walkthrough, import the private key of the `eosio` account, a system account included within genesis.json, so that you're able to issue API commands under authority of an existing account. The private key referenced below is found within your `config.ini` and is provided to you for testing purposes.
@@ -318,9 +318,9 @@ For the purpose of this walkthrough, import the private key of the `eosio` accou
First, generate some public/private key pairs that will be later assigned as `owner_key` and `active_key`.
```bash
cd ~/eos/build/programs/eosioc/
./eosioc create key # owner_key
./eosioc create key # active_key
cd ~/eos/build/programs/cleos/
./cleos create key # owner_key
./cleos create key # active_key
```
This will output two pairs of public and private keys
...
...
@@ -336,7 +336,7 @@ Save the values for future reference.
Run the `create` command where `eosio` is the account authorizing the creation of the `currency` account and `PUBLIC_KEY_1` and `PUBLIC_KEY_2` are the values generated by the `create key` command
Next verify the currency contract has the proper initial balance:
```bash
./eosioc get table currency currency account
./cleos get table currency currency account
{
"rows": [{
"currency": 1381319428,
...
...
@@ -422,13 +422,13 @@ Anyone can send any message to any contract at any time, but the contracts may r
The content of the message is `'{"from":"currency","to":"eosio","quantity":"20.0000 CUR","memo":"any string"}'`. 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
./eosioc push action currency transfer '{"from":"currency","to":"eosio","quantity":"20.0000 CUR","memo":"my first transfer"}'--permission currency@active
./cleos push action currency transfer '{"from":"currency","to":"eosio","quantity":"20.0000 CUR","memo":"my first transfer"}'--permission currency@active
```
Below is a generalization that shows the `currency` account is only referenced once, to specify which contract to deliver the `transfer` message to.
```bash
./eosioc push action currency transfer '{"from":"${usera}","to":"${userb}","quantity":"20.0000 CUR","memo":""}'--permission${usera}@active
./cleos push action currency transfer '{"from":"${usera}","to":"${userb}","quantity":"20.0000 CUR","memo":""}'--permission${usera}@active
```
As confirmation of a successfully submitted transaction, you will receive JSON output that includes a `transaction_id` field.
...
...
@@ -439,7 +439,7 @@ As confirmation of a successfully submitted transaction, you will receive JSON o
So now check the state of both of the accounts involved in the previous transaction.
```bash
./eosioc get table eosio currency account
./cleos get table eosio currency account
{
"rows": [{
"currency": 1381319428,
...
...
@@ -448,7 +448,7 @@ So now check the state of both of the accounts involved in the previous transact
],
"more": false
}
./eosioc get table currency currency account
./cleos get table currency currency account
{
"rows": [{
"currency": 1381319428,
...
...
@@ -479,15 +479,15 @@ This command will generate two data folders for each instance of the node: `tn_d
("genesis,g",bpo::value<bf::path>(&genesis)->default_value("./genesis.json"),"set the path to genesis.json")
("output,o",bpo::value<bf::path>(&output),"save a copy of the generated topology in this file")
("skip-signature",bpo::bool_switch(&skip_transaction_signatures)->default_value(false),"EOSD does not require transaction signatures.")
("eosiod",bpo::value<string>(&eosd_extra_args),"forward eosiod command line argument(s) to each instance of eosiod, enclose arg in quotes")
("nodeos",bpo::value<string>(&eosd_extra_args),"forward nodeos command line argument(s) to each instance of nodeos, enclose arg in quotes")
("delay,d",bpo::value<int>(&start_delay)->default_value(0),"seconds delay before starting each node after the first")
("nogen",bpo::bool_switch(&nogen)->default_value(false),"launch nodes without writing new config files")
("host-map",bpo::value<bf::path>(&host_map_file)->default_value(""),"a file containing mapping specific nodes to hosts. Used to enhance the custom shape argument")
("servers",bpo::value<bf::path>(&server_ident_file)->default_value(""),"a file containing ip addresses and names of individual servers to deploy as producers or observers ")
("per-host",bpo::value<int>(&per_host)->default_value(0),"specifies how many eosiod instances will run on a single host. Use 0 to indicate all on one.")
("per-host",bpo::value<int>(&per_host)->default_value(0),"specifies how many nodeos instances will run on a single host. Use 0 to indicate all on one.")
("network-name",bpo::value<string>(&network.name)->default_value("testnet_"),"network name prefix used in GELF logging source")
("enable-gelf-logging",bpo::value<bool>(&gelf_enabled)->default_value(true),"enable gelf logging appender in logging configuration file")
("gelf-endpoint",bpo::value<string>(&gelf_endpoint)->default_value("10.160.11.21:12201"),"hostname:port or ip:port of GELF endpoint")