@@ -85,8 +85,6 @@ rpcks() {
85
85
fi
86
86
echo $GOLOOP_RPC_KEY_STORE
87
87
}
88
-
89
- export GOLOOP_CHAINSCORE=cx0000000000000000000000000000000000000000
90
88
````
91
89
92
90
### BMC
@@ -114,7 +112,8 @@ rpcch dst
114
112
echo " $GOLOOP_RPC_NID .icon" > net.btp.$( rpcch)
115
113
goloop rpc sendtx deploy pyscore/bmc.zip \
116
114
--param _net=$( cat net.btp.$( rpcch) ) | jq -r . > tx.bmc.$( rpcch)
117
- goloop rpc txresult $( cat tx.bmc.dst) | jq -r .scoreAddress > bmc.$( rpcch)
115
+ sleep 2
116
+ goloop rpc txresult $( cat tx.bmc.$( rpcch) ) | jq -r .scoreAddress > bmc.$( rpcch)
118
117
echo " btp://$( cat net.btp.$( rpcch) ) /$( cat bmc.$( rpcch) ) " > btp.$( rpcch)
119
118
````
120
119
@@ -123,10 +122,10 @@ To create parameters for deploy BMV contract
123
122
```` shell
124
123
rpcch dst
125
124
goloop rpc call --to $GOLOOP_CHAINSCORE --method getValidators| jq -r ' map(.)|join(",")' > validators.$( rpcch)
126
- goloop chain inspect $( rpcch) --format {{.Height}} > offset.$( rpcch)
125
+ echo " 0x $( printf %x $( goloop chain inspect $( rpcch) --format {{.Height}}) ) " > offset.$( rpcch)
127
126
````
128
127
129
- Deploy BMV contract to 'src' chain and check deploy result
128
+ Deploy BMV contract to 'src' chain
130
129
```` shell
131
130
rpcch src
132
131
goloop rpc sendtx deploy pyscore/bmv.zip \
@@ -135,21 +134,26 @@ goloop rpc sendtx deploy pyscore/bmv.zip \
135
134
--param _validators=$( cat validators.dst) \
136
135
--param _offset=$( cat offset.dst) \
137
136
| jq -r . > tx.bmv.$( rpcch)
137
+ ````
138
+
139
+ Extract BMV contract address from deploy result
140
+ ```` shell
138
141
goloop rpc txresult $( cat tx.bmv.$( rpcch) ) | jq -r .scoreAddress > bmv.$( rpcch)
139
142
````
140
143
141
144
For 'dst' chain, same flows with replace 'src' to 'dst' and 'dst' to 'src'.
142
145
```` shell
143
146
rpcch src
144
147
goloop rpc call --to $GOLOOP_CHAINSCORE --method getValidators| jq -r ' map(.)|join(",")' > validators.$( rpcch)
145
- goloop chain inspect $( rpcch) --format {{.Height}} > offset.$( rpcch)
148
+ echo " 0x $( printf %x $( goloop chain inspect $( rpcch) --format {{.Height}}) ) " > offset.$( rpcch)
146
149
rpcch dst
147
150
goloop rpc sendtx deploy pyscore/bmv.zip \
148
151
--param _bmc=$( cat bmc.$( rpcch) ) \
149
152
--param _net=$( cat net.btp.src) \
150
153
--param _validators=$( cat validators.src) \
151
154
--param _offset=$( cat offset.src) \
152
155
| jq -r . > tx.bmv.$( rpcch)
156
+ sleep 2
153
157
goloop rpc txresult $( cat tx.bmv.$( rpcch) ) | jq -r .scoreAddress > bmv.$( rpcch)
154
158
````
155
159
@@ -259,6 +263,24 @@ goloop rpc sendtx call --to $(cat bmc.$(rpcch)) \
259
263
> ` goloop rpc call --to $(cat bmc.src) --method getStatus --param _link=$(cat btp.dst) `
260
264
> ` goloop rpc call --to $(cat bmc.dst) --method getStatus --param _link=$(cat btp.src) `
261
265
266
+ ### Register Token
267
+ Register IRC 2.0 Token contract to Token-BSH
268
+ ```` shell
269
+ rpcch src
270
+ goloop rpc sendtx call --to $( cat token_bsh.src) \
271
+ --method register \
272
+ --param _name=IRC2Token \
273
+ --param _addr=$( cat irc2_token.src)
274
+ rpcch dst
275
+ goloop rpc sendtx call --to $( cat token_bsh.dst) \
276
+ --method register \
277
+ --param _name=IRC2Token \
278
+ --param _addr=$( cat irc2_token.dst)
279
+ ````
280
+
281
+ > To retrieve list of registered token, use ` tokenNames ` method of Token-BSH.
282
+ > ` goloop rpc call --to $(cat token_bsh.$(rpcch)) --method tokenNames `
283
+
262
284
### Register Relayer and Relay
263
285
Create key store for relay of 'src' chain
264
286
```` shell
@@ -303,24 +325,6 @@ goloop rpc sendtx call --to $(cat bmc.$(rpcch)) \
303
325
> ` goloop rpc call --to $(cat bmc.src) --method getRelays --param _link=$(cat btp.dst) `
304
326
> ` goloop rpc call --to $(cat bmc.dst) --method getRelays --param _link=$(cat btp.src) `
305
327
306
- ### Register Token
307
- Register IRC 2.0 Token contract to Token-BSH
308
- ```` shell
309
- rpcch src
310
- goloop rpc sendtx call --to $( cat token_bsh.src) \
311
- --method register \
312
- --param _name=IRC2Token \
313
- --param _addr=$( cat irc2_token.src)
314
- rpcch dst
315
- goloop rpc sendtx call --to $( cat token_bsh.dst) \
316
- --method register \
317
- --param _name=IRC2Token \
318
- --param _addr=$( cat irc2_token.dst)
319
- ````
320
-
321
- > To retrieve list of registered token, use ` tokenNames ` method of Token-BSH.
322
- > ` goloop rpc call --to $(cat token_bsh.$(rpcch)) --method tokenNames `
323
-
324
328
## Start relay
325
329
326
330
Prepare 'btpsimple' docker image via ` make btpsimple-image `
@@ -351,7 +355,7 @@ docker run -d --name btpsimple_dst --link goloop \
351
355
-e BTPSIMPLE_DST_ENDPOINT=http://goloop:9080/api/v3/src \
352
356
-e BTPSIMPLE_OFFSET=$( cat ${CONFIG_DIR} /offset.dst) \
353
357
-e BTPSIMPLE_KEY_STORE=/btpsimple/config/dst.ks.json \
354
- -e BTPSIMPLE_KEY_SECRET=/btpsimple/config/dst.secret) \
358
+ -e BTPSIMPLE_KEY_SECRET=/btpsimple/config/dst.secret \
355
359
btpsimple
356
360
````
357
361
0 commit comments