Giter VIP home page Giter VIP logo

nulink-watcher's Introduction

NuLink-watcher

## Introduction This is the Repo for NuLink watcher nodes. The watcher nodes would use the ChainBridge(an ETH-Polkadot bridge) to retrieve the information of stakers and workers from the Nucypher contract in Ethereum.

Work flow

Once the watcher nodes started, it would first try to register in NuProxy pallet. It will fall into the following three situation:

  1. If the node is illegal for registration, it will report a warning and exit.
  2. If the node is legal for registration and already registered, it will jump to the next step.
  3. Otherwise it would successfully register into the NuProxy pallet.

After the initial step, the watcher nodes would monitor the Ethereum network. If the staker information stored in NuCypher contract changes, it would synchronize the updated status by sending the updating extrinsic in Polkadto Parachain periodically.

Getting Started

Edit configuration file

You can edit the default configuration file here accordingly.

The structure of the configuration file is as:

{
  // stake info sync frequency, 100 means sync every 100 blocks
  "epochSize": 100,
  "ethereumConfig": {
    // the url of the ethereum RPC node
    "url": "https://mainnet.infura.io/v3/your_project_id",
    // whether the url of the ethereum RPC node is http protocol, 
    // currently only the http protocol is supported, so this parameter must be true
    "http": true,
    // the address of the nucypher deposit contract
    "depositContractAddr": "0xbbD3C0C794F40c4f993B03F65343aCC6fcfCb2e2"
  },
  "nuLinkChainConfig": {
    // the url of the NuLink RPC node
    "url": "ws://127.0.0.1:9944"
  }
}

Build

cd cmd/watcher
go build -o watcher main.go

Run

Going watcher -h can get help infos.

Run the watcher with the specified parameters

./watcher --config ../../config.json  --mock

Command parameters

You can use the default configuration or specify related configurations. The parameters you can specify are mainly the following.

config: This flag can be used to specify a json configuration file.

mock: Start the project in mock mode.

nulink-watcher's People

Contributors

alirezaly avatar anders927 avatar ansermino avatar anthonychernyak avatar dependabot-preview[bot] avatar dependabot[bot] avatar gregthegreek avatar mario-sangar avatar mikiquantum avatar noot avatar oneshut avatar p1sar avatar pawnz0 avatar polycarpik avatar priom avatar relxss avatar ryry79261 avatar spacesailor24 avatar steviezhang avatar tolak avatar vezenovm avatar waymobetta avatar ysfkel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.