How to relay Ethereum headers to Darwinia Bridge
explain in depth
Antonio
yanganto@github
antonio.yang@itering.io
2020/05/04
Joseph Barriento@Unsplash
Workshop
The Role of Relayer
Undoubted Witness
Â
Before we start
Workshop
You just need to know followings to complete the workshop
- a little Linux command
- a little docker command
You are still welcome to take a look at this work shop
if you are not ready to hack
Before next slide
-
Install docker, https://www.docker.com/
-
Download the docker image if already installed
docker pull yanganto/darwinia-workshop - Open the hands on notes in other tab
darwinia-network/workshop@github
Workshop
When you are waiting others, you may read pervious talk
Internet of Tokens, Connected!
Base On Substrate, Here is our Github
Verify
is
Witness + Check
How can a relayer be undoubted witness?
Relayer Architecture
As flexible as possible
Relay as you want
-
Offchain worker
- with Darwinia shadow service
- with local shadow service
- Local worker
- DJ: darwinia.js
Darwinia Shadow Service
Offchain
Worker
shadow.darwinia.network
Protocol
{ "id":1, "jsonrpc":"2.0", "result": { "eth_header": "0xd4e5 ...scale_encoded_str", "proof": "0xd4e5...scale_encoded_str"} }
{ id: 1, jsonrpc: "2.0", method: "shadow_getEthHeaderWithProofByNumber", params: {"block_num": 1000, "transaction": false} }
Request:
Response:
Offchain worker
-
FetchInterval = 3
-
fn offchain_worker
-
has key & can signed
Local Shadow Service
Offchain
Worker
http://shadow.darwinia.network
Shadow
Service
Local Shadow Service
Shadow
Service
Offchain
Worker
Relayer incentive model
- System Treasure Support
- Redeem fee
- success relay will in a pool
- paid according the ratio
- https://github.com/darwinia-network/darwinia-common/pull/108
Lets Hand On
Workshop
Q & A
Thank You
See you in Darwinia Network !
Darwinia Chain Relay workshop
By Antonio Yang
Darwinia Chain Relay workshop
Layer One Workshop, hands on materials please check on this https://github.com/darwinia-network/workshop/tree/master/2020-05-04
- 835