BASECOIN_ROOT -> BCHOME

This commit is contained in:
Ethan Buchman 2017-03-14 01:50:10 -04:00
parent e0df8da40a
commit 4a6b7131e4
5 changed files with 18 additions and 18 deletions

View File

@ -4,8 +4,8 @@
BREAKING CHANGES:
- Remove `--data` flag and use `BASECOIN_ROOT` to set the home directory (defaults to `~/.basecoin`)
- Remove `--in-proc` flag and start Tendermint in-process by default (expect Tendermint files in $BASECOIN_ROOT/tendermint).
- Remove `--data` flag and use `BCHOME` to set the home directory (defaults to `~/.basecoin`)
- Remove `--in-proc` flag and start Tendermint in-process by default (expect Tendermint files in $BCHOME/tendermint).
To start just the ABCI app/server, use `basecoin start --without-tendermint`.
FEATURES:

View File

@ -23,7 +23,7 @@ import (
func BasecoinRoot(rootDir string) string {
if rootDir == "" {
rootDir = os.Getenv("BASECOIN_ROOT")
rootDir = os.Getenv("BCHOME")
}
if rootDir == "" {
rootDir = os.Getenv("HOME") + "/.basecoin"

View File

@ -61,21 +61,21 @@ function waitForBlock() {
}
# make basecoin root vars
export BASECOIN_ROOT="."
BCROOT1="./data/chain1/basecoin"
BCROOT2="./data/chain2/basecoin"
export BCHOME="."
BCHOME1="./data/chain1/basecoin"
BCHOME2="./data/chain2/basecoin"
# grab the chain ids
CHAIN_ID1=$(cat $BCROOT1/genesis.json | jq .[1])
CHAIN_ID1=$(cat $BCHOME1/genesis.json | jq .[1])
CHAIN_ID1=$(removeQuotes $CHAIN_ID1)
CHAIN_ID2=$(cat $BCROOT2/genesis.json | jq .[1])
CHAIN_ID2=$(cat $BCHOME2/genesis.json | jq .[1])
CHAIN_ID2=$(removeQuotes $CHAIN_ID2)
echo "CHAIN_ID1: $CHAIN_ID1"
echo "CHAIN_ID2: $CHAIN_ID2"
# make reusable chain flags
CHAIN_FLAGS1="--chain_id $CHAIN_ID1 --from $BCROOT1/key.json"
CHAIN_FLAGS2="--chain_id $CHAIN_ID2 --from $BCROOT2/key.json --node tcp://localhost:36657"
CHAIN_FLAGS1="--chain_id $CHAIN_ID1 --from $BCHOME1/key.json"
CHAIN_FLAGS2="--chain_id $CHAIN_ID2 --from $BCHOME2/key.json --node tcp://localhost:36657"
echo ""
@ -83,11 +83,11 @@ echo "... starting chains"
echo ""
# start the first node
TMROOT=./data/chain1/tendermint tendermint node --skip_upnp --log_level=info &> $LOG_DIR/chain1_tendermint.log &
BASECOIN_ROOT=$BCROOT1 basecoin start --without-tendermint &> $LOG_DIR/chain1_basecoin.log &
BCHOME=$BCHOME1 basecoin start --without-tendermint &> $LOG_DIR/chain1_basecoin.log &
# start the second node
TMROOT=./data/chain2/tendermint tendermint node --skip_upnp --log_level=info --node_laddr tcp://localhost:36656 --rpc_laddr tcp://localhost:36657 --proxy_app tcp://localhost:36658 &> $LOG_DIR/chain2_tendermint.log &
BASECOIN_ROOT=$BCROOT2 basecoin start --address tcp://localhost:36658 --without-tendermint &> $LOG_DIR/chain2_basecoin.log &
BCHOME=$BCHOME2 basecoin start --address tcp://localhost:36658 --without-tendermint &> $LOG_DIR/chain2_basecoin.log &
echo ""
echo "... waiting for chains to start"

View File

@ -45,10 +45,10 @@ First, create a new directory:
mkdir example-data
```
We can tell `basecoin` to use this directory by exporting the `BASECOIN_ROOT` environment variable:
We can tell `basecoin` to use this directory by exporting the `BCHOME` environment variable:
```
export BASECOIN_ROOT=$(pwd)/example-data
export BCHOME=$(pwd)/example-data
```
If you're going to be using multiple terminal windows, make sure to add this variable to your shell startup scripts (eg. `~/.bashrc`).
@ -56,7 +56,7 @@ If you're going to be using multiple terminal windows, make sure to add this var
Now, let's create a new private key:
```
basecoin key new > $BASECOIN_ROOT/key.json
basecoin key new > $BCHOME/key.json
```
Here's what my `key.json looks like:

View File

@ -195,14 +195,14 @@ We can start the two chains as follows:
```
TMROOT=./data/chain1/tendermint tendermint node &> chain1_tendermint.log &
BASECOIN_ROOT=./data/chain1/basecoin basecoin start --without-tendermint &> chain1_basecoin.log &
BCHOME=./data/chain1/basecoin basecoin start --without-tendermint &> chain1_basecoin.log &
```
and
```
TMROOT=./data/chain2/tendermint tendermint node --node_laddr tcp://localhost:36656 --rpc_laddr tcp://localhost:36657 --proxy_app tcp://localhost:36658 &> chain2_tendermint.log &
BASECOIN_ROOT=./data/chain2/basecoin basecoin start --without-tendermint --address tcp://localhost:36658 &> chain2_basecoin.log &
BCHOME=./data/chain2/basecoin basecoin start --without-tendermint --address tcp://localhost:36658 &> chain2_basecoin.log &
```
Note how we refer to the relevant data directories. Also note how we have to set the various addresses for the second node so as not to conflict with the first.
@ -227,7 +227,7 @@ export CHAIN_ID2=test_chain_2
export CHAIN_FLAGS1="--chain_id $CHAIN_ID1 --from ./data/chain1/basecoin/key.json"
export CHAIN_FLAGS2="--chain_id $CHAIN_ID2 --from ./data/chain2/basecoin/key.json --node tcp://localhost:36657"
export BASECOIN_ROOT="."
export BCHOME="."
```
Let's start by registering `test_chain_1` on `test_chain_2`: