|
1 |
| -#!/usr/bin/env zsh |
2 |
| -# chmod +x ./infrablockchain_bios_local_testnet.sh |
| 1 | +#!/usr/bin/env bash |
| 2 | +# chmod +x ./local_testnet_boot_bios_infrablockchain.sh |
3 | 3 |
|
4 | 4 | setopt shwordsplit
|
5 | 5 |
|
| 6 | +export SCRIPT_DIR=$(dirname $(realpath "$0")) |
| 7 | +export INFRABLOCKCHAIN_HOME=$(realpath "$SCRIPT_DIR/..") |
| 8 | +#export INFRABLOCKCHAIN_HOME=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain-2-git |
| 9 | + |
6 | 10 | export INFRA_NODE_BIN_NAME=infra-node
|
7 | 11 | export INFRA_CLI_BIN_NAME=infra-cli
|
8 | 12 | export INFRA_KEYCHAIN_BIN_NAME=infra-keychain
|
9 | 13 |
|
10 |
| -export INFRABLOCKCHAIN_HOME=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain-2-git |
| 14 | +export INFRA_BLOCKCHAIN_DATA_BASE_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data |
| 15 | +export INFRA_BLOCKCHAIN_LOG_BASE_DIR=${INFRA_BLOCKCHAIN_DATA_BASE_DIR}/log |
11 | 16 |
|
12 |
| -export INFRA_NODE=$INFRABLOCKCHAIN_HOME/build/bin/$INFRA_NODE_BIN_NAME |
13 |
| -export INFRA_NODE_LOG_FILE=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/log/$INFRA_NODE_BIN_NAME.log |
| 17 | +export INFRA_NODE=${INFRABLOCKCHAIN_HOME}/build/bin/$INFRA_NODE_BIN_NAME |
| 18 | +export INFRA_NODE_LOG_FILE=${INFRA_BLOCKCHAIN_LOG_BASE_DIR}/$INFRA_NODE_BIN_NAME.log |
14 | 19 |
|
15 | 20 | export INFRA_CLI=($INFRABLOCKCHAIN_HOME/build/bin/$INFRA_CLI_BIN_NAME --wallet-url http://127.0.0.1:8900/)
|
16 |
| -export INFRA_KEYCHAIN=$INFRABLOCKCHAIN_HOME/build/bin/$INFRA_KEYCHAIN_BIN_NAME |
17 |
| -export INFRA_KEYCHAIN_LOG_FILE=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/log/$INFRA_KEYCHAIN_BIN_NAME.log |
18 |
| -export INFRABLOCKCHAIN_DEV_WALLET_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/infrablockchain_dev_wallet |
| 21 | +export INFRA_KEYCHAIN=${INFRABLOCKCHAIN_HOME}/build/bin/$INFRA_KEYCHAIN_BIN_NAME |
| 22 | +export INFRA_KEYCHAIN_LOG_FILE=${INFRA_BLOCKCHAIN_LOG_BASE_DIR}/$INFRA_KEYCHAIN_BIN_NAME.log |
| 23 | +export INFRABLOCKCHAIN_DEV_WALLET_DIR=${INFRA_BLOCKCHAIN_DATA_BASE_DIR}/infrablockchain_dev_wallet |
19 | 24 | export INFRA_KEYCHAIN_WALLET_PASSWORD=PW5JcN2AfwXxAV12W1mofb7pbeyJEwwie4JsCaTZvMx5kt38P8TP1
|
20 | 25 | export INFRA_KEYCHAIN_WALLET_NAME=local-testnet
|
21 | 26 |
|
22 |
| -export INFRA_NODE_CONFIG=$INFRABLOCKCHAIN_HOME/infrablockchain-bios/config/config_infrablockchain_local_testnet.ini |
23 |
| -export INFRA_NODE_GENESIS_JSON=$INFRABLOCKCHAIN_HOME/infrablockchain-bios/config/genesis_infrablockchain_local_testnet.json |
24 |
| -export INFRA_NODE_DATA_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/infra_node_data |
| 27 | +export INFRA_NODE_CONFIG=${INFRABLOCKCHAIN_HOME}/infrablockchain-bios/config/config_infrablockchain_local_testnet.ini |
| 28 | +export INFRA_NODE_GENESIS_JSON=${INFRABLOCKCHAIN_HOME}/infrablockchain-bios/config/genesis_infrablockchain_local_testnet.json |
| 29 | +export INFRA_NODE_DATA_DIR=${INFRA_BLOCKCHAIN_DATA_BASE_DIR}/infra_node_data |
25 | 30 |
|
26 |
| -export INFRABLOCKCHAIN_CONTRACTS_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain.contracts-git/build/contracts |
| 31 | +export INFRABLOCKCHAIN_CONTRACTS_DIR=${INFRABLOCKCHAIN_HOME}/contracts/contracts |
27 | 32 |
|
28 | 33 | export SYS_ACCOUNT=eosio
|
29 | 34 | #export SYS_ACCOUNT=infrasys
|
@@ -76,6 +81,9 @@ print_section_title() {
|
76 | 81 | set -x
|
77 | 82 | }
|
78 | 83 |
|
| 84 | +mkdir -p ${INFRA_BLOCKCHAIN_DATA_BASE_DIR} |
| 85 | +mkdir -p ${INFRA_BLOCKCHAIN_LOG_BASE_DIR} |
| 86 | + |
79 | 87 | { print_section_title "Reset infra-node data"; } 2>/dev/null
|
80 | 88 |
|
81 | 89 | pgrep $INFRA_NODE_BIN_NAME
|
@@ -132,7 +140,7 @@ curl -X POST ${INFRA_NODE_API_ENDPOINT}/v1/producer/schedule_protocol_feature_ac
|
132 | 140 | { print_section_title "Install InfraBlockchain BOOT Contract"; } 2>/dev/null
|
133 | 141 |
|
134 | 142 | sleep 2
|
135 |
| -$INFRA_CLI set contract ${SYS_ACCOUNT} $INFRABLOCKCHAIN_HOME/build/contracts/contracts/eosio.boot/ -p ${SYS_ACCOUNT}@active |
| 143 | +$INFRA_CLI set contract ${SYS_ACCOUNT} $INFRABLOCKCHAIN_CONTRACTS_DIR/eosio.boot/bin eosio.boot.wasm eosio.boot.abi -p ${SYS_ACCOUNT}@active |
136 | 144 | sleep 2
|
137 | 145 |
|
138 | 146 | # Activate Protocol Feature for InfraBlockchain
|
@@ -162,14 +170,14 @@ $INFRA_CLI create account ${SYS_ACCOUNT} sys.txfee PUB_K1_73E1bUPyVMTb7gjvvhk3bh
|
162 | 170 | { print_section_title "Install InfraBlockchain System Contract"; } 2>/dev/null
|
163 | 171 |
|
164 | 172 | sleep 2
|
165 |
| -$INFRA_CLI set contract ${SYS_ACCOUNT} $INFRABLOCKCHAIN_CONTRACTS_DIR/infra.system/ -p ${SYS_ACCOUNT}@active --txfee-payer ${SYS_ACCOUNT} |
| 173 | +$INFRA_CLI set contract ${SYS_ACCOUNT} $INFRABLOCKCHAIN_CONTRACTS_DIR/infra.system/bin infra.system.wasm infra.system.abi -p ${SYS_ACCOUNT}@active --txfee-payer ${SYS_ACCOUNT} |
166 | 174 | sleep 2
|
167 | 175 |
|
168 | 176 |
|
169 | 177 | { print_section_title "Install Standard Token ABI Interface System Contract"; } 2>/dev/null
|
170 | 178 |
|
171 | 179 | sleep 2
|
172 |
| -$INFRA_CLI set contract sys.tokenabi $INFRABLOCKCHAIN_CONTRACTS_DIR/sys.tokenabi/ -p sys.tokenabi@active --txfee-payer ${SYS_ACCOUNT} |
| 180 | +$INFRA_CLI set contract sys.tokenabi $INFRABLOCKCHAIN_CONTRACTS_DIR/sys.tokenabi/bin sys.tokenabi.wasm sys.tokenabi.abi -p sys.tokenabi@active --txfee-payer ${SYS_ACCOUNT} |
173 | 181 | sleep 2
|
174 | 182 |
|
175 | 183 |
|
|
0 commit comments