Giter VIP home page Giter VIP logo

go-qubic-nodes's Introduction

The Qubic nodes service

The purpose of the qubic-nodes service is to continuously check node reliability and provide, upon request, a list of reliable nodes.

Building from source

go build

Running the service

Configuration

The service can be configured either by CLI parameters or environment variables. The current configuration will be printed at startup.

Required parameters

QUBIC_NODES_QUBIC_PEER_LIST:                "5.39.222.64;82.197.173.130;82.197.173.129"

Optional parameters

QUBIC_NODES_QUBIC_EXCHANGE_TIMEOUT:         (default: 2s)
QUBIC_NODES_QUBIC_MAX_TICK_ERROR_THRESHOLD: (default: 50)
QUBIC_NODES_QUBIC_RELIABLE_TICK_RANGE:      (default: 30)

QUBIC_NODES_SERVICE_TICKER_UPDATE_INTERVAL: (default: 5s)

Docker (recommended)

A docker-compose.yml file is provided in this repository. You can run it as-is using docker compose up -d.

It may be necessary to configure an up-to-date list of peers if the service fails to start.

Standalone

Export the required environment variables:

export QUBIC_NODES_QUBIC_PEER_LIST="5.39.222.64;82.197.173.130;82.197.173.129"

You can now start the service:

./go-qubic-nodes

Available endpoints

/status

curl http://127.0.0.1:8080/status  
{
  "max_tick":13692658,
  "last_update":1714654658,
  "reliable_nodes":[
    {
      "address":"5.39.222.64",
      "peers":[
        "194.45.36.121",
        "109.230.239.139",
        "66.23.193.243",
        "5.39.217.105"
      ],
      "last_tick":13692657,
      "last_update":1714654657
    },
    {
      "address":"82.197.173.130",
      "peers":[
        "194.45.36.144",
        "66.248.204.30",
        "66.23.193.218",
        "109.230.239.74"
      ],
      "last_tick":13692658,
      "last_update":1714654658
    },
    {
      "address":"82.197.173.129",
      "peers":[
        "185.130.224.45",
        "95.156.231.27",
        "82.197.173.130",
        "5.39.216.39"
      ],
      "last_tick":13692658,
      "last_update":1714654658
    }
  ],
  "most_reliable_node":{
    "address":"82.197.173.129",
    "peers":[
      "185.130.224.45",
      "95.156.231.27",
      "82.197.173.130",
      "5.39.216.39"
    ],
    "last_tick":13692658,
    "last_update":1714654658
  }
}

/max-tick

curl http://127.0.0.1:8080/max-tick      
{
  "max_tick":13692662
}

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.