generated from cosmosregistry/chain-minimal
-
Notifications
You must be signed in to change notification settings - Fork 53
/
README.md
134 lines (86 loc) · 2.92 KB
/
README.md
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
<!-- markdownlint-disable MD033 -->
<h1 align="center">Dymension Rollapp</h1>
<!-- markdownlint-enable MD033 -->
# Rollappd - A template RollApp chain
This repository hosts `rollappd`, a template implementation of a dymension rollapp.
`rollappd` is an example of a working RollApp using `dymension-RDK` and `dymint`.
It uses Cosmos-SDK's [simapp](https://github.com/cosmos/cosmos-sdk/tree/main/simapp) as a reference, but with the following changes:
- minimal app setup
- wired IBC for [ICS 20 Fungible Token Transfers](https://github.com/cosmos/ibc/tree/main/spec/app/ics-020-fungible-token-transfer)
- Uses `dymint` for block sequencing and replacing `tendermint`
- Uses modules from `dymension-RDK` to sync with `dymint` and provide RollApp custom logic
## Overview
**Note**: Requires [Go 1.19](https://go.dev/)
## Quick guide
Get started with [building RollApps](https://docs.dymension.xyz/develop/get-started/setup)
## Installing / Getting started
Build and install the ```rollappd``` binary:
```shell
make install
```
### Initial configuration
export the following variables:
```shell
export ROLLAPP_CHAIN_ID="demo-dymension-rollapp"
export KEY_NAME_ROLLAPP="rol-user"
export DENOM="urax"
export MONIKER="$ROLLAPP_CHAIN_ID-sequencer"
```
And initialize the rollapp:
```shell
sh scripts/init.sh
```
### Run rollapp
```shell
rollappd start
```
You should have a running local rollapp!
## Run a rollapp with local settlement node
### Run local dymension hub node
Follow the instructions on [Dymension Hub docs](https://docs.dymension.xyz/develop/get-started/run-base-layers) to run local dymension hub node
### Create sequencer keys
create sequencer key using `dymd`
```shell
dymd keys add sequencer --keyring-dir ~/.rollapp/sequencer_keys --keyring-backend test
SEQUENCER_ADDR=`dymd keys show sequencer --address --keyring-backend test --keyring-dir ~/.rollapp/sequencer_keys`
```
fund the sequencer account
```shell
dymd tx bank send local-user $SEQUENCER_ADDR 10000000000000000000000udym --keyring-backend test --broadcast-mode block
```
### Register rollapp on settlement
```shell
sh scripts/settlement/register_rollapp_to_hub.sh
```
### Register sequencer for rollapp on settlement
```shell
sh scripts/settlement/register_sequencer_to_hub.sh
```
### Configure the rollapp
Modify `dymint.toml` in the chain directory (`~/.rollapp/config`)
set:
```shell
settlement_layer = "dymension"
```
### Run rollapp locally
```shell
rollappd start
```
## Setup IBC between rollapp and local dymension hub node
### Install dymension relayer
```shell
git clone https://github.com/dymensionxyz/go-relayer.git --branch v0.2.0-v2.3.1-relayer
cd relayer && make install
```
### Establish IBC channel
while the rollapp and the local dymension hub node running, run:
```shell
sh scripts/ibc/setup_ibc.sh
```
After successful run, the new established channels will be shown
### run the relayer
```shell
rly start hub-rollapp
```
## Developers guide
TODO