github.com/aergoio/aergo@v1.3.1/consensus/impl/raftv2/test/set_system_admin.sh (about) 1 #!/usr/bin/env bash 2 source set_test_env.sh 3 source test_common.sh 4 5 pushd $TEST_RAFT_INSTANCE 6 7 if [ ! -e genesis -o ! -e genesis.json -o -e wif.tx ]; then 8 echo "Err: Not exist genesis account(required files: genesis, genesis.json, wif.txt)" 9 exit 100 10 fi 11 12 _leaderport_= 13 getLeaderPort _leaderport_ 14 if [ $? -ne 0 -o "$_leaderport_" = "" ];then 15 echo "failed to get leader port" 16 exit 100 17 fi 18 19 # set admin 20 CLI="aergocli -p $_leaderport_" 21 ADMIN= 22 getAdminUnlocked $_leaderport_ ./genesis_wallet.txt ADMIN 23 24 echo `$CLI account unlock --address $ADMIN --password 1234` 25 $CLI account unlock --address $ADMIN --password 1234 26 echo "$CLI contract call --governance $ADMIN aergo.enterprise appendAdmin '[\"$ADMIN\"]'" 27 $CLI contract call --governance $ADMIN aergo.enterprise appendAdmin '["'$ADMIN'"]' 28 29 popd 30 sleep 5