github.com/aergoio/aergo@v1.3.1/consensus/impl/raftv2/test/seed_tx.sh (about) 1 #!/bin/bash 2 3 if [ $# != 3 ];then 4 echo "Usage: $0 port genesis_addr startNonce" 5 fi 6 7 # 어떤 클라이언트 8 port=$1 9 # 지갑 갯수 10 genesis_addr=$2 11 # tx 수량 12 #count2=$3 13 j=$3 14 15 target=10001 16 17 echo "" 18 echo "================== sign tx =====================" 19 echo " run : $0 $port $genesis_addr $j" 20 echo "================================================" 21 22 # 지갑 생성 & 언락 23 aergocli -p ${port} account unlock --address ${genesis_addr} --password 1234 24 25 chain_id_hash=`aergocli -p ${port} blockchain | jq .ChainIdHash` 26 echo "chainid=$chain_id_hash" 27 28 # 트랜잭션 생성 29 30 rm -rf $genesis_addr.tmp 31 touch $genesis_addr.tmp 32 echo "[" >> $genesis_addr.tmp 33 34 # 각 계좌에 종자돈을 송금해 놓는다. 35 echo "============== sign seed money tx for all accounts ==============" 36 while read line 37 do 38 aergocli -p ${port} signtx --jsontx \ 39 "{\"account\":\"$genesis_addr\", \ 40 \"nonce\": $j , \ 41 \"price\": \"1\" , \ 42 \"limit\": 100 , \ 43 \"recipient\":\"$line\", \ 44 \"type\": 0, \ 45 \"chainidhash\": $chain_id_hash, \ 46 \"amount\": \"1000000000000000000000000\" }" \ 47 --address $genesis_addr --password 1234 >> $genesis_addr.tmp 48 echo "," >> $genesis_addr.tmp 49 echo $j $line 50 j=$(($j+1)) 51 done < account_${target}.txt 52 53 truncate -s -2 $genesis_addr.tmp 54 echo "]" >> $genesis_addr.tmp 55 56 echo "============== confirm seed money for all accounts ==============" 57 # 트랜잭션 컨펌 58 aergocli -p ${port} committx --jsontxpath $genesis_addr.tmp