-
Notifications
You must be signed in to change notification settings - Fork 539
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.
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.
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.
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)
Run the following command:
cd boostrap && ./target/release/avail-light-bootstrap
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"
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.
Run the following command:
cd light && ./target/release/avail-light
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>
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.
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
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>