1
1
# Bridge Deployments
2
2
3
3
## Requirements
4
+
4
5
Make sure to install ` docker ` and ` docker-compose ` to be able to run and test bridge deployments. If
5
6
for whatever reason you can't or don't want to use Docker, you can find some scripts for running the
6
- bridge [ here] ( https://github.com/svyatonik/parity-bridges-common.test ) .
7
+ bridge [ here] ( ./local-scripts/ ) .
7
8
8
9
## Networks
10
+
9
11
One of the building blocks we use for our deployments are _ networks_ . A network is a collection of
10
12
homogenous blockchain nodes. We have Docker Compose files for each network that we want to bridge.
11
13
Each of the compose files found in the ` ./networks ` folder is able to independently spin up a
@@ -18,6 +20,7 @@ docker-compose -f ./networks/rialto.yml up
18
20
After running this command we would have a network of several nodes producing blocks.
19
21
20
22
## Bridges
23
+
21
24
A _ bridge_ is a way for several _ networks_ to connect to one another. Bridge deployments have their
22
25
own Docker Compose files which can be found in the ` ./bridges ` folder. These Compose files typically
23
26
contain bridge relayers, which are services external to blockchain nodes, and other components such
@@ -43,10 +46,11 @@ and Grafana. We cover these in more details in the [Monitoring](#monitoring) sec
43
46
the monitoring Compose file is _ not_ optional, and must be included for bridge deployments.
44
47
45
48
### Running and Updating Deployments
49
+
46
50
We currently support three bridge deployments
47
51
1 . Rialto Substrate to Millau Substrate
48
52
2 . Rialto Parachain Substrate to Millau Substrate
49
- 2 . Westend Substrate to Millau Substrate
53
+ 2 . Westend Substrate to Millau Substrate (only finality bridge)
50
54
51
55
These bridges can be deployed using our [ ` ./run.sh ` ] ( ./run.sh ) script.
52
56
@@ -71,11 +75,12 @@ You can also bring down a deployment using the script with the `stop` argument.
71
75
```
72
76
73
77
### Adding Deployments
78
+
74
79
We need two main things when adding a new deployment. First, the new network which we want to
75
80
bridge. A compose file for the network should be added in the ` /networks/ ` folder. Secondly we'll
76
81
need a new bridge Compose file in ` ./bridges/ ` . This should configure the bridge relayer nodes
77
82
correctly for the two networks, and add any additional components needed for the deployment. If you
78
- want you can also add support in the ` ./run ` script for the new deployment. While recommended it's
83
+ want you can also add support in the ` ./run.sh ` script for the new deployment. While recommended it's
79
84
not strictly required.
80
85
81
86
## General Notes
@@ -111,8 +116,8 @@ is not recommended, because this may lead to nonces conflict.
111
116
112
117
Following accounts are used when ` rialto-millau ` bridge is running:
113
118
114
- - Millau's ` Rialto.HeadersAndMessagesRelay ` signs complex headers+messages relay transactions on Millau chain;
115
- - Rialto's ` Millau.HeadersAndMessagesRelay ` signs complex headers+messages relay transactions on Rialto chain;
119
+ - Millau's ` Rialto.HeadersAndMessagesRelay1 ` signs complex headers+messages relay transactions on Millau chain;
120
+ - Rialto's ` Millau.HeadersAndMessagesRelay1 ` signs complex headers+messages relay transactions on Rialto chain;
116
121
- Millau's ` Rialto.MessagesSender ` signs Millau transactions which contain messages for Rialto;
117
122
- Rialto's ` Millau.MessagesSender ` signs Rialto transactions which contain messages for Millau;
118
123
- Millau's ` Rialto.OutboundMessagesRelay.Lane00000001 ` signs relay transactions with message delivery confirmations (lane 00000001) from Rialto to Millau;
@@ -136,18 +141,22 @@ Following accounts are used when `rialto-parachain-millau` bridge is running:
136
141
- RialtoParachain's ` Millau.HeadersAndMessagesRelay ` signs complex headers+messages relay transactions on RialtoParachain chain.
137
142
138
143
### Docker Usage
144
+
139
145
When the network is running you can query logs from individual nodes using:
140
146
141
147
``` bash
142
148
docker logs rialto_millau-node-charlie_1 -f
143
149
```
144
150
151
+ You may use the [ dump-logs.sh] ( ../scripts/dump-logs.sh ) to dump logs of most of running containers.
152
+
145
153
To kill all leftover containers and start the network from scratch next time:
146
154
``` bash
147
155
docker ps -a --format " {{.ID}}" | xargs docker rm # This removes all containers!
148
156
```
149
157
150
158
### Docker Compose Usage
159
+
151
160
If you're not familiar with how to use ` docker-compose ` here are some useful commands you'll need
152
161
when interacting with the bridge deployments:
153
162
@@ -172,10 +181,12 @@ docker-compose -f docker-compose.yml -f docker-compose.override.yml config > doc
172
181
```
173
182
174
183
## Docker and Git Deployment
184
+
175
185
It is also possible to avoid using images from the Docker Hub and instead build
176
186
containers from Git. There are two ways to build the images this way.
177
187
178
188
### Git Repo
189
+
179
190
If you have cloned the bridges repo you can build local Docker images by running the following
180
191
command at the top level of the repo:
181
192
@@ -189,16 +200,17 @@ This will build a local image of a particular component with a tag of
189
200
You can configure the build using Docker
190
201
[build arguments](https://docs.docker.com/engine/reference/commandline/build/# set-build-time-variables---build-arg).
191
202
Here are the arguments currently supported:
192
- - ` BRIDGE_REPO` : Git repository of the bridge node and relay code
193
- - ` BRIDGE_HASH` : Commit hash within that repo (can also be a branch or tag)
194
- - ` ETHEREUM_REPO` : Git repository of the OpenEthereum client
195
- - ` ETHEREUM_HASH` : Commit hash within that repo (can also be a branch or tag)
196
203
- ` PROJECT` : Project to build withing bridges repo. Can be one of:
197
204
- ` rialto-bridge-node`
198
205
- ` millau-bridge-node`
206
+ - ` rialto-parachain-collator`
199
207
- ` substrate-relay`
200
208
209
+ You may use the [build-containers.sh](../scripts/build-containers.sh) script to build all available
210
+ containers.
211
+
201
212
# ## GitHub Actions
213
+
202
214
We have a nightly job which runs and publishes Docker images for the different nodes and relayers to
203
215
the [ParityTech Docker Hub](https://hub.docker.com/u/paritytech) organization. These images are used
204
216
for our ephemeral (temporary) test networks. Additionally, any time a tag in the form of ` v* ` is
@@ -209,6 +221,7 @@ With images built using either method, all you have to do to use them in a deplo
209
221
` image` field in the existing Docker Compose files to point to the tag of the image you want to use.
210
222
211
223
# ## Monitoring
224
+
212
225
[Prometheus](https://prometheus.io/) is used by the bridge relay to monitor information such as system
213
226
resource use, and block data (e.g the best blocks it knows about). In order to visualize this data
214
227
a [Grafana](https://grafana.com/) dashboard can be used.
@@ -223,6 +236,7 @@ dashboard can be accessed at `http://localhost:9090`. The Grafana dashboard can
223
236
` http://localhost:3000` . Note that the default log-in credentials for Grafana are ` admin:admin` .
224
237
225
238
# ## Environment Variables
239
+
226
240
Here is an example ` .env` file which is used for production deployments and network updates. For
227
241
security reasons it is not kept as part of version control. When deploying a network this
228
242
file should be correctly populated and kept in the appropriate [` bridges` ](` ./bridges` ) deployment
@@ -247,13 +261,8 @@ UI_EXPECTED_ETHEREUM_NETWORK_ID=105
247
261
248
262
# ## UI
249
263
250
- Use [wss://rialto.bridges.test-installations.parity.io/](https://polkadot.js.org/apps/)
251
- as a custom endpoint for [https://polkadot.js.org/apps/](https://polkadot.js.org/apps/).
252
-
253
- # ## Polkadot.js UI
254
-
255
- To teach the UI decode our custom types used in the pallet, go to: ` Settings -> Developer`
256
- and import the [` ./types.json` ](./types.json)
264
+ Use [wss://wss.rialto.brucke.link](https://polkadot.js.org/apps/) as a custom endpoint for
265
+ [https://polkadot.js.org/apps/](https://polkadot.js.org/apps/).
257
266
258
267
# # Scripts
259
268
0 commit comments