Skip to content

Commit 7c135d0

Browse files
committed
[infrablockchain-bios] local testnet config / test script
1 parent d78716b commit 7c135d0

7 files changed

+1421
-0
lines changed

infrablockchain-bios/commands.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
$INFRA_KEYCHAIN --http-server-address 127.0.0.1:8888
3+
$INFRA_KEYCHAIN --unlock-timeout 999999999 --http-server-address 127.0.0.1:8900 --wallet-dir $INFRABLOCKCHAIN_DEV_WALLET_DIR
4+
5+
$INFRA_CLI wallet create -n local-testnet --to-console
6+
Creating wallet: local-testnet
7+
Save password to use in the future to unlock this wallet.
8+
Without password imported keys will not be retrievable.
9+
"PW5JcN2AfwXxAV12W1mofb7pbeyJEwwie4JsCaTZvMx5kt38P8TP1"
10+
11+
$INFRA_CLI create key --to-console
12+
13+
export INFRA_CLI_V1=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain-git/build/bin/infra-cli
14+
$INFRA_CLI_V1 create key --to-console
15+
16+
$INFRA_NODE --print-default-config
17+
18+
19+
curl -X POST ${INFRA_NODE_API_ENDPOINT}/v1/producer/schedule_protocol_feature_activations -d '{"protocol_features_to_activate": ["0ec7e080177b2c02b278d5088611686b49d739925a92d9bfcacd7fc6b74053bd"]}'

infrablockchain-bios/config/config_infrablockchain_local_testnet.ini

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"initial_timestamp": "2018-12-15T12:00:00.000",
3+
"initial_key": "PUB_K1_73E1bUPyVMTb7gjvvhk3bhR1YnKi6TtzgJUL3Ykea8QGU1ZLfR",
4+
"initial_configuration": {
5+
"max_block_net_usage": 1048576,
6+
"target_block_net_usage_pct": 1000,
7+
"max_transaction_net_usage": 524288,
8+
"base_per_transaction_net_usage": 12,
9+
"net_usage_leeway": 500,
10+
"context_free_discount_net_usage_num": 20,
11+
"context_free_discount_net_usage_den": 100,
12+
"max_block_cpu_usage": 200000,
13+
"target_block_cpu_usage_pct": 1000,
14+
"max_transaction_cpu_usage": 150000,
15+
"min_transaction_cpu_usage": 100,
16+
"max_transaction_lifetime": 3600,
17+
"deferred_trx_expiration_window": 600,
18+
"max_transaction_delay": 3888000,
19+
"max_inline_action_size": 4096,
20+
"max_inline_action_depth": 4,
21+
"max_authority_depth": 6
22+
}
23+
}

infrablockchain-bios/infra-cli-features.txt

Lines changed: 124 additions & 0 deletions
Large diffs are not rendered by default.

infrablockchain-bios/infrablockchain_bios_local_testnet.sh

