Giter Club home page Giter Club logo

go-songbird's Introduction

Songbird & Coston 1

Node implementation for the Flare network.

Running containers

The fast and simple way of using go-songbird

Public container images are hosted on Docker HUB and Github Packages;

docker.io/flarefoundation/go-songbird
hgcr.io/flare-foundation/go-songbird

Container builds in CI

CI builds on each:

  • push on main branch, pushes image tagged as "dev"
  • creation of a tag, pushes images tagged as the tag itself

Builds:
two images, go-songbird:<TAG> one with leveldb

Installation

Flare uses a relatively lightweight consensus protocol, so the minimum computer requirements are modest. Note that as network usage increases, hardware requirements may change.

The minimum recommended hardware specification for nodes connected to Mainnet is:

  • CPU: Equivalent of 8 vCPU
  • RAM: 16 GiB
  • Storage: 2.5TB for a full archive node 1TB for pruning
  • OS: Ubuntu 18.04/20.04 or macOS >= 10.15 (Catalina)
  • Network: Reliable IPv4 or IPv6 network connection, with an open public port.

If you plan to build Flare from source, you will also need the following software:

  • Go version >= 1.16.8
  • gcc
  • g++

Native Install

Clone the Flare repository:

git clone https://github.com/flare-foundation/go-songbird.git
cd go-songbird/avalanchego

This will clone and checkout to master branch.

Please build and use the latest tag 0.6.4

Building the Flare Executable

Build Flare using the build script:

./scripts/build.sh

The service binary is named flare and is in the build directory.

Running the Flare binary

Connecting to Coston

To connect to the Coston test network, run:

./build/flare --network-id=coston \
  --bootstrap-ips="$(curl -m 10 -sX POST --data '{ "jsonrpc":"2.0", "id":1, "method":"info.getNodeIP" }' -H 'content-type:application/json;' https://coston.flare.network/ext/info | jq -r ".result.ip")" \
  --bootstrap-ids="$(curl -m 10 -sX POST --data '{ "jsonrpc":"2.0", "id":1, "method":"info.getNodeID" }' -H 'content-type:application/json;' https://coston.flare.network/ext/info | jq -r ".result.nodeID")"

You should see some fire ASCII art and log messages.

You can use Ctrl+C to kill the node.

If you want your node's API to be reachable, you have to add the --http-host=<ip_address> flag to the command line.

Connecting to Songbird

To connect to the Songbird canary network, run:

./build/flare --network-id=songbird \
  --bootstrap-ips="$(curl -m 10 -sX POST --data '{ "jsonrpc":"2.0", "id":1, "method":"info.getNodeIP" }' -H 'content-type:application/json;' https://songbird.flare.network/ext/info | jq -r ".result.ip")" \
  --bootstrap-ids="$(curl -m 10 -sX POST --data '{ "jsonrpc":"2.0", "id":1, "method":"info.getNodeID" }' -H 'content-type:application/json;' https://songbird.flare.network/ext/info | jq -r ".result.nodeID")"

You should see some fire ASCII art and log messages.

You can use Ctrl+C to kill the node.

If you want your node's API to be reachable, you have to add the --http-host=<ip_address> flag to the command line.

Please note that you currently need to be whitelisted in order to connect to the Songbird network.

Pruning & APIs

The configuration for the chain is loaded from a configuration file, located at {chain-config-dir}/C/config.json.

Here are the most relevant default settings:

{
  "snowman-api-enabled": false,
  "coreth-admin-api-enabled": false,
  "eth-apis": [
    "public-eth",
    "public-eth-filter",
    "net",
    "web3",
    "internal-public-eth",
    "internal-public-blockchain",
    "internal-public-transaction-pool"
  ],
  "rpc-gas-cap": 50000000,
  "rpc-tx-fee-cap": 100,
  "pruning-enabled": true,
  "local-txs-enabled": false,
  "api-max-duration": 0,
  "api-max-blocks-per-request": 0,
  "allow-unfinalized-queries": false,
  "allow-unprotected-txs": false,
  "remote-tx-gossip-only-enabled": false,
  "log-level": "info"
}

You can refer to the original Avalanche documentation for a full list of all settings and a detailed description.

The directory for configuration files defaults to $HOME/.flare/configs/chains and can be changed using the --chain-config-dir flag.

In order to disable pruning and run a full archival node, pruning-enabled should be set to false.

The various node APIs can also be enabled and disabled by setting the respective parameters.

Launching Flare locally

In order to run a local network, the validator set needs to be defined locally. This can be done by setting the validator set in a environment variable.

You can use ./scripts/launch_localnet.sh as an easy way to spin up a 5-node local network. All funds are controlled by the private key under /.scripts/keys/6b0dd034a2fd67b932f10e3dba1d2bbd39348695.json.

Generating Code

Flare uses multiple tools to generate boilerplate code.

Running protobuf codegen

To regenerate the protobuf go code, run scripts/protobuf_codegen.sh from the root of the repo.

This should only be necessary when upgrading protobuf versions or modifying .proto definition files.

To use this script, you must have buf (v1.0.0-rc12), protoc-gen-go (v1.27.1) and protoc-gen-go-grpc (v1.2.0) installed.

To install the buf dependencies:

go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]

If you have not already, you may need to add $GOPATH/bin to your $PATH:

export PATH="$PATH:$(go env GOPATH)/bin"

If you extract buf to ~/software/buf/bin, the following should work:

export PATH=$PATH:~/software/buf/bin/:~/go/bin
go get google.golang.org/protobuf/cmd/protoc-gen-go
go get google.golang.org/protobuf/cmd/protoc-gen-go-grpc
scripts/protobuf_codegen.sh

For more information, refer to the GRPC Golang Quick Start Guide. |

Security Bugs

We and our community welcome responsible disclosures.

If you've discovered a security vulnerability, please report it via our contact form. Valid reports will be eligible for a reward (terms and conditions apply).

go-songbird's People

Contributors

awfm9 avatar aljazs-flare avatar joshuagedwards avatar sprwn avatar aljaxus 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.