Skip to content

Running Avail Node Together With LCs

Marko PetrliΔ‡ edited this page Oct 19, 2023 · 19 revisions

Running Avail Node Together With LCs

This is a comprehensive guide on how to set up a network comprising one Node, one Bootstrap LC Node, and two LC nodes.

Manually

You'll need to have the following dependencies installed before proceeding with this guide:

# All our repositories will be stored inside the work directory
mkdir work && cd work

# Cloning and Building Node, LC, Bootstrap LC
git clone https://github.com/availproject/avail.git node && cd node && git checkout v1.7.2 && cargo build --release && cd ./.. \
git clone https://github.com/availproject/avail-light.git light && cd light && git checkout v1.7.2 && cargo build --release && cd ./.. \
git clone https://github.com/availproject/avail-light-bootstrap.git boostrap && cd boostrap && git checkout 11637d5d80de0b051148e69bad48101a8c891280 && cargo build --release && cd ./..

Create four terminal windows. Ensure that the current directory for these terminals is set to our work directory.

Terminal 1: Node

Run the following command:

cd node && ./target/release/data-avail --dev

Once the Node is running, wait for it to finalize the first block before proceeding with this guide.

Output

If everything worked correctly, you should see this message:

2023-10-13 11:23:03 Avail Node    
2023-10-13 11:23:03 ✌️  version 1.7.2-0fd1b21757c    
2023-10-13 11:23:03 ❀️  by Avail Team, 2017-2023    
2023-10-13 11:23:03 πŸ“‹ Chain specification: Avail Development Network    
2023-10-13 11:23:03 🏷  Node name: ill-informed-approval-1189    
2023-10-13 11:23:03 πŸ‘€ Role: AUTHORITY    
2023-10-13 11:23:03 πŸ’Ύ Database: RocksDb at /tmp/substratebBqgDp/chains/avail_development_network/db/full    
2023-10-13 11:23:04 [0] πŸ’Έ generated 1 npos voters, 1 from validators and 0 nominators    
2023-10-13 11:23:04 [0] πŸ’Έ generated 1 npos targets    
2023-10-13 11:23:04 πŸ”¨ Initializing Genesis block/state (state: 0x69fb…f0f0, header-hash: 0x5f02…e147)    
2023-10-13 11:23:04 πŸ‘΄ Loading GRANDPA authority set from genesis on what appears to be first startup.    
2023-10-13 11:23:05 πŸ‘Ά Creating empty BABE epoch changes on what appears to be first startup.    
2023-10-13 11:23:05 🏷  Local node identity is: 12D3KooWAiD3S8WQDQRsJZjZj7AkApESd3gtXubun8DJ2vMifeuG    
2023-10-13 11:23:05 Prometheus metrics extended with avail metrics    
2023-10-13 11:23:05 πŸ’» Operating system: linux    
2023-10-13 11:23:05 πŸ’» CPU architecture: x86_64    
2023-10-13 11:23:05 πŸ’» Target environment: gnu    
2023-10-13 11:23:05 πŸ’» CPU: 13th Gen Intel(R) Core(TM) i7-13700K    
2023-10-13 11:23:05 πŸ’» CPU cores: 16    
2023-10-13 11:23:05 πŸ’» Memory: 31863MB    
2023-10-13 11:23:05 πŸ’» Kernel: 6.5.5-100.fc37.x86_64    
2023-10-13 11:23:05 πŸ’» Linux distribution: Fedora Linux 37 (Workstation Edition)    
2023-10-13 11:23:05 πŸ’» Virtual machine: no    
2023-10-13 11:23:05 πŸ“¦ Highest known block at #0    
2023-10-13 11:23:05 Running JSON-RPC server: addr=127.0.0.1:9944, allowed origins=["*"]    
2023-10-13 11:23:05 🏁 CPU score: 1.64 GiBs    
2023-10-13 11:23:05 🏁 Memory score: 22.82 GiBs    
2023-10-13 11:23:05 🏁 Disk score (seq. writes): 6.83 GiBs    
2023-10-13 11:23:05 🏁 Disk score (rand. writes): 2.68 GiBs    
2023-10-13 11:23:05 〽️ Prometheus exporter started at 127.0.0.1:9615    
2023-10-13 11:23:05 πŸ‘Ά Starting BABE Authorship worker    
2023-10-13 11:23:10 πŸ’€ Idle (0 peers), best: #0 (0x5f02…e147), finalized #0 (0x5f02…e147), ⬇ 0 ⬆ 0    
2023-10-13 11:23:15 πŸ’€ Idle (0 peers), best: #0 (0x5f02…e147), finalized #0 (0x5f02…e147), ⬇ 0 ⬆ 0    
2023-10-13 11:23:20 πŸ™Œ Starting consensus session on top of parent 0x5f02e3d7948404f734b844f27b9c3831e2c938384df5c73e59bda4d2d9a0e147    
2023-10-13 11:23:20 🎁 Prepared block for proposing at 1 (26 ms) [hash: 0xd351d48434b397176d2716b43d491b8e49e2be969c6d29edc09516a6bf7e7465; parent_hash: 0x5f02…e147; extrinsics (1): [0x3a99…3fe8]    
2023-10-13 11:23:20 πŸ”– Pre-sealed block for proposal at 1. Hash now 0x20db591aa3a0078a6cab354dd83fc07682a1ce9819de6463d9790480e4c8d46d, previously 0xd351d48434b397176d2716b43d491b8e49e2be969c6d29edc09516a6bf7e7465.    
2023-10-13 11:23:20 πŸ‘Ά New epoch 0 launching at block 0x20db…d46d (block slot 84859450 >= start slot 84859450).    
2023-10-13 11:23:20 πŸ‘Ά Next epoch starts at slot 84859630    
2023-10-13 11:23:20 ✨ Imported #1 (0x20db…d46d)    

Terminal 2: Bootstrap LC

Run the following command:

cd boostrap && ./target/release/avail-light-bootstrap

Output

If everything worked correctly, you should see this message:

2023-10-13T09:25:46.200515Z  INFO avail_light_bootstrap::network: Local Peer ID: PeerId("12D3KooWS9BZnKansQfo6AHJ54gZbSPTPENHEdr3JWEFJ5NELKAw"). Public key: PublicKey { publickey: Ed25519(PublicKey(compressed): f28d99e601ecbb1ee3e3247bad1f5c1ff39b74bf673fa14b1443d13d1730) }.
2023-10-13T09:25:46.201013Z  INFO avail_light_bootstrap::server: HTTP server running on http://127.0.0.1:7700
2023-10-13T09:25:46.201073Z  INFO Server::run{addr=127.0.0.1:7700}: warp::server: listening on http://127.0.0.1:7700
2023-10-13T09:25:46.201679Z  INFO avail_light_bootstrap: Started listening on port: 37000.
2023-10-13T09:25:46.201684Z  INFO avail_light_bootstrap: Bootstrap node starting ...
2023-10-13T09:25:46.201718Z  INFO avail_light_bootstrap::network::event_loop: Local node is listening on: "/ip4/127.0.0.1/udp/37000/quic-v1/p2p/12D3KooWS9BZnKansQfo6AHJ54gZbSPTPENHEdr3JWEFJ5NELKAw"
2023-10-13T09:25:46.201730Z  INFO avail_light_bootstrap::network::event_loop: Local node is listening on: "/ip4/192.168.1.125/udp/37000/quic-v1/p2p/12D3KooWS9BZnKansQfo6AHJ54gZbSPTPENHEdr3JWEFJ5NELKAw"

Error message

If you see an error message like this:

2023-10-13T09:26:01.201196Z ERROR avail_light_bootstrap::network::event_loop: AutoNAT Outbound Probe failed with Peer: None. Error: NoServer

you can safely ignore it.

Terminal 3: LC Node 1

Run the following command:

cd light && ./target/release/avail-light

Output

If everything worked correctly, you should see this message:

2023-10-13T09:43:48.649991Z  INFO avail_light: Running Avail light client version: 1.7.1
2023-10-13T09:43:48.650000Z  INFO avail_light: Using config: RuntimeConfig { http_server_host: "127.0.0.2", http_server_port: (7001, 0), secret_key: Some(Seed { seed: "avail" }), port: 37001, tcp_port_reuse: false, autonat_only_global_ips: false, autonat_throttle: 1, autonat_retry_interval: 10, autonat_refresh_interval: 30, autonat_boot_delay: 5, identify_protocol: "/avail_kad/id/1.0.0", identify_agent: "avail-light-client/rust-client", bootstraps: [(PeerId("12D3KooWS9BZnKansQfo6AHJ54gZbSPTPENHEdr3JWEFJ5NELKAw"), "/ip4/192.168.1.125/udp/37000/quic-v1")], bootstrap_period: 300, relays: [], full_node_ws: ["ws://127.0.0.1:9944"], app_id: Some(0), confidence: 92.0, avail_path: "avail_path", log_level: "info", log_format_json: false, ot_collector_endpoint: "http://otelcollector.avail.tools:4317", disable_rpc: false, disable_proof_verification: false, dht_parallelization_limit: 20, put_batch_size: 1000, query_proof_rpc_parallel_tasks: 8, block_processing_delay: None, block_matrix_partition: None, sync_start_block: None, max_cells_per_rpc: Some(30), threshold: 5000, kad_record_ttl: 86400, publication_interval: 43200, replication_interval: 10800, replication_factor: 20, connection_idle_timeout: 30, query_timeout: 60, query_parallelism: 3, caching_max_peers: 1, disjoint_query_paths: false, max_kad_record_number: 2400000, max_kad_record_size: 8192, max_kad_provided_keys: 1024, avail_secret_key: None }
2023-10-13T09:43:48.819745Z  INFO avail_light::network: Local peer id: PeerId("12D3KooWBmiYs4mfEDBqRQ8itZ3Ex8nZVFLwJeMbp3pED65VRRxM"). Public key: PublicKey { publickey: Ed25519(PublicKey(compressed): 1d9ad3d40b799dd5b3574e57142aff0f137aedc47bf6707433ec9cc339d02a) }.
2023-10-13T09:43:48.820370Z  INFO avail_light: Listening on port: 37001
2023-10-13T09:43:48.821248Z  INFO avail_light: Bootstraping the DHT with bootstrap nodes...
2023-10-13T09:43:48.821354Z  INFO avail_light::network::event_loop: Local node is listening on "/ip4/127.0.0.1/udp/37001/quic-v1"
2023-10-13T09:43:48.821364Z  INFO avail_light::network::event_loop: Local node is listening on "/ip4/192.168.1.125/udp/37001/quic-v1"
2023-10-13T09:43:49.070554Z  INFO avail_light::rpc: Connection established to the node: ws://127.0.0.1:9944 <v1.7.2-0fd1b21757c/data-avail/12>

Log on Bootstrap

If LC and Boostrap are successfully paired the following message should be logged in the Boostrap terminal:

2023-10-13T09:43:53.822521Z  INFO avail_light_bootstrap: Bootstrap done.

Terminal 4: LC Node 2

cd light

# This is one single command, make sure you copy everything
cat << EOF >> myconfig2.yaml
log_level = "info"
http_server_host = "127.0.0.3"
http_server_port = "7002"
secret_key = { seed = "avail-2" }
port = 37002
full_node_ws = ["ws://127.0.0.1:9944"]
app_id = 0
confidence = 92.0
avail_path = "avail_path2"
bootstraps = ["/ip4/127.0.0.1/tcp/39000/quic-v1/12D3KooWStAKPADXqJ7cngPYXd2mSANpdgh1xQ34aouufHA2xShz"]
EOF

# Run LC
./target/release/avail-light --config myconfig2.yaml

Output

If everything worked correctly, you should see this message:

2023-10-13T09:44:41.452884Z  INFO avail_light: Running Avail light client version: 1.7.1
2023-10-13T09:44:41.452894Z  INFO avail_light: Using config: RuntimeConfig { http_server_host: "127.0.0.3", http_server_port: (7002, 0), secret_key: Some(Seed { seed: "avail-2" }), port: 37002, tcp_port_reuse: false, autonat_only_global_ips: false, autonat_throttle: 1, autonat_retry_interval: 10, autonat_refresh_interval: 30, autonat_boot_delay: 5, identify_protocol: "/avail_kad/id/1.0.0", identify_agent: "avail-light-client/rust-client", bootstraps: [(PeerId("12D3KooWS9BZnKansQfo6AHJ54gZbSPTPENHEdr3JWEFJ5NELKAw"), "/ip4/192.168.1.125/udp/37000/quic-v1")], bootstrap_period: 300, relays: [], full_node_ws: ["ws://127.0.0.1:9944"], app_id: Some(0), confidence: 92.0, avail_path: "avail_path2", log_level: "info", log_format_json: false, ot_collector_endpoint: "http://otelcollector.avail.tools:4317", disable_rpc: false, disable_proof_verification: false, dht_parallelization_limit: 20, put_batch_size: 1000, query_proof_rpc_parallel_tasks: 8, block_processing_delay: None, block_matrix_partition: None, sync_start_block: None, max_cells_per_rpc: Some(30), threshold: 5000, kad_record_ttl: 86400, publication_interval: 43200, replication_interval: 10800, replication_factor: 20, connection_idle_timeout: 30, query_timeout: 60, query_parallelism: 3, caching_max_peers: 1, disjoint_query_paths: false, max_kad_record_number: 2400000, max_kad_record_size: 8192, max_kad_provided_keys: 1024, avail_secret_key: None }
2023-10-13T09:44:41.599637Z  INFO avail_light::network: Local peer id: PeerId("12D3KooWSMmCyLGboWjWhNGYryVF8zWerZS6sHCfhrhCLobKzPeZ"). Public key: PublicKey { publickey: Ed25519(PublicKey(compressed): f5c6ba6bc3f516767c2aca7a0726b5199a2f656ae78a2b95acecd828ce2) }.
2023-10-13T09:44:41.600239Z  INFO avail_light: Listening on port: 37002
2023-10-13T09:44:41.600878Z  INFO avail_light: Bootstraping the DHT with bootstrap nodes...
2023-10-13T09:44:41.600946Z  INFO avail_light::network::event_loop: Local node is listening on "/ip4/127.0.0.1/udp/37002/quic-v1"
2023-10-13T09:44:41.600992Z  INFO avail_light::network::event_loop: Local node is listening on "/ip4/192.168.1.125/udp/37002/quic-v1"
2023-10-13T09:44:41.852670Z  INFO avail_light::rpc: Connection established to the node: ws://127.0.0.1:9944 <v1.7.2-0fd1b21757c/data-avail/12>