Lines changed: 511 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env zsh
2+
# chmod +x ./start_infrablockchain_testnet_node_local.sh
3+
4+
setopt shwordsplit
5+
6+
export INFRA_NODE_BIN_NAME=infra-node
7+
export INFRA_CLI_BIN_NAME=infra-cli
8+
export INFRA_KEYCHAIN_BIN_NAME=infra-keychain
9+
10+
export INFRABLOCKCHAIN_HOME=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain-2-git
11+
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
14+
15+
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
19+
export INFRA_KEYCHAIN_WALLET_PASSWORD=PW5JcN2AfwXxAV12W1mofb7pbeyJEwwie4JsCaTZvMx5kt38P8TP1
20+
export INFRA_KEYCHAIN_WALLET_NAME=local-testnet
21+
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
25+
26+
export INFRABLOCKCHAIN_CONTRACTS_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain.contracts-git/build/contracts
27+
28+
export SYS_ACCOUNT=eosio
29+
30+
export INFRA_NODE_API_ENDPOINT=http://127.0.0.1:8888
31+
32+
{ set +x; } 2>/dev/null
33+
red=`tput setaf 1`
34+
green=`tput setaf 2`
35+
magenta=`tput setaf 6`
36+
reset=`tput sgr0`
37+
set -x
38+
39+
{ set +x; } 2>/dev/null
40+
echo "${red}[(Re)Starting INFRABLOCKCHAIN Local Testnet]${reset}"
41+
echo
42+
echo "${green}INFRABLOCKCHAIN_HOME${reset}=${red}$INFRABLOCKCHAIN_HOME${reset}"
43+
echo "${green}INFRA_NODE${reset}=${red}$INFRA_NODE${reset}"
44+
echo "${green}INFRA_NODE_LOG_FILE${reset}=${red}$INFRA_NODE_LOG_FILE${reset}"
45+
echo "${green}INFRA_CLI${reset}=${red}$INFRA_CLI${reset}"
46+
echo "${green}INFRA_CLI_TESTNET${reset}=${red}$INFRA_CLI_TESTNET${reset}"
47+
echo "${green}INFRA_KEYCHAIN${reset}=${red}$INFRA_KEYCHAIN${reset}"
48+
echo "${green}INFRA_KEYCHAIN_LOG_FILE${reset}=${red}$INFRA_KEYCHAIN_LOG_FILE${reset}"
49+
echo "${green}INFRA_KEYCHAIN_WALLET_PASSWORD${reset}=${red}$INFRA_KEYCHAIN_WALLET_PASSWORD${reset}"
50+
echo "${green}INFRA_NODE_CONFIG${reset}=${red}$INFRA_NODE_CONFIG${reset}"
51+
echo "${green}INFRA_NODE_GENESIS_JSON${reset}=${red}$INFRA_NODE_GENESIS_JSON${reset}"
52+
echo "${green}INFRA_NODE_DATA_DIR${reset}=${red}$INFRA_NODE_DATA_DIR${reset}"
53+
echo "${green}INFRABLOCKCHAIN_DEV_WALLET_DIR${reset}=${red}$INFRABLOCKCHAIN_DEV_WALLET_DIR${reset}"
54+
echo "${green}INFRABLOCKCHAIN_CONTRACTS_DIR${reset}=${red}$INFRABLOCKCHAIN_CONTRACTS_DIR${reset}"
55+
echo "${green}SYS_ACCOUNT${reset}=${red}$SYS_ACCOUNT${reset}"
56+
echo "${green}INFRA_NODE_API_ENDPOINT${reset}=${red}INFRA_NODE_API_ENDPOINT${reset}"
57+
echo
58+
set -x
59+
60+
{ set +x; } 2>/dev/null
61+
echo "${red}Ready to (re)start InfraBlockchain Testnet node?${reset}"
62+
echo "write YES to proceed stop process."
63+
read USER_CONFIRM_TO_PROCEED
64+
if [ "$USER_CONFIRM_TO_PROCEED" != "YES" ]; then
65+
exit 1
66+
fi
67+
set -x
68+
69+
print_section_title() {
70+
{ set +x; } 2>/dev/null
71+
echo
72+
echo "${green}[$1]${reset}"
73+
echo
74+
set -x
75+
}
76+
77+
{ print_section_title "Stop infra-node"; } 2>/dev/null
78+
79+
pgrep $INFRA_NODE_BIN_NAME
80+
pkill -SIGINT $INFRA_NODE_BIN_NAME
81+
sleep 2
82+
tail $INFRA_NODE_LOG_FILE
83+
84+
85+
{ print_section_title "Stop key daemon"; } 2>/dev/null
86+
87+
pgrep $INFRA_KEYCHAIN_BIN_NAME
88+
pkill -SIGINT $INFRA_KEYCHAIN_BIN_NAME
89+
sleep 5
90+
tail $INFRA_KEYCHAIN_LOG_FILE
91+
92+
93+
{ print_section_title "Start key daemon"; } 2>/dev/null
94+
95+
nohup $INFRA_KEYCHAIN --unlock-timeout 999999999 --http-server-address 127.0.0.1:8900 --wallet-dir $INFRABLOCKCHAIN_DEV_WALLET_DIR > $INFRA_KEYCHAIN_LOG_FILE 2>&1&
96+
sleep 2
97+
$INFRA_CLI wallet open
98+
$INFRA_CLI wallet unlock --password $INFRA_KEYCHAIN_WALLET_PASSWORD
99+
tail $INFRA_KEYCHAIN_LOG_FILE
100+
101+
{ print_section_title "Start infra-node"; } 2>/dev/null
102+
103+
nohup $INFRA_NODE --config $INFRA_NODE_CONFIG --data-dir $INFRA_NODE_DATA_DIR --disable-replay-opts > $INFRA_NODE_LOG_FILE 2>&1&
104+
sleep 10
105+
tail $INFRA_NODE_LOG_FILE
106+
107+
{ set +x; } 2>/dev/null
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env bash
2+
# chmod +x ./stop_infrablockchain_testnet_node.sh
3+
4+
#YSMT_TESTNET_SSH_KEY_FILE=~/Documents/__HalfDomeChain__/AWS/ssh_key/ysmt_testnet_dev_server_ap_northeast_seoul.pem
5+
#YSMT_TESTNET_NODE_USER_HOST=ubuntu@ec2-13-124-23-23.ap-northeast-2.compute.amazonaws.com
6+
#scp -i ${YSMT_TESTNET_SSH_KEY_FILE} ./stop_infrablockchain_testnet_node.sh ${YSMT_TESTNET_NODE_USER_HOST}:/mnt/infrablockchain_testnet_mgmt/stop_infrablockchain_testnet_node.sh
7+
8+
setopt shwordsplit
9+
10+
export INFRA_NODE_BIN_NAME=infra-node
11+
export INFRA_CLI_BIN_NAME=infra-cli
12+
export INFRA_KEYCHAIN_BIN_NAME=infra-keychain
13+
14+
export INFRABLOCKCHAIN_HOME=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain-2-git
15+
16+
export INFRA_NODE=$INFRABLOCKCHAIN_HOME/build/bin/$INFRA_NODE_BIN_NAME
17+
export INFRA_NODE_LOG_FILE=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/log/$INFRA_NODE_BIN_NAME.log
18+
19+
export INFRA_CLI=($INFRABLOCKCHAIN_HOME/build/bin/$INFRA_CLI_BIN_NAME --wallet-url http://127.0.0.1:8900/)
20+
export INFRA_KEYCHAIN=$INFRABLOCKCHAIN_HOME/build/bin/$INFRA_KEYCHAIN_BIN_NAME
21+
export INFRA_KEYCHAIN_LOG_FILE=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/log/$INFRA_KEYCHAIN_BIN_NAME.log
22+
export INFRABLOCKCHAIN_DEV_WALLET_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/infrablockchain_dev_wallet
23+
export INFRA_KEYCHAIN_WALLET_PASSWORD=PW5JcN2AfwXxAV12W1mofb7pbeyJEwwie4JsCaTZvMx5kt38P8TP1
24+
export INFRA_KEYCHAIN_WALLET_NAME=local-testnet
25+
26+
export INFRA_NODE_CONFIG=$INFRABLOCKCHAIN_HOME/infrablockchain-bios/config/config_infrablockchain_local_testnet.ini
27+
export INFRA_NODE_GENESIS_JSON=$INFRABLOCKCHAIN_HOME/infrablockchain-bios/config/genesis_infrablockchain_local_testnet.json
28+
export INFRA_NODE_DATA_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain_local_testnet_data/infra_node_data
29+
30+
export INFRABLOCKCHAIN_CONTRACTS_DIR=/Users/bwlim/Documents/__InfraBlockchain__/infrablockchain.contracts-git/build/contracts
31+
32+
export SYS_ACCOUNT=eosio
33+
34+
export INFRA_NODE_API_ENDPOINT=http://127.0.0.1:8888
35+
36+
{ set +x; } 2>/dev/null
37+
red=`tput setaf 1`
38+
green=`tput setaf 2`
39+
magenta=`tput setaf 6`
40+
reset=`tput sgr0`
41+
set -x
42+
43+
{ set +x; } 2>/dev/null
44+
echo "${red}[Stopping InfraBlockchain Local Testnet]${reset}"
45+
echo
46+
echo "${green}INFRABLOCKCHAIN_HOME${reset}=${red}$INFRABLOCKCHAIN_HOME${reset}"
47+
echo "${green}INFRA_NODE${reset}=${red}$INFRA_NODE${reset}"
48+
echo "${green}INFRA_NODE_LOG_FILE${reset}=${red}$INFRA_NODE_LOG_FILE${reset}"
49+
echo "${green}INFRA_CLI${reset}=${red}$INFRA_CLI${reset}"
50+
echo "${green}INFRA_CLI_TESTNET${reset}=${red}$INFRA_CLI_TESTNET${reset}"
51+
echo "${green}INFRA_KEYCHAIN${reset}=${red}$INFRA_KEYCHAIN${reset}"
52+
echo "${green}INFRA_KEYCHAIN_LOG_FILE${reset}=${red}$INFRA_KEYCHAIN_LOG_FILE${reset}"
53+
echo "${green}INFRA_KEYCHAIN_WALLET_PASSWORD${reset}=${red}$INFRA_KEYCHAIN_WALLET_PASSWORD${reset}"
54+
echo "${green}INFRA_NODE_CONFIG${reset}=${red}$INFRA_NODE_CONFIG${reset}"
55+
echo "${green}INFRA_NODE_GENESIS_JSON${reset}=${red}$INFRA_NODE_GENESIS_JSON${reset}"
56+
echo "${green}INFRA_NODE_DATA_DIR${reset}=${red}$INFRA_NODE_DATA_DIR${reset}"
57+
echo "${green}INFRABLOCKCHAIN_DEV_WALLET_DIR${reset}=${red}$INFRABLOCKCHAIN_DEV_WALLET_DIR${reset}"
58+
echo "${green}INFRABLOCKCHAIN_CONTRACTS_DIR${reset}=${red}$INFRABLOCKCHAIN_CONTRACTS_DIR${reset}"
59+
echo "${green}SYS_ACCOUNT${reset}=${red}$SYS_ACCOUNT${reset}"
60+
echo "${green}INFRA_NODE_API_ENDPOINT${reset}=${red}INFRA_NODE_API_ENDPOINT${reset}"
61+
echo
62+
set -x
63+
64+
{ set +x; } 2>/dev/null
65+
echo "${red}Really want to stop InfraBlockchain Testnet node?${reset}"
66+
echo "write YES to proceed stop process."
67+
read USER_CONFIRM_TO_PROCEED
68+
if [ "$USER_CONFIRM_TO_PROCEED" != "YES" ]; then
69+
exit 1
70+
fi
71+
set -x
72+
73+
print_section_title() {
74+
{ set +x; } 2>/dev/null
75+
echo
76+
echo "${green}[$1]${reset}"
77+
echo
78+
set -x
79+
}
80+
81+
{ print_section_title "Stop infra-node"; } 2>/dev/null
82+
83+
pgrep $INFRA_NODE_BIN_NAME
84+
pkill -SIGINT $INFRA_NODE_BIN_NAME
85+
sleep 2
86+
tail $INFRA_NODE_LOG_FILE
87+
88+
{ print_section_title "Stop key daemon"; } 2>/dev/null
89+
90+
pgrep $INFRA_KEYCHAIN_BIN_NAME
91+
pkill -SIGINT $INFRA_KEYCHAIN_BIN_NAME
92+
sleep 5
93+
tail $INFRA_KEYCHAIN_LOG_FILE
94+
95+
96+
{ set +x; } 2>/dev/null

0 commit comments

Comments
 (0)