flare

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: BSD-3-Clause

README

Flare

Node implementation for the Flare network.

Installation

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

  • CPU: Equivalent of 8 AWS vCPU
  • RAM: 16 GB
  • Storage: 200 GB
  • OS: Ubuntu 18.04/20.04 or macOS >= 10.15 (Catalina)
  • Network: Reliable IPv4 or IPv6 network connection, with an open public port.
  • Software Dependencies:
Native Install

Clone the Flare repository:

git clone https://github.com/flare-foundation/flare.git
Building the Flare Executable

Build Flare using the build script:

./scripts/build.sh

The Flare binary, named flare, is in the build directory.

Running Flare

Connecting to Songbird

To connect to the Songbird canary network, run:

export FBA_VALs=./scripts/configs/songbird/validators.json
./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.

Please note that you currently need to be whitelisted to connect to the beacon nodes.

Pruning & APIs

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

{
  "snowman-api-enabled": false,
  "coreth-admin-api-enabled": false,
  "net-api-enabled": true,
  "eth-api-enabled": true,
  "personal-api-enabled": false,
  "tx-pool-api-enabled": true,
  "debug-api-enabled": true,
  "web3-api-enabled": true,
  "local-txs-enabled": true,
  "pruning-enabled": false
}

The directory for configuration files defaults to HOME/.flare/configs 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

To create a single node local test network, run:

./build/flare --network-id=local \
  --staking-enabled=false \
  --snow-sample-size=1 \
  --snow-quorum-size=1

This launches a Flare network with one node.

Generating Code

Flare uses multiple tools to generate efficient and 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 protoc (v3.17.3), protoc-gen-go (v1.26.0) and protoc-gen-go-grpc (v1.1.0) installed. protoc must be on your $PATH.

To install the protoc dependencies:

go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1

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 protoc to ~/software/protobuf/, the following should work:

export PATH=$PATH:~/software/protobuf/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).

Directories

Path Synopsis
api
app
rocksdb
^ Only build this file if this computer is not Linux OR it's not AMD64 OR rocksdb is not allowed Copyright (C) 2019-2021, Ava Labs, Inc.
^ Only build this file if this computer is not Linux OR it's not AMD64 OR rocksdb is not allowed Copyright (C) 2019-2021, Ava Labs, Inc.
ids
engine/avalanche/state
Package state manages the meta-data required by consensus for an avalanche dag.
Package state manages the meta-data required by consensus for an avalanche dag.
rpc
vms
avm
evm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL