Node settings
To register BP, eosio.stem contract should be on released state. Below is a Shell script content that releases eosio.contract and creates the producer Account. Contract dir of line 7 is an address printed from the 5. contract 설치.
ODE_URL
- node urlCONTRACT_DIR
- contract folderBP_NAME
- BP account nameBP_PUBLIC_KEY
- Public KeySYMBOL
- symbolSTAKE_NET
- netSTAKE_CPU
- cpuBUY_RAM
- ram
If the script file creation is completed, execute that file by entering sh node_setting.sh
command.
~# touch node_setting.sh
~# vi node_setting.sh
#!/bin/sh
NODE_URL=[Node URL]
CONTRACT_DIR=[eosio.contract Dir]
BP_NAME=[BP Name]
BP_PUBLIC_KEY=[BP_PUBLIC_KEY]
SYMBOL=[Symbol]
STAKE_NET=[BP_stake_net]
STAKE_CPU=[BP_stake_cpu]
BUY_RAM=[Buy_ram]
alias cleos='cleos -u $NODE_URL '
## ex
# NODE_URL='http://localhost:18888'
# CONTRACT_DIR='/home/omnione/eosio.contract/build/contract'
# BP_NAME='producer'
# BP_PUBLIC_KEY='EOS2kmrf...Z2dzS'
# SYMBOL='SYS'
# STAKE_NET='100000000.0000'
# STAKE_CPU='100000000.0000'
# BUY_RAM='1000000.0000'
echo
echo
echo "================================="
echo "Create important system accounts"
echo "================================="
echo
for eosioname in eosio.bpay eosio.msig eosio.names eosio.ram eosio.ramfee eosio.saving eosio.stake eosio.token eosio.vpay eosio.rex
do
cleos create account eosio $eosioname eosio@active -p eosio@active
sleep 0.5
done
echo
echo
echo
echo "================================="
echo "Set the eosio.msig eosio.token contract"
echo "================================="
echo
cleos set contract eosio.msig $CONTRACT_DIR/eosio.msig/
sleep 1
cleos set contract eosio.token $CONTRACT_DIR/eosio.token/
sleep 1
echo
echo
echo "================================="
echo "Create and allocate the SYS currency"
echo "================================="
echo
cleos push action eosio.token create '[ "eosio", "10000000000.0000 $SYMBOL" ]' -p eosio.token@active
cleos push action eosio.token issue '[ "eosio", "1000000000.0000 $SYMBOL", "memo" ]' -p eosio@active
echo
echo
echo "================================="
echo "Set the eosio.system contract"
echo "================================="
echo
curl --request POST \
--url $NODE_URL/v1/producer/schedule_protocol_feature_activations \
-d '{"protocol_features_to_activate": ["0ec7e080177b2c02b278d5088611686b49d739925a92d9bfcacd7fc6b74053bd"]}'
sleep 2
echo
echo
cleos set contract eosio $CONTRACT_DIR/eosio.system/
sleep 1
echo
echo
# GET_SENDER
cleos push action eosio activate '["f0af56d2c5a48d60a4a5b5c903edfb7db3a736a94ed589d0b797df33ff9d3e1d"]' -p eosio
sleep 0.5
# FORWARD_SETCODE
cleos push action eosio activate '["2652f5f96006294109b3dd0bbde63693f55324af452b799ee137a81a905eed25"]' -p eosio
sleep 0.5
# ONLY_BILL_FIRST_AUTHORIZER
cleos push action eosio activate '["8ba52fe7a3956c5cd3a656a3174b931d3bb2abb45578befc59f283ecd816a405"]' -p eosio
sleep 0.5
# RESTRICT_ACTION_TO_SELF
cleos push action eosio activate '["ad9e3d8f650687709fd68f4b90b41f7d825a365b02c23a636cef88ac2ac00c43"]' -p eosio
sleep 0.5
# DISALLOW_EMPTY_PRODUCER_SCHEDULE
cleos push action eosio activate '["68dcaa34c0517d19666e6b33add67351d8c5f69e999ca1e37931bc410a297428"]' -p eosio
sleep 0.5
# FIX_LINKAUTH_RESTRICTION
cleos push action eosio activate '["e0fb64b1085cc5538970158d05a009c24e276fb94e1a0bf6a528b48fbc4ff526"]' -p eosio
sleep 0.5
# REPLACE_DEFERRED
cleos push action eosio activate '["ef43112c6543b88db2283a2e077278c315ae2c84719a8b25f25cc88565fbea99"]' -p eosio
sleep 0.5
# NO_DUPLICATE_DEFERRED_ID
cleos push action eosio activate '["4a90c00d55454dc5b059055ca213579c6ea856967712a56017487886a4d4cc0f"]' -p eosio
sleep 0.5
# ONLY_LINK_TO_EXISTING_PERMISSION
cleos push action eosio activate '["1a99a59d87e06e09ec5b028a9cbb7749b4a5ad8819004365d02dc4379a8b7241"]' -p eosio
sleep 0.5
# RAM_RESTRICTIONS
cleos push action eosio activate '["4e7bf348da00a945489b2a681749eb56f5de00b900014e137ddae39f48f69d67"]' -p eosio
sleep 1
# WEBAUTHN_KEY
cleos push action eosio activate '["4fca8bd82bbd181e714e283f83e1b45d95ca5af40fb89ad3977b653c448f78c2"]' -p eosio
sleep 1
# WTMSIG_BLOCK_SIGNATURES
cleos push action eosio activate '["299dcb6af692324b899b39f16d5a530a33062804e41f09dc97e9f156b4476707"]' -p eosio
sleep 1
echo
echo
echo "================================="
echo "Transition from single genesis producer to multiple producers"
echo "================================="
echo
echo
echo auth eosio.msg
cleos push action eosio setpriv '["eosio.msig", 1]' -p eosio@active
sleep 1
echo
cleos push action eosio init '["0", "4,$SYMBOL"]' -p eosio@active
sleep 1
echo
echo
echo "================================="
echo "Register the new account as a producer"
echo "================================="
echo
echo
echo "BP $BP_NAME"
cleos system newaccount --transfer eosio $BP_NAME $BP_PUBLIC_KEY \
--stake-net "$STAKE_NET $SYMBOL" \
--stake-cpu "$STAKE_CPU $SYMBOL" \
--buy-ram "$BUY_RAM $SYMBOL"
cleos transfer eosio $BP_NAME "10.0000 $SYMBOL"
Last updated