diff --git a/docker/README.md b/docker/README.md index 8e690cf..8f0d350 100644 --- a/docker/README.md +++ b/docker/README.md @@ -41,7 +41,7 @@ bellow. | Environment variable | Default value | Usage | | --- | --- | --- | | ACCOUNTS_NUMBER | 10 | Set the number of accounts generated | -| ACCOUNTS_ETHER | 10 | Set the amount of ETH assigned to each account | +| ACCOUNTS_ETHER | 100 | Set the amount of ETH assigned to each account | | MNEMONIC | NaN | The mnemonic phrase sued as a seed for deterministic account generation | | HOST | 0.0.0.0 | The hostname to listen on | | PORT | 8545 | The port to listen on | @@ -52,7 +52,8 @@ Note that the Ganache instance running inside the container will save the genera you can mount a volume to this path to have easier access. Also, the database used by Ganache for storing blockchain information is placed in the path `/home/ganache_db/`. You can -maintain the blockchain state between runs by mounting a volume to the database path. +maintain the blockchain state between runs by mounting a volume to the database path. To do that, add the docker flag +`-v host/absolute/path/to/ganache_db:/home/ganache_db`. ### Rendezvous @@ -77,11 +78,11 @@ The image makes use of the environment variables described bellow. | Environment variable | Default value | Usage | | --- | --- | --- | -| MIGRATE_NETWORK | develop | Set the network where the contracts will be deployed/tested (set to env unless you know what you're doing) | -| DEPLOY_CHAIN_HOST | NaN | Set the hostname of the blockchain network that will be used for deployment | -| DEPLOY_CHAIN_PORT | NaN | Set the port of the blockchain network that will be used for deployment | -| TEST_CHAIN_HOST | NaN | Set the hostname of the blockchain network that will be used for testing | -| TEST_CHAIN_PORT | NaN | Set the port of the blockchain network that will be used for testing | +| MIGRATE_NETWORK | develop | Set the network where the contracts will be deployed/tested (set this to "env" unless you know what you're doing) | +| DEPLOY_CHAIN_HOST | NaN | Set the hostname of the blockchain network that will be used for deployment (requires network to be "env") | +| DEPLOY_CHAIN_PORT | NaN | Set the port of the blockchain network that will be used for deployment (requires network to be "env") | +| TEST_CHAIN_HOST | NaN | Set the hostname of the blockchain network that will be used for testing (requires network to be "env") | +| TEST_CHAIN_PORT | NaN | Set the port of the blockchain network that will be used for testing (requires network to be "env") | You can find the contract artifacts in the directory `/usr/src/concordia/packages/concordia-contracts/build/` inside the image. @@ -171,42 +172,25 @@ The results should be printed in the terminal, but are also available in the dir #### Production -Build the ganache image and spin up a blockchain and a rendezvous server: +Just run the target: ```shell make run ``` -Build the migration stage of the contracts image: +And you' re done! Head to [localhost:7777](localhost:7777) and voilĂ , a working Concordia instance appears! The +blockchain is exposed in the address `localhost:8545`. -```shell -make build-contracts-migrate -``` - -Deploy the contracts to the blockchain: - -```shell -make run-contracts-migrate -``` - -**Attention**: this step must be executed before building the application image (next step). - -Build the application image: - -```shell -make build-app -``` - -Deploy the application: - -```shell -make run-app -``` +**Tip**: the accounts (private keys) generated by Ganache are available in the file `./volumes/ganache_keys/keys.json`. -Head to [localhost:8473](localhost:8473) and voilĂ , a working Concordia instance appears! The blockchain is exposed in -the address `localhost:8545`. +Note that the `make run` command might take several minutes to execute (depending on your system). What happens under +the hood is that: -**Tip**: the accounts (private keys) generated by Ganache are available in the file `./volumes/ganache_keys/keys.json`. +- the ganache image is built +- blockchain and rendezvous server containers are started +- migration stage of the contracts image is built +- the contracts are deployed to the blockchain: +- the application image is built and then deployed ### Env Files