Commit aee5204e authored by vipwzw's avatar vipwzw

auto ci

parent 193a66a9
...@@ -49,7 +49,7 @@ function init() { ...@@ -49,7 +49,7 @@ function init() {
trans "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" "1DQUALqaqPUhJX6FWMCqhvnjrkb6ZfrRmf" 20000 trans "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" "1DQUALqaqPUhJX6FWMCqhvnjrkb6ZfrRmf" 20000
} }
function send_exec(){ function send_exec() {
addr=$1 addr=$1
coins=$2 coins=$2
tx=$(./chain33-cli --rpc_laddr="${rcpAddr}" coins send_exec -a "${coins}" -e dpos) tx=$(./chain33-cli --rpc_laddr="${rcpAddr}" coins send_exec -a "${coins}" -e dpos)
...@@ -57,7 +57,7 @@ function send_exec(){ ...@@ -57,7 +57,7 @@ function send_exec(){
./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}" ./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}"
} }
function reg(){ function reg() {
addr=$1 addr=$1
ip=$2 ip=$2
key=$3 key=$3
...@@ -68,7 +68,7 @@ function reg(){ ...@@ -68,7 +68,7 @@ function reg(){
sleep 3 sleep 3
} }
function reReg(){ function reReg() {
addr=$1 addr=$1
ip=$2 ip=$2
key=$3 key=$3
...@@ -78,7 +78,7 @@ function reReg(){ ...@@ -78,7 +78,7 @@ function reReg(){
./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}" ./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}"
sleep 3 sleep 3
} }
function cancelReg(){ function cancelReg() {
addr=$1 addr=$1
key=$2 key=$2
echo "dpos cancelRegist -a ${addr} -k ${key}" echo "dpos cancelRegist -a ${addr} -k ${key}"
...@@ -87,7 +87,7 @@ function cancelReg(){ ...@@ -87,7 +87,7 @@ function cancelReg(){
./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}" ./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}"
sleep 3 sleep 3
} }
function vote(){ function vote() {
addr=$1 addr=$1
key=$2 key=$2
votes=$3 votes=$3
...@@ -97,7 +97,7 @@ function vote(){ ...@@ -97,7 +97,7 @@ function vote(){
./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}" ./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}"
sleep 3 sleep 3
} }
function cancelVote(){ function cancelVote() {
addr=$1 addr=$1
key=$2 key=$2
index=$3 index=$3
...@@ -107,7 +107,7 @@ function cancelVote(){ ...@@ -107,7 +107,7 @@ function cancelVote(){
./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}" ./chain33-cli --rpc_laddr="${rcpAddr}" wallet send -d "${sig}"
sleep 3 sleep 3
} }
function regM(){ function regM() {
addr=$1 addr=$1
key=$2 key=$2
m=$3 m=$3
...@@ -119,7 +119,7 @@ function regM(){ ...@@ -119,7 +119,7 @@ function regM(){
sleep 3 sleep 3
} }
function regMn(){ function regMn() {
m=$1 m=$1
cycle=$2 cycle=$2
...@@ -136,8 +136,7 @@ function regMn(){ ...@@ -136,8 +136,7 @@ function regMn(){
regM "$addr" "$key" "$m" "$cycle" regM "$addr" "$key" "$m" "$cycle"
} }
function regRP() {
function regRP(){
addr=$1 addr=$1
key=$2 key=$2
r=$3 r=$3
...@@ -150,7 +149,7 @@ function regRP(){ ...@@ -150,7 +149,7 @@ function regRP(){
sleep 3 sleep 3
} }
function regRPn(){ function regRPn() {
r=$1 r=$1
p=$2 p=$2
cycle=$3 cycle=$3
...@@ -167,7 +166,7 @@ function regRPn(){ ...@@ -167,7 +166,7 @@ function regRPn(){
key="03F4AB6659E61E8512C9A24AC385CC1AC4D52B87D10ADBDF060086EA82BE62CDDE" key="03F4AB6659E61E8512C9A24AC385CC1AC4D52B87D10ADBDF060086EA82BE62CDDE"
regRP "$addr" "$key" "$r" "$p" "$cycle" regRP "$addr" "$key" "$r" "$p" "$cycle"
} }
function recordCB(){ function recordCB() {
cycle=$1 cycle=$1
height=$2 height=$2
hash=$3 hash=$3
...@@ -181,64 +180,64 @@ function recordCB(){ ...@@ -181,64 +180,64 @@ function recordCB(){
sleep 3 sleep 3
} }
function qtx(){ function qtx() {
tx=$1 tx=$1
./chain33-cli --rpc_laddr="${rcpAddr}" tx query -s "${tx}" ./chain33-cli --rpc_laddr="${rcpAddr}" tx query -s "${tx}"
} }
function qn(){ function qn() {
result=$(./chain33-cli --rpc_laddr="${rcpAddr}" dpos candidatorQuery -t topN -n "$1") result=$(./chain33-cli --rpc_laddr="${rcpAddr}" dpos candidatorQuery -t topN -n "$1")
echo "$result" echo "$result"
} }
function qk(){ function qk() {
./chain33-cli --rpc_laddr="${rcpAddr}" dpos candidatorQuery -t pubkeys -k "$1" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos candidatorQuery -t pubkeys -k "$1"
} }
function qv(){ function qv() {
./chain33-cli --rpc_laddr="${rcpAddr}" dpos voteQuery -a "$1" -k "$2" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos voteQuery -a "$1" -k "$2"
} }
function qvrf(){ function qvrf() {
type=$1 type=$1
cycle=$2 cycle=$2
./chain33-cli --rpc_laddr="${rcpAddr}" dpos vrfQuery -t "$type" -c "$cycle" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos vrfQuery -t "$type" -c "$cycle"
} }
function qvrfn(){ function qvrfn() {
cycle=$1 cycle=$1
./chain33-cli --rpc_laddr="${rcpAddr}" dpos vrfQuery -t "topN" -c "$cycle" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos vrfQuery -t "topN" -c "$cycle"
} }
function qvrfk(){ function qvrfk() {
cycle=$2 cycle=$2
keys=$1 keys=$1
./chain33-cli --rpc_laddr="${rcpAddr}" dpos vrfQuery -t "pubkeys" -c "$cycle" -k "${keys}" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos vrfQuery -t "pubkeys" -c "$cycle" -k "${keys}"
} }
function unlock(){ function unlock() {
./chain33-cli --rpc_laddr="${rcpAddr}" wallet unlock -p zzh123456 ./chain33-cli --rpc_laddr="${rcpAddr}" wallet unlock -p zzh123456
} }
function qtopn(){ function qtopn() {
version=$1 version=$1
./chain33-cli --rpc_laddr="${rcpAddr}" dpos topNQuery -v "${version}" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos topNQuery -v "${version}"
} }
function qcb(){ function qcb() {
type=$1 type=$1
param=$2 param=$2
if [ "${type}" == "cycle" ];then if [ "${type}" == "cycle" ]; then
./chain33-cli --rpc_laddr="${rcpAddr}" dpos cbQuery -t "cycle" -c "${param}" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos cbQuery -t "cycle" -c "${param}"
elif [ "${type}" == "height" ];then elif [ "${type}" == "height" ]; then
./chain33-cli --rpc_laddr="${rcpAddr}" dpos cbQuery -t "height" -m "${param}" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos cbQuery -t "height" -m "${param}"
elif [ "${type}" == "hash" ];then elif [ "${type}" == "hash" ]; then
./chain33-cli --rpc_laddr="${rcpAddr}" dpos cbQuery -t "hash" -s "${param}" ./chain33-cli --rpc_laddr="${rcpAddr}" dpos cbQuery -t "hash" -s "${param}"
fi fi
} }
#main #main
para="$1" para="$1"
if [ "$para" == "init" ];then if [ "$para" == "init" ]; then
init init
send_exec 15LsTP6tkYGZcN7tc1Xo2iYifQfowxot3b 15000 send_exec 15LsTP6tkYGZcN7tc1Xo2iYifQfowxot3b 15000
send_exec 14w5JaGDrXTZwF5Wv51UAtuGgAupenLAok 15000 send_exec 14w5JaGDrXTZwF5Wv51UAtuGgAupenLAok 15000
...@@ -253,52 +252,52 @@ function qcb(){ ...@@ -253,52 +252,52 @@ function qcb(){
vote 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 03EF0E1D3112CF571743A3318125EDE2E52A4EB904BCBAA4B1F75020C2846A7EB4 100 vote 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 03EF0E1D3112CF571743A3318125EDE2E52A4EB904BCBAA4B1F75020C2846A7EB4 100
vote 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 03F4AB6659E61E8512C9A24AC385CC1AC4D52B87D10ADBDF060086EA82BE62CDDE 200 vote 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 03F4AB6659E61E8512C9A24AC385CC1AC4D52B87D10ADBDF060086EA82BE62CDDE 200
elif [ "$para" == "sendExec" ];then elif [ "$para" == "sendExec" ]; then
send_exec 15LsTP6tkYGZcN7tc1Xo2iYifQfowxot3b 15000 send_exec 15LsTP6tkYGZcN7tc1Xo2iYifQfowxot3b 15000
send_exec 14w5JaGDrXTZwF5Wv51UAtuGgAupenLAok 15000 send_exec 14w5JaGDrXTZwF5Wv51UAtuGgAupenLAok 15000
send_exec 1DQUALqaqPUhJX6FWMCqhvnjrkb6ZfrRmf 15000 send_exec 1DQUALqaqPUhJX6FWMCqhvnjrkb6ZfrRmf 15000
elif [ "$para" == "reg" ];then elif [ "$para" == "reg" ]; then
reg "$2" "$3" "$4" reg "$2" "$3" "$4"
elif [ "$para" == "cancelReg" ];then elif [ "$para" == "cancelReg" ]; then
cancelReg "$2" "$3" cancelReg "$2" "$3"
elif [ "$para" == "reReg" ];then elif [ "$para" == "reReg" ]; then
reReg "$2" "$3" "$4" reReg "$2" "$3" "$4"
elif [ "$para" == "vote" ];then elif [ "$para" == "vote" ]; then
vote "$2" "$3" "$4" vote "$2" "$3" "$4"
elif [ "$para" == "cancelVote" ];then elif [ "$para" == "cancelVote" ]; then
cancelVote "$2" "$3" "$4" cancelVote "$2" "$3" "$4"
elif [ "$para" == "regM" ];then elif [ "$para" == "regM" ]; then
regM "$2" "$3" "$4" "$5" regM "$2" "$3" "$4" "$5"
elif [ "$para" == "regMn" ];then elif [ "$para" == "regMn" ]; then
regMn "$2" "$3" regMn "$2" "$3"
elif [ "$para" == "regRP" ];then elif [ "$para" == "regRP" ]; then
regRP "$2" "$3" "$4" "$5" "$6" regRP "$2" "$3" "$4" "$5" "$6"
elif [ "$para" == "regRPn" ];then elif [ "$para" == "regRPn" ]; then
regRPn "$2" "$3" "$4" regRPn "$2" "$3" "$4"
elif [ "$para" == "qtx" ];then elif [ "$para" == "qtx" ]; then
qtx "$2" qtx "$2"
elif [ "$para" == "sendDpos" ];then elif [ "$para" == "sendDpos" ]; then
send_exec "$2" "$3" send_exec "$2" "$3"
elif [ "$para" == "qn" ];then elif [ "$para" == "qn" ]; then
qn "$2" qn "$2"
elif [ "$para" == "qv" ];then elif [ "$para" == "qv" ]; then
qv "$2" "$3" qv "$2" "$3"
elif [ "$para" == "qk" ];then elif [ "$para" == "qk" ]; then
qk "$2" qk "$2"
elif [ "$para" == "qvrf" ];then elif [ "$para" == "qvrf" ]; then
qvrf "$2" "$3" qvrf "$2" "$3"
elif [ "$para" == "qvrfn" ];then elif [ "$para" == "qvrfn" ]; then
qvrfn "$2" qvrfn "$2"
elif [ "$para" == "qvrfk" ];then elif [ "$para" == "qvrfk" ]; then
qvrfk "$2" "$3" qvrfk "$2" "$3"
elif [ "$para" == "unlock" ];then elif [ "$para" == "unlock" ]; then
unlock unlock
elif [ "$para" == "qtopn" ];then elif [ "$para" == "qtopn" ]; then
qtopn "$2" qtopn "$2"
elif [ "$para" == "recordCB" ];then elif [ "$para" == "recordCB" ]; then
recordCB "$2" "$3" "$4" "$5" "$6" recordCB "$2" "$3" "$4" "$5" "$6"
elif [ "$para" == "qCB" ];then elif [ "$para" == "qCB" ]; then
qcb "$2" "$3" qcb "$2" "$3"
elif [ "$para" == "trans" ];then elif [ "$para" == "trans" ]; then
trans "$2" "$3" "$4" trans "$2" "$3" "$4"
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment