2021-08-09 16:10:58 +02:00
|
|
|
# Fluffy: The Nimbus Portal Network Client
|
2021-06-17 17:05:00 +02:00
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
[](https://github.com/status-im/nimbus-eth1/actions/workflows/fluffy.yml)
|
2021-06-17 17:05:00 +02:00
|
|
|

|
|
|
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|
|
|
|
|
[](https://discord.gg/XRxWahP)
|
|
|
|
[](https://join.status.im/nimbus-general)
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
This folder holds the development of the Nimbus client implementation supporting
|
2021-08-09 16:10:58 +02:00
|
|
|
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.
|
2021-06-17 17:05:00 +02:00
|
|
|
|
|
|
|
Current status of specifications can be found in the
|
2021-09-24 17:18:54 +02:00
|
|
|
[portal-network-specs repository](https://github.com/ethereum/portal-network-specs/blob/master/portal-network.md).
|
2021-06-17 17:05:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
## Development Updates
|
|
|
|
|
|
|
|
To keep up to date with changes and development progress, follow the
|
|
|
|
[Nimbus blog](https://our.status.im/tag/nimbus/).
|
|
|
|
|
2021-12-13 14:12:51 +01:00
|
|
|
Monthly development updates are shared
|
|
|
|
[here](https://hackmd.io/jRpxY4WBQJ-hnsKaPDYqTw).
|
|
|
|
|
2021-06-17 17:05:00 +02:00
|
|
|
## How to Build & Run
|
|
|
|
|
|
|
|
### Prerequisites
|
|
|
|
- GNU Make, Bash and the usual POSIX utilities. Git 2.9.4 or newer.
|
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
### Build fluffy client
|
2021-06-17 17:05:00 +02:00
|
|
|
```bash
|
|
|
|
git clone git@github.com:status-im/nimbus-eth1.git
|
|
|
|
cd nimbus-eth1
|
2021-06-28 17:53:13 +02:00
|
|
|
make fluffy
|
2021-06-17 17:05:00 +02:00
|
|
|
|
|
|
|
# See available command line options
|
2021-06-28 17:53:13 +02:00
|
|
|
./build/fluffy --help
|
2021-06-17 17:05:00 +02:00
|
|
|
|
2021-12-13 14:12:51 +01:00
|
|
|
# Example command: Run the client and connect to a bootstrap node.
|
|
|
|
./build/fluffy --bootstrap-node:enr:<base64 encoding of ENR>
|
2021-06-17 17:05:00 +02:00
|
|
|
```
|
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
### Update and rebuild fluffy client
|
2021-06-17 17:05:00 +02:00
|
|
|
```bash
|
|
|
|
# From the nimbus-eth1 repository
|
|
|
|
git pull
|
|
|
|
# To bring the git submodules up to date
|
|
|
|
make update
|
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
make fluffy
|
2021-06-17 17:05:00 +02:00
|
|
|
```
|
|
|
|
|
2021-09-24 17:18:54 +02:00
|
|
|
### Run fluffy test suite
|
|
|
|
```bash
|
|
|
|
# From the nimbus-eth1 repository
|
|
|
|
make fluffy-test
|
|
|
|
```
|
|
|
|
|
2022-03-17 22:41:43 +01:00
|
|
|
### Run fluffy on (Nimbus) public testnet0
|
|
|
|
|
|
|
|
There is a fleet of fluffy nodes deployed, and to easily join these, the
|
|
|
|
`--network:testnet0` option can be used.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./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 designated fluffy 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 2500 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
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Run fluffy local testnet script
|
2021-12-13 14:12:51 +01:00
|
|
|
```bash
|
|
|
|
./fluffy/scripts/launch_local_testnet.sh
|
|
|
|
```
|
|
|
|
|
2022-02-11 14:43:10 +01:00
|
|
|
Find more details on the usage and workings of the local testnet script
|
|
|
|
[here](./docs/local_testnet.md).
|
|
|
|
|
2021-06-17 17:05:00 +02:00
|
|
|
### Windows support
|
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
Follow the steps outlined [here](../README.md#windows) to build fluffy on Windows.
|
2021-06-17 17:05:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
## 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.:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# start a new interactive shell with the right env vars set
|
|
|
|
./env.sh bash
|
|
|
|
```
|
|
|
|
|
|
|
|
More [development tips](../README.md#devel-tips)
|
|
|
|
can be found on the general nimbus-eth1 readme.
|
|
|
|
|
|
|
|
The code follows the
|
|
|
|
[Status Nim Style Guide](https://status-im.github.io/nim-style-guide/).
|
|
|
|
|
2021-12-13 14:12:51 +01:00
|
|
|
Detailed document showing commands to
|
|
|
|
[test client protocol interoperability](./docs/protocol_interop.md).
|
|
|
|
|
2021-06-17 17:05:00 +02:00
|
|
|
## License
|
|
|
|
|
|
|
|
Licensed and distributed under either of
|
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
* MIT license: [LICENSE-MIT](../LICENSE-MIT) or http://opensource.org/licenses/MIT
|
2021-06-17 17:05:00 +02:00
|
|
|
|
|
|
|
or
|
|
|
|
|
2021-06-28 17:53:13 +02:00
|
|
|
* Apache License, Version 2.0, ([LICENSE-APACHEv2](../LICENSE-APACHEv2) or http://www.apache.org/licenses/LICENSE-2.0)
|
2021-06-17 17:05:00 +02:00
|
|
|
|
|
|
|
at your option. These files may not be copied, modified, or distributed except according to those terms.
|