nimbus-eth1/fluffy
KonradStaniec 196428dcf5
Use one ws connection to transfer data from source (#1136)
2022-06-22 08:50:58 +02:00
..
common Add Accumulator build helper calls and refactors (#1127) 2022-06-16 08:50:29 +02:00
docs Update local_testnet.md (#976) 2022-02-22 15:55:47 +01:00
grafana Add pruning metrics (#1093) 2022-05-17 12:47:24 +02:00
network Add Accumulator build helper calls and refactors (#1127) 2022-06-16 08:50:29 +02:00
network_data/testnet0 Update Ultralight bootstrap nodes for testnet (#1110) 2022-06-01 08:52:54 +02:00
rpc Rework of Portal json-rpc debug API and related functionality (#1102) 2022-05-24 13:27:22 +02:00
scripts Increase wait time for content propagation to avoid CI failures (#1122) 2022-06-14 14:23:07 +02:00
tests Add Accumulator build helper calls and refactors (#1127) 2022-06-16 08:50:29 +02:00
tools Use one ws connection to transfer data from source (#1136) 2022-06-22 08:50:58 +02:00
README.md Change test data and propagation format (#1115) 2022-06-08 15:14:01 +02:00
conf.nim Rework of Portal json-rpc debug API and related functionality (#1102) 2022-05-24 13:27:22 +02:00
content_db.nim Use queries with custom xor function (#1113) 2022-06-03 13:44:42 +02:00
fluffy.nim Rework of Portal json-rpc debug API and related functionality (#1102) 2022-05-24 13:27:22 +02:00
fluffy.nim.cfg Fix runtime loglevel selection for Fluffy (#980) 2022-02-24 22:50:59 +01:00
network_metadata.nim Add bootstrap nodes at compile time for testnet0 (#998) 2022-03-17 18:39:24 +01:00
populate_db.nim Add Accumulator build helper calls and refactors (#1127) 2022-06-16 08:50:29 +02:00
seed_db.nim Add seed db file format (#1126) 2022-06-20 16:52:48 +02:00

README.md

Fluffy: The Nimbus Portal Network Client

fluffy CI Stability: experimental License: Apache License: MIT

Discord: Nimbus Status: #nimbus-general

Introduction

This folder holds the development of the Nimbus client implementation supporting the Portal Network: fluffy. The Portal Network is a project still heavily in research phase and fully in flux. This client is thus still highly experimental.

Current status of specifications can be found in the portal-network-specs repository.

Development Updates

To keep up to date with changes and development progress, follow the Nimbus blog.

Monthly development updates are shared here.

How to Build & Run

Prerequisites

  • GNU Make, Bash and the usual POSIX utilities. Git 2.9.4 or newer.

Build fluffy client

git clone git@github.com:status-im/nimbus-eth1.git
cd nimbus-eth1
make fluffy

# See available command line options
./build/fluffy --help

# Example command: Run the client and connect to a bootstrap node.
./build/fluffy --bootstrap-node:enr:<base64 encoding of ENR>

Update and rebuild fluffy client

# From the nimbus-eth1 repository
git pull
# To bring the git submodules up to date
make update

make fluffy

Run fluffy on public testnet

There is a fleet of fluffy nodes deployed, and to easily join these, the --network:testnet0 option can be used.

./build/fluffy --network:testnet0 --table-ip-limit:1024 --bucket-ip-limit:24 --log-level:info --rpc

Note: This --network option will merely select a static set of specific bootstrap nodes belonging to a "testnet". Currently testnet0 is the only option, which results in connecting to the testnet bootstrap nodes. It should be noted that there is no real way to distinguish a "specific" Portal network, and as long as the same Portal protocols are supported, nodes can simply connect to it and no real separation can be made.

The table-ip-limit and bucket-ip-limit options are needed to allow more nodes with the same IPs in the routing tables. This is needed because the fleet of fluffy nodes runs on only 2 machines / network interfaces.

The network is currently storing only the first 25000 mainnet blocks. This can be tested by using the JSON-RPC call eth_getBlockByHash:

# Get the hash of a block from your favorite block explorer, e.g.:
# 0x8dda3a641653c0454569c3b5be529f58b14d2a5b5d87956664c746ce1e367c21
# Run command to get this block:
curl -s -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"1","method":"eth_getBlockByHash","params":["0x8dda3a641653c0454569c3b5be529f58b14d2a5b5d87956664c746ce1e367c21", false]}' http://localhost:8545 | jq

One can also use the blockwalk tool to walk down the blocks one by one, e.g:

make fluffy-tools

./build/blockwalk --block-hash:0xf6bfad56d1a45d1661506343dd1e511b5d7e17565b3ec293125ff0890b9709e5

One can also use the eth-data-exporter tool to download history data from local geth instance into the format which is suitable for propagating data into fluffy client e.g:

make fluffy-tools

./build/eth_data_exporter --initial-block:1 --end-block: 10 --data-dir:"/userDirectory/"

Will download blocks from 1 to 10 into user provided director in one json file.

Run fluffy test suite

# From the nimbus-eth1 repository
make fluffy-test

Run fluffy local testnet script

./fluffy/scripts/launch_local_testnet.sh

Find more details on the usage and workings of the local testnet script here.

Windows support

Follow the steps outlined here to build fluffy on Windows.

Metrics and their visualisation

To enable metrics run Fluffy with the --metrics flag:

./build/fluffy --metrics

Default the metrics are available at http://127.0.0.1:8008/metrics.

The address can be changed with the --metrics-address and --metrics-port options.

This provides only a snapshot of the current metrics. In order track the metrics over time and to also visualise them one can use for example Prometheus and Grafana.

The steps on how to set up such system is explained in this guide.

A Fluffy specific dashboard can be found here.

For Developers

When working on this repository, you can run the env.sh script to run a command with the right environment variables set. This means the vendored Nim and Nim modules will be used, just as when you use make.

E.g.:

# start a new interactive shell with the right env vars set
./env.sh bash

More development tips can be found on the general nimbus-eth1 readme.

The code follows the Status Nim Style Guide.

Detailed document showing commands to test client protocol interoperability.

License

Licensed and distributed under either of

or

at your option. These files may not be copied, modified, or distributed except according to those terms.