@@ -27,7 +27,7 @@ cd wasmd
27
27
#### Add token factory to app.go:
28
28
29
29
``` bash
30
- curl -sSL https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/add-tokenfactory.diff | git apply
30
+ curl -sSL https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/add-tokenfactory.diff | git apply
31
31
```
32
32
33
33
#### Update packages to use rollkit and accommodate x/tokenfactory:
@@ -62,6 +62,9 @@ wasmd config set client node tcp://127.0.0.1:36657
62
62
wasmd config set client output json
63
63
wasmd config set client keyring-backend test
64
64
65
+ git clone --branch v24.0.0 --depth 1 https://github.com/Stride-Labs/stride
66
+ cd stride
67
+ make install
65
68
strided config chain-id stride-internal-1
66
69
strided config node https://stride-testnet-rpc.polkachu.com:443
67
70
strided config keyring-backend test
@@ -78,7 +81,7 @@ echo "join always addict position jungle jeans bus govern crack huge photo purse
78
81
```
79
82
80
83
::: tip
81
- In this guide, we're using a predefined seep phrase for simplicity. Alternatively you can generate and use your own:
84
+ In this guide, we're using a predefined seed phrase for simplicity. Alternatively you can generate and use your own:
82
85
83
86
``` bash
84
87
wasmd keys add my-key
@@ -105,7 +108,7 @@ wasmd keys export --unsafe --unarmored-hex my-key
105
108
Create a Dockerfile in the ` wasmd ` repo that will be used to run the rollup.
106
109
107
110
``` bash
108
- wget -O Dockerfile https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/wasmd.Dockerfile
111
+ wget -O Dockerfile https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/wasmd.Dockerfile
109
112
```
110
113
111
114
Fork the cw-hyperlane repo
@@ -119,10 +122,10 @@ cd cw-hyperlane
119
122
git checkout 4f5656d4704178ac54d10467ca7edc3df2312c4b
120
123
```
121
124
122
- Create the docker compose file that will be used for the data availability service, the localwasm chain, and the hyperlane validators and relayers.
125
+ Create the docker compose file that will be used for the data availability service, the localwasm chain, and the Hyperlane validators and relayers.
123
126
124
127
``` bash
125
- wget -O example/docker-compose.yml https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/docker-compose.yml
128
+ wget -O example/docker-compose.yml https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/docker-compose.yml
126
129
```
127
130
128
131
To start the data availability service, run:
@@ -151,7 +154,7 @@ If you're using a new account, you can fund it from the faucet at [Stride testne
151
154
152
155
#### Rollup Account
153
156
154
- We can fund the rollup account through one of the genesis account's in the docker container
157
+ We can fund the rollup account through one of the genesis accounts in the docker container
155
158
156
159
``` bash
157
160
docker exec -it localwasm \
@@ -183,7 +186,7 @@ The transaction was successful if the `code` field is 0 (success).
183
186
<!-- TODO: Update the fee to be denominated in the tokenfactory TIA -->
184
187
185
188
``` bash
186
- wget -O config.yaml https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/hyperlane-config.yaml
189
+ wget -O config.yaml https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/hyperlane-config.yaml
187
190
```
188
191
189
192
::: tip
@@ -199,12 +202,12 @@ However, you can pick any number as your domain ID.
199
202
::: tip
200
203
The fee for each transfer is calculated by:
201
204
202
- = ` protocol_fee ` + (` default_gas_usage ` _ ` gas_price ` _ ` exchange_rate ` / ` 10000000000 ` )
205
+ = ` protocol_fee + (default_gas_usage * gas_price * exchange_rate / 10000000000) `
203
206
204
207
So in our config, it will be: ` 1 + [(1000 * 10000 * 100000) / 10000000000] = 101uwasm `
205
208
:::
206
209
207
- #### Inside the cw-hyperlane directory, install the hyperlane cw-cli:
210
+ #### Inside the cw-hyperlane directory, install the Hyperlane cw-cli:
208
211
209
212
``` bash
210
213
yarn install
@@ -229,7 +232,7 @@ yarn cw-hpl deploy -n localwasm
229
232
<!-- TODO: Change the config.yaml layout to support multiple networks -->
230
233
231
234
``` bash
232
- wget -O config.yaml https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/hyperlane-config-2.yaml
235
+ wget -O config.yaml https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/hyperlane-config-2.yaml
233
236
```
234
237
235
238
#### Deploy the contracts on the Stride testnet:
@@ -240,7 +243,7 @@ wget -O config.yaml https://raw.githubusercontent.com/rollkit/docs/blob/HEAD/gui
240
243
# Stride has permissioned CosmWasm, meaning only certain addresses can upload contracts.
241
244
# The Hyperlane contracts have already been uploaded, so all that's left is to instantiate them.
242
245
# This command will initialize the config for stride-testnet-1 with the code IDs of the Hyperlane contracts.
243
- wget -O context/stride-internal-1.json https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/stride-internal-1.json
246
+ wget -O context/stride-internal-1.json https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/stride-internal-1.json
244
247
245
248
# This command will output two results.
246
249
# - context + deployment (default path: {cw-hyperlane-root}/context/stride-internal-1.json)
@@ -253,19 +256,19 @@ yarn cw-hpl deploy -n stride-internal-1
253
256
#### Setup the relayer config:
254
257
255
258
``` bash
256
- wget -O example/hyperlane/relayer.json https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/relayer.json
259
+ wget -O example/hyperlane/relayer.json https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/relayer.json
257
260
```
258
261
259
262
#### Setup the validator config on the Stride side:
260
263
261
264
``` bash
262
- wget -O example/hyperlane/validator.strideinternal1.json https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/validator.strideinternal1.json
265
+ wget -O example/hyperlane/validator.strideinternal1.json https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/validator.strideinternal1.json
263
266
```
264
267
265
268
#### Setup the validator config on the localwasm rollup side:
266
269
267
270
``` bash
268
- wget -O example/hyperlane/validator.localwasm.json https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/validator.localwasm.json
271
+ wget -O example/hyperlane/validator.localwasm.json https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/validator.localwasm.json
269
272
```
270
273
271
274
#### Prepare the validators and relayer config:
@@ -294,7 +297,7 @@ docker compose -f example/docker-compose.yml up -d validator-localwasm validator
294
297
#### Deploy a warp contract with TIA as collateral on Stride
295
298
296
299
``` bash
297
- wget -O example/warp/utia-stride.json https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/utia-stride.json
300
+ wget -O example/warp/utia-stride.json https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/utia-stride.json
298
301
299
302
yarn cw-hpl warp create ./example/warp/utia-stride.json -n stride-internal-1
300
303
```
@@ -311,7 +314,7 @@ The output should look like:
311
314
<!-- TODO: Add metadata -->
312
315
313
316
``` bash
314
- wget -O example/warp/utia-localwasm.json https://raw.githubusercontent.com/rollkit/ docs/blob/HEAD /guides/assets/hyperlane-use-tia-for-gas/utia-localwasm.json
317
+ wget -O example/warp/utia-localwasm.json https://raw.githubusercontent.com/Stride-Labs/Rollkit- docs/hyperlane-v2 /guides/assets/hyperlane-use-tia-for-gas/utia-localwasm.json
315
318
316
319
yarn cw-hpl warp create ./example/warp/utia-localwasm.json -n localwasm
317
320
```
@@ -350,19 +353,18 @@ yarn cw-hpl warp link \
350
353
-n localwasm
351
354
```
352
355
353
- ## Transfer TIA
356
+ ## Transfer Tokens
354
357
355
- ### Test transferring from Stride to Localwasm
358
+ ### Transfer STRD from Stride to localwasm
356
359
357
360
Initiate transfer
358
361
359
362
``` bash
360
- # Template
361
363
warp_contract_address=$( jq -r ' .deployments.warp.native[0].address' context/stride-internal-1.json)
362
364
recipient=$( yarn cw-hpl wallet convert-cosmos-to-eth -n localwasm $( wasmd keys show my-key -a) | perl -pe ' s/0x0x//g' )
363
365
strided tx wasm execute $warp_contract_address \
364
- ' {"transfer_remote":{"dest_domain":963,"recipient":"' " $recipient " ' ","amount":"10000 "}}' \
365
- --amount 10101ibc/1A7653323C1A9E267FF7BEBF40B3EEA8065E8F069F47F2493ABC3E0B621BF793 \
366
+ ' {"transfer_remote":{"dest_domain":963,"recipient":"' " $recipient " ' ","amount":"1 "}}' \
367
+ --amount 1ustrd \
366
368
--from my-key -y \
367
369
--gas 2000000 --fees 1000ustrd
368
370
```
@@ -373,17 +375,14 @@ Observe logs in the validator and relayer to witness the transfer. Confirm the t
373
375
wasmd q bank balances $( wasmd keys show my-key -a)
374
376
```
375
377
376
- ### Transfer from Localwasm back to Stride
377
-
378
- <!-- TODO: Update fee to be only the tokenfactory tia -->
378
+ ### Transfer STRD from localwasm back to Stride
379
379
380
380
``` bash
381
- # Template
382
381
warp_contract_address=$( jq -r ' .deployments.warp.native[0].address' context/localwasm.json)
383
382
recipient=$( yarn cw-hpl wallet convert-cosmos-to-eth -n stride-internal-1 $( strided keys show my-key -a) | perl -pe ' s/0x0x//g' )
384
383
wasmd tx wasm execute $warp_contract_address \
385
- ' {"transfer_remote":{"dest_domain":1651,"recipient":"' " $recipient " ' ","amount":"10000 "}}' \
386
- --amount 10000factory /${warp_contract_address} /utia ,101uwasm \
384
+ ' {"transfer_remote":{"dest_domain":1651,"recipient":"' " $recipient " ' ","amount":"1 "}}' \
385
+ --amount 1factory /${warp_contract_address} /ustrd ,101uwasm \
387
386
--from my-key -y \
388
387
--gas 2000000 --fees 50000uwasm
389
388
```
@@ -414,30 +413,63 @@ celestia-appd config node https://celestia-testnet-rpc.polkachu.com:443
414
413
celestia-appd config keyring-backend test
415
414
416
415
echo " join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy" | \
417
- celestia-appd keys add my-key --recover
416
+ celestia-appd keys add my-key --recover # celestia133xh839fjn9wxzg6vhc0370lcem8939zc3uexj
418
417
```
419
418
420
- Fund the relayer with the [ Celestia Mocha Testnet Faucet] ( https://docs.celestia.org/nodes/mocha-testnet#mocha-testnet-faucet ) .
419
+ Fund you account with the [ Celestia Mocha Testnet Faucet] ( https://docs.celestia.org/nodes/mocha-testnet#mocha-testnet-faucet ) .
421
420
422
- Transfer from celestia through Stride, to the rollup:
421
+ Transfer TIA from Celestia through Stride to the localwasm rollup:
423
422
424
423
``` bash
425
424
warp_contract_address=$( jq -r ' .deployments.warp.native[0].address' context/stride-internal-1.json)
426
425
recipient=$( yarn cw-hpl wallet convert-cosmos-to-eth -n localwasm $( wasmd keys show my-key -a) | perl -pe ' s/0x0x//g' )
427
426
428
427
forward_msg=' {"transfer_remote":{"dest_domain":963,"recipient":"' " $recipient " ' ","amount":"10000"}}'
429
- funds=' [{"amount":10101 ,"denom":"ibc/1A7653323C1A9E267FF7BEBF40B3EEA8065E8F069F47F2493ABC3E0B621BF793"}]'
428
+ funds=' [{"amount":1 ,"denom":"ibc/1A7653323C1A9E267FF7BEBF40B3EEA8065E8F069F47F2493ABC3E0B621BF793"}]'
430
429
memo=' {"wasm":{"contract":"' " $warp_contract_address " ' ","msg":' " $forward_msg " ' ,"funds":' " $funds " ' }}'
431
430
432
- celestia-appd tx ibc-transfer transfer transfer channel-78 $warp_contract_address 10101utia \
431
+ celestia-appd tx ibc-transfer transfer transfer channel-78 $warp_contract_address 1utia \
433
432
--from my-key -y --fees 420utia --memo " $memo "
434
433
```
435
434
436
435
::: tip
437
436
Stride has IBC middleware installed that automatically forwards and routes transfers directly to the rollup, therefore we only need to sign one transaction on Celestia!
437
+
438
+ See the ` memo ` field in the above command to see how we can encode a message for the Wasm contract and send it along with the funds.
438
439
:::
439
440
440
- <!-- TODO: Add transfer from celestia through ibc hook -->
441
+ Confirm the tokens landed in the wasm account with:
442
+
443
+ ``` bash
444
+ wasmd q bank balances $( wasmd keys show my-key -a)
445
+ ```
446
+
447
+ ### Update localwasm to use Hyperlane bridged TIA as a gas token
448
+
449
+ Update the ` restart-wasmd.sh ` script to include the new minimum gas prices:
450
+
451
+ ``` bash
452
+ warp_contract_address=" $( jq -r ' .deployments.warp.native[0].address' context/localwasm.json) "
453
+ localwasm_container_id=" $( docker compose -f example/docker-compose.yml ps | awk ' $1~/^localwasm$/{print $1}' ) "
454
+
455
+ docker exec " $localwasm_container_id " perl -i -pe " s;--minimum-gas-prices=0.025uwasm;--minimum-gas-prices=0.025uwasm,0.025factory/$warp_contract_address /utia;" restart-wasmd.sh
456
+ ```
457
+
458
+ Restart the wasmd container:
459
+
460
+ ``` bash
461
+ docker compose -f example/docker-compose.yml restart localwasm
462
+ ```
463
+
464
+ ### Send a transaction on the localwasm using TIA to pay for gas
465
+
466
+ ``` bash
467
+ wasmd tx bank send my-key wasm133xh839fjn9wxzg6vhc0370lcem8939zr8uu45 1uwasm -y --gas auto --gas-adjustment 1.5 --gas-prices " 0.025factory/$warp_contract_address /utia"
468
+ ```
469
+
470
+ ## 🎉
471
+
472
+ Congratulations! You've built a local rollup that uses Hyperlane bridged TIA as the gas token!
441
473
442
474
## Resources
443
475
0 commit comments