加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
testnet.template 5.24 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
# set up a wallet just for holding the key used during blockchain ignition
bioshost=$BIOS_HOSTNAME
if [ -z "$bioshost" ]; then
bioshost=localhost
fi
biosport=$BIOS_HTTP_PORT
if [ -z "$biosport" ]; then
biosport=9776
fi
bioscontractpath=$BIOS_CONTRACT_PATH
if [ -z "$bioscontractpath" ]; then
bioscontractpath="unittests/contracts/eosio.bios"
fi
wddir=eosio-ignition-wd
wdaddr=localhost:8899
wdurl=http://$wdaddr
# Manual deployers, add a line below this block that looks like:
# bioshost=$BIOS_HOSTNAME
# biosport=$BIOS_HTTP_PORT
# cnt_dir=$CONTRACT_DIR
# sys=$SYS_CONTRACT
# where $BIOS_HOSTNAME is replaced by the hostname portion of the http-server-address configured
# for the nodeos instance running to bios producer
# ------ DO NOT ALTER THE NEXT LINE -------
###INSERT envars
logfile=$wddir/bootlog.txt
if [ -e $wddir ]; then
rm -rf $wddir
fi
mkdir $wddir
step=1
echo Initializing ignition sequence at $(date) | tee $logfile
echo "FEATURE_DIGESTS: $FEATURE_DIGESTS" >> $logfile
echo "http-server-address = $wdaddr" > $wddir/config.ini
programs/keosd/keosd --config-dir $wddir --data-dir $wddir 2> $wddir/wdlog.txt &
echo $$ > ignition_wallet.pid
echo keosd log in $wddir/wdlog.txt >> $logfile
sleep 1
ecmd () {
echo ===== Start: $step ============ >> $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport $* | tee -a $logfile
echo ----------------------- >> $logfile
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport $* >> $logfile 2>&1
echo ==== End: $step ============== >> $logfile
step=$(($step + 1))
}
wcmd () {
ecmd wallet $*
}
cacmd () {
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport system newaccount --transfer --stake-net "10000000.0000 SYS" --stake-cpu "10000000.0000 SYS" --buy-ram "10000000.0000 SYS" eosio $* >> $logfile 2>&1
ecmd system regproducer $1 $2
ecmd system voteproducer prods $1 $1
}
sleep 2
ecmd get info
wcmd create --to-console -n ignition
# Manual deployers, add a line below this block that looks like:
# wcmd import -n ignition --private-key $PRODKEY[0]
# wcmd import -n ignition --private-key $PRODKEY[1]
# ...
# wcmd import -n ignition --private-key $PRODKEY[20]
# where $BIOSKEY is replaced by the private key for the bios node
# ------ DO NOT ALTER THE NEXT LINE -------
###INSERT prodkeys
ecmd set contract eosio $bioscontractpath eosio.bios.wasm eosio.bios.abi
# Preactivate all digests
for digest in $FEATURE_DIGESTS;
do
ecmd push action eosio activate "{\"feature_digest\":\"$digest\"}" -p eosio
done
# Create required system accounts
ecmd create key --to-console
pubsyskey=`grep "^Public key:" $logfile | tail -1 | sed "s/^Public key://"`
prisyskey=`grep "^Private key:" $logfile | tail -1 | sed "s/^Private key://"`
echo eosio.* keys: $prisyskey $pubsyskey >> $logfile
wcmd import -n ignition --private-key $prisyskey
ecmd create account eosio eosio.bpay $pubsyskey $pubsyskey
ecmd create account eosio eosio.msig $pubsyskey $pubsyskey
ecmd create account eosio eosio.names $pubsyskey $pubsyskey
ecmd create account eosio eosio.ram $pubsyskey $pubsyskey
ecmd create account eosio eosio.ramfee $pubsyskey $pubsyskey
ecmd create account eosio eosio.saving $pubsyskey $pubsyskey
ecmd create account eosio eosio.stake $pubsyskey $pubsyskey
ecmd create account eosio eosio.token $pubsyskey $pubsyskey
ecmd create account eosio eosio.vpay $pubsyskey $pubsyskey
ecmd create account eosio eosio.wrap $pubsyskey $pubsyskey
ecmd set contract eosio.token unittests/contracts/eosio.token eosio.token.wasm eosio.token.abi
ecmd set contract eosio.msig unittests/contracts/eosio.msig eosio.msig.wasm eosio.msig.abi
ecmd set contract eosio.wrap unittests/contracts/eosio.wrap eosio.wrap.wasm eosio.wrap.abi
echo ===== Start: $step ============ >> $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token | tee -a $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio | tee -a $logfile
echo ----------------------- >> $logfile
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token >> $logfile 2>&1
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio >> $logfile 2>&1
echo ==== End: $step ============== >> $logfile
step=$(($step + 1))
ecmd set contract eosio unittests/contracts/eosio.system eosio.system.wasm eosio.system.abi
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio init '[0, "4,SYS"]' -p eosio >> $logfile 2>&1
# Manual deployers, add a series of lines below this block that looks like:
# cacmd $PRODNAME[0] $OWNERKEY[0] $ACTIVEKEY[0]
# cacmd $PRODNAME[1] $OWNERKEY[1] $ACTiVEKEY[1]
# ...
# cacmd $PRODNAME[20] $OWNERKEY[20] $ACTIVEKEY[20]
# where $PRODNAME is the producer account name and $OWNERKEY and $ACTIVEKEY are both the producer's
# public key
# ------ DO NOT ALTER THE NEXT LINE -------
###INSERT cacmd
pkill -15 keosd
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化