Giter Site home page Giter Site logo

mainstay's Introduction

mainstay

The mainstay repository is an application that implements the Mainstay protocol designed by CommerceBlock. It is a Go daemon performing attestations of the Ocean network to Bitcoin. It also includes a Confirmation tool that can be run in parallel to the Ocean/Bitcoin networks and confirm these attestations.

Prerequisites

Instructions

Attestation Service

  • Install go and the attestation service by following scripts/build.sh

  • Regtest Demo

    • Start the ocean-demo python ocean-demo/PROTOCOLS/demo.py
    • Run mainstay -regtest
  • Testnet Mode

    • Download and run a full Bitcoin Node on testnet mode, fully indexed and in blocksonly mode. signrawtransaction should also be included as a deprecatedrpc option. Add the connection details (actual value or ENV variable) to this node in conf/conf.json

    • Fund this wallet node, send all the funds to a single address and store the TX_HASH and PRIVKEY of this transaction.

    • The TX_HASH should be included in the genesis block of the Ocean network using the conf option attestationhash. Initiate the Ocean testnet network and add connection details (actual value or ENV variable) to one of it's nodes in conf/conf.json.

    • Run mainstay -tx TX_HASH

  • Unit Testing

    • /$GOPATH/src/mainstay/run-tests.sh

Confirmation Tool

The confirmation tool cmd/confirmationtool can be used to confirm all the attestations of the Ocean network to Bitcoin and wait for any new attestations that will be happening.

Running this tool will require a full Bitcoin testnet node and a full Ocean node. Connection details for these should be included in cmd/confirmationtool/conf.json. To run this tool you need to first fetch the TX_HASH from the attestationhash field in the Ocean genesis block and then run:

go run cmd/confirmationtool/confirmationtool.go -tx TX_HASH

This will initially take some time to sync up all the attestations that have been committed so far and then will wait for any new attestations. Logging is displayed for each attestation and for full details the -detailed flag can be used.

mainstay's People

Contributors

nkostoulas avatar tomt1664 avatar

Watchers

Nicholas Gregory 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.