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

  1. a little Linux command
  2. 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

  1. Install docker, https://www.docker.com/

  2. Download the docker image if already installed

    docker pull yanganto/darwinia-workshop
  3. 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

  • Source

  • FetchInterval = 3

  • fn offchain_worker

  • has key & can signed

Local Shadow Service

Offchain

Worker

http://shadow.darwinia.network

Shadow

Service

 

Dargo: Darwinia.go

Local Shadow Service

  • Setup hosts

  • Proxy by ports
  • setting

Shadow

Service

Offchain

Worker

Relayer incentive model

  1. Open the hands on notes in other tab
  2. Let's know how to build things
  3. Let's try to be a relayer

Lets Hand On

Workshop

Q & A

Thank You

See you in Darwinia Network !

Made with Slides.com