Skip to content
Snippets Groups Projects
Commit ac593750 authored by Ethan Buchman's avatar Ethan Buchman Committed by Casey Kuhlman
Browse files

untested register/install

parent 6dbcf76f
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ if [ ! -e "${CHAIN_DIR}/config.toml" ]; then ...@@ -37,7 +37,7 @@ if [ ! -e "${CHAIN_DIR}/config.toml" ]; then
ifExit "Error copying config file from $ECM_PATH to $CHAIN_DIR" ifExit "Error copying config file from $ECM_PATH to $CHAIN_DIR"
if [ "$SEED_NODE" = "" ]; then if [ "$SEED_NODE" = "" ]; then
SEED_NODE=$NODE_HOST SEED_NODE=$P2P_HOST
fi fi
if [ "$HOST_NAME" = "" ]; then if [ "$HOST_NAME" = "" ]; then
...@@ -49,7 +49,7 @@ fi ...@@ -49,7 +49,7 @@ fi
if [ "$SEED_NODE" != "" ]; then if [ "$SEED_NODE" != "" ]; then
echo "Seed node: $SEED_NODE" echo "Seed node: $SEED_NODE"
# NOTE the NODE_HOST must not have any slashes (no http://) # NOTE the NODE_HOST must not have any slashes (no http://)
sed -i "s/^\(seeds\s*=\s*\).*\$/\1\"$NODE_HOST\"/" "${CHAIN_DIR}/config.toml" sed -i "s/^\(seeds\s*=\s*\).*\$/\1\"$SEED_NODE\"/" "${CHAIN_DIR}/config.toml"
ifExit "Error setting seed node in config.toml" ifExit "Error setting seed node in config.toml"
fi fi
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
echo "your new chain, kind marmot: $CHAIN_ID" echo "your new chain, kind marmot: $CHAIN_ID"
# lay the genesis
# if it exists, just overwrite the chain id
if [ ! -f $CHAIN_DIR/genesis.json ]; then if [ ! -f $CHAIN_DIR/genesis.json ]; then
if [ "$CSV" = "" ]; then if [ "$CSV" = "" ]; then
mintgen random --dir="$CHAIN_DIR" 1 $CHAIN_ID mintgen random --dir="$CHAIN_DIR" 1 $CHAIN_ID
...@@ -26,6 +28,22 @@ else ...@@ -26,6 +28,22 @@ else
cat $CHAIN_DIR/config.toml cat $CHAIN_DIR/config.toml
fi fi
# if an address is given, keys service should have the priv key
if [ "$REGISTER_ADDRESS" != "" ]; then
echo "registering $CHAIN_ID with the etcb_testnet at interblock.io from address $REGISTER_ADDRESS"
# register the genesis
mintx --node-addr http://interblock.io:46657/ --sign-addr http://keys:4767 --addr $REGISTER_ADDRESS name --name "$CHAIN_ID:genesis" --data $(cat $CHAIN_DIR/genesis.json) --amt 10000 --fee 0 --sign --broadcast --wait
ifExit "Error registering genesis with etcb_testnet"
# register the seed/s
mintx --node-addr http://interblock.io:46657/ --sign-addr http://keys:4767 --addr $REGISTER_ADDRESS name --name "$CHAIN_ID:seeds" --data $NEW_P2P_SEEDS --amt 10000 --fee 0 --sign --broadcast --wait
ifExit "Error registering seeds with etcb_testnet"
fi
# run the node.
# TODO: maybe bring back this stopping option if we think its useful
# tendermint node & last_pid=$! && sleep 1 && kill -KILL $last_pid
if [ $ERISDB_API ]; then if [ $ERISDB_API ]; then
echo "Running chain $CHAIN_ID (via ErisDB API)" echo "Running chain $CHAIN_ID (via ErisDB API)"
erisdb $TMROOT erisdb $TMROOT
......
...@@ -33,6 +33,9 @@ fi ...@@ -33,6 +33,9 @@ fi
if [ ! $NODE_HOST ]; then if [ ! $NODE_HOST ]; then
NODE_HOST=interblock.io:46657 NODE_HOST=interblock.io:46657
fi fi
if [ ! $P2P_HOST ]; then
P2P_HOST=interblock.io:46656
fi
if [ ! $NODE_ADDR ]; then if [ ! $NODE_ADDR ]; then
NODE_ADDR=http://$NODE_HOST NODE_ADDR=http://$NODE_HOST
fi fi
...@@ -92,6 +95,7 @@ export TMROOT ...@@ -92,6 +95,7 @@ export TMROOT
export CHAIN_DIR export CHAIN_DIR
export NODE_ADDR export NODE_ADDR
export NODE_HOST export NODE_HOST
export P2P_HOST
export ECM_PATH # set by Dockerfile export ECM_PATH # set by Dockerfile
# print the version # print the version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment