-
Notifications
You must be signed in to change notification settings - Fork 1
/
testnet.template
161 lines (133 loc) · 6.82 KB
/
testnet.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/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
wddir=yosemite-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 "http-server-address = $wdaddr" > $wddir/config.ini
programs/keyos/keyos --config-dir $wddir --data-dir $wddir 2> $wddir/wdlog.txt &
echo $$ > ignition_wallet.pid
echo keyos log in $wddir/wdlog.txt >> $logfile
sleep 1
ecmd () {
echo ===== Start: $step ============ >> $logfile
echo executing: clyos --wallet-url $wdurl --url http://$bioshost:$biosport "$@" | tee -a $logfile
echo ----------------------- >> $logfile
programs/clyos/clyos --wallet-url $wdurl --url http://$bioshost:$biosport "$@" >> $logfile 2>&1
echo ==== End: $step ============== >> $logfile
step=$(($step + 1))
}
wcmd () {
ecmd wallet $*
}
cacmd () {
programs/clyos/clyos --wallet-url $wdurl --url http://$bioshost:$biosport system newaccount yosemite "$@" >> $logfile 2>&1
ecmd system regproducer $1 $2
ecmd push action yosemite authproducer "[\"$1\"]" -p yosemite
ecmd push action yx.ntoken nissue "{\"to\":\"$1\", \"token\":{\"amount\":\"1000000.00 DKRW\",\"issuer\":\"sysdepo1\"}, \"memo\":\"my memo\"}" -p sysdepo1
}
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 yosemite contracts/eosio.bios eosio.bios.wasm eosio.bios.abi
# 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 yx.* keys: $prisyskey $pubsyskey >> $logfile
wcmd import -n ignition --private-key $prisyskey
ecmd create account yosemite yx.identity $pubsyskey $pubsyskey
ecmd create account yosemite yx.msig $pubsyskey $pubsyskey
ecmd create account yosemite yx.ntoken $pubsyskey $pubsyskey
ecmd create account yosemite yx.token $pubsyskey $pubsyskey
ecmd create account yosemite yx.dcontract $pubsyskey $pubsyskey
ecmd create account yosemite yx.txfee $pubsyskey $pubsyskey
ecmd create account yosemite yx.sudo $pubsyskey $pubsyskey
ecmd create account yosemite sysdepo1 $pubsyskey $pubsyskey
ecmd create account yosemite sysdepo2 $pubsyskey $pubsyskey
ecmd create account yosemite idauth1 $pubsyskey $pubsyskey
ecmd create account yosemite idauth2 $pubsyskey $pubsyskey
ecmd set contract yx.txfee contracts/yx.txfee yx.txfee.wasm yx.txfee.abi
ecmd set contract yx.identity contracts/yx.identity yx.identity.wasm yx.identity.abi
ecmd set contract yx.ntoken contracts/yx.ntoken yx.ntoken.wasm yx.ntoken.abi
ecmd set contract yx.token contracts/yx.token yx.token.wasm yx.token.abi
ecmd set contract yx.dcontract contracts/yx.dcontract yx.dcontract.wasm yx.dcontract.abi
ecmd set contract yx.msig contracts/eosio.msig eosio.msig.wasm eosio.msig.abi
ecmd set contract yx.sudo contracts/eosio.sudo eosio.sudo.wasm eosio.sudo.abi
ecmd push action yosemite setpriv '["yx.ntoken",1]' -p yosemite
ecmd push action yx.ntoken setkycrule '{"type":0,"kyc":0}' -p yosemite
ecmd push action yx.ntoken setkycrule '{"type":1,"kyc":0}' -p yosemite
ecmd push action yosemite setpriv '["yx.token",1]' -p yosemite
ecmd push action yosemite setpriv '["yx.dcontract",1]' -p yosemite
ecmd set contract yosemite contracts/yx.system yx.system.wasm yx.system.abi
ecmd push action yosemite regidauth '["idauth1","http://idauth1.org",1]' -p idauth1 -p yosemite
ecmd push action yosemite authidauth '["idauth1"]' -p yosemite
ecmd push action yosemite regidauth '["idauth2","http://idauth2.org",1]' -p idauth2 -p yosemite
ecmd push action yosemite authidauth '["idauth2"]' -p yosemite
ecmd push action yosemite regsysdepo '["sysdepo1","http://sysdepo1.org",1]' -p sysdepo1 -p yosemite
ecmd push action yosemite authsysdepo '["sysdepo1"]' -p yosemite
ecmd push action yosemite regsysdepo '["sysdepo2","http://sysdepo2.org",1]' -p sysdepo2 -p yosemite
ecmd push action yosemite authsysdepo '["sysdepo2"]' -p yosemite
# yx.system (turn off tx fee for test convenience)
ecmd push action yx.txfee settxfee '["tf.newacc","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.regprod","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.regsysdep","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.regidauth","0.00 DKRW"]' -p yosemite
# yx.ntoken
ecmd push action yx.txfee settxfee '["tf.nissue","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.nredeem","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.transfer","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.ntransfer","0.00 DKRW"]' -p yosemite
# yx.token
ecmd push action yx.txfee settxfee '["tf.tcreate","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.tissue","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.tredeem","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.ttransfer","0.00 DKRW"]' -p yosemite
# yx.dcontract
ecmd push action yx.txfee settxfee '["tf.dccreate","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.dcaddsign","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.dcsign","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.dcupadd","0.00 DKRW"]' -p yosemite
ecmd push action yx.txfee settxfee '["tf.dcremove","0.00 DKRW"]' -p yosemite
ecmd push action yx.ntoken nissue '{"to":"yosemite", "token":{"amount":"1000000000.00 DKRW","issuer":"sysdepo1"}, "memo":"my memo"}' -p sysdepo1
# 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 keyos