Skip to content

Commit

Permalink
fix: ci error
Browse files Browse the repository at this point in the history
  • Loading branch information
zemyblue committed Oct 10, 2023
1 parent eb574d9 commit 0aee807
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-smart-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ jobs:
- name: Set configure file
run: |
export FNSAD="docker run -i --rm -p 26656:26656 -p 26657:26657 -v ${pwd}/.finschia:/root/.finschia ${{ env.TEST_DOCKER_IMAGE }} fnsad-proxy"
export CHAIN_DIR="/root/.finschia"
./init_single.sh
shell: bash
# sleep 5 seconds to wait for finschia to start up
Expand Down
38 changes: 21 additions & 17 deletions init_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ set -ex

mode="mainnet"

CONFIG_DIR=${HOME}/.fnsap
CHAIN_DIR=${CHAIN_DIR:~CONFIG_DIR}

if [[ $1 == "docker" ]]
then
if [[ $2 == "testnet" ]]
then
mode="testnet"
fi
FNSAD="docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.fnsap:/root/.fnsap line/finschia-proxy fnsad-proxy"
FNSAD="docker run -i -p 26656:26656 -p 26657:26657 -v ${CONFIG_DIR}:/root/.fnsap finschia/finschia-proxy fnsad-proxy"
CHAIN_DIR="/root/.fnsap"
elif [[ $1 == "testnet" ]]
then
mode="testnet"
Expand Down Expand Up @@ -37,7 +41,7 @@ if [[ ${mode} == "testnet" ]]
then
if [[ $1 == "docker" ]]
then
docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.fnsap:/root/.fnsap line/finschia-proxy sh -c "export FNSAD_TESTNET=true"
docker run -i -p 26656:26656 -p 26657:26657 -v ${CONFIG_DIR}:/root/.fnsap line/finschia-proxy sh -c "export FNSAD_TESTNET=true"
else
export FNSAD_TESTNET=true
fi
Expand All @@ -46,12 +50,12 @@ fi
# Please do not use the TEST_MNEMONIC for production purpose
TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have"

${FNSAD} keys add jack --keyring-backend=test --recover --account=0 <<< ${TEST_MNEMONIC}
${FNSAD} keys add alice --keyring-backend=test --recover --account=1 <<< ${TEST_MNEMONIC}
${FNSAD} keys add bob --keyring-backend=test --recover --account=2 <<< ${TEST_MNEMONIC}
${FNSAD} keys add rinah --keyring-backend=test --recover --account=3 <<< ${TEST_MNEMONIC}
${FNSAD} keys add sam --keyring-backend=test --recover --account=4 <<< ${TEST_MNEMONIC}
${FNSAD} keys add evelyn --keyring-backend=test --recover --account=5 <<< ${TEST_MNEMONIC}
${FNSAD} keys add jack --home=${CHAIN_DIR} --keyring-backend=test --recover --account=0 <<< ${TEST_MNEMONIC}
${FNSAD} keys add alice --home=${CHAIN_DIR} --keyring-backend=test --recover --account=1 <<< ${TEST_MNEMONIC}
${FNSAD} keys add bob --home=${CHAIN_DIR} --keyring-backend=test --recover --account=2 <<< ${TEST_MNEMONIC}
${FNSAD} keys add rinah --home=${CHAIN_DIR} --keyring-backend=test --recover --account=3 <<< ${TEST_MNEMONIC}
${FNSAD} keys add sam --home=${CHAIN_DIR} --keyring-backend=test --recover --account=4 <<< ${TEST_MNEMONIC}
${FNSAD} keys add evelyn --home=${CHAIN_DIR} --keyring-backend=test --recover --account=5 <<< ${TEST_MNEMONIC}

# TODO
#if [[ ${mode} == "testnet" ]]
Expand All @@ -61,17 +65,17 @@ ${FNSAD} keys add evelyn --keyring-backend=test --recover --account=5 <<< ${TEST
# ${FNSAD} add-genesis-account link15la35q37j2dcg427kfy4el2l0r227xwhuaapxd 9223372036854775807link,1stake
#fi
# Add both accounts, with coins to the genesis file
${FNSAD} add-genesis-account $(${FNSAD} keys show jack -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show alice -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show bob -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show rinah -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show sam -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show evelyn -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show jack -a --home=${CHAIN_DIR} --keyring-backend=test) 1000link,1000000000000stake --home=${CHAIN_DIR}
${FNSAD} add-genesis-account $(${FNSAD} keys show alice -a --home=${CHAIN_DIR} --keyring-backend=test) 1000link,1000000000000stake --home=${CHAIN_DIR}
${FNSAD} add-genesis-account $(${FNSAD} keys show bob -a --home=${CHAIN_DIR} --keyring-backend=test) 1000link,1000000000000stake --home=${CHAIN_DIR}
${FNSAD} add-genesis-account $(${FNSAD} keys show rinah -a --home=${CHAIN_DIR} --keyring-backend=test) 1000link,1000000000000stake --home=${CHAIN_DIR}
${FNSAD} add-genesis-account $(${FNSAD} keys show sam -a --home=${CHAIN_DIR} --keyring-backend=test) 1000link,1000000000000stake --home=${CHAIN_DIR}
${FNSAD} add-genesis-account $(${FNSAD} keys show evelyn -a --home=${CHAIN_DIR} --keyring-backend=test) 1000link,1000000000000stake --home=${CHAIN_DIR}

${FNSAD} gentx jack 100000000stake --keyring-backend=test --chain-id=finschia
${FNSAD} gentx jack 100000000stake --home=${CHAIN_DIR} --keyring-backend=test --chain-id=finschia

${FNSAD} collect-gentxs
${FNSAD} collect-gentxs --home=${CHAIN_DIR}

${FNSAD} validate-genesis
${FNSAD} validate-genesis --home=${CHAIN_DIR}

# ${FNSAD} start --log_level *:debug --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656

0 comments on commit 0aee807

Please sign in to comment.