Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localnet does not produce blocks #543

Closed
soywod opened this issue Jun 17, 2024 · 7 comments
Closed

Localnet does not produce blocks #543

soywod opened this issue Jun 17, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@soywod
Copy link

soywod commented Jun 17, 2024

Describe the bug

I try to create a subnet following this documentation: https://docs.bittensor.com/subnets/create-a-subnet.

Running ./scripts/localnet.sh works, but then shows indefinitely the same log:

$ ./scripts/localnet.sh 
*** Building substrate binary...
warning: field `backend` is never read
  --> node/src/rpc.rs:45:9
   |
35 | pub struct FullDeps<C, P, B> {
   |            -------- field in this struct
...
45 |     pub backend: Arc<B>,
   |         ^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `node-subtensor` (bin "node-subtensor") generated 1 warning
    Finished `release` profile [optimized] target(s) in 0.69s
*** Binary compiled
*** Starting localnet nodes...
2024-06-17 14:50:04 Subtensor Node    
2024-06-17 14:50:04 ✌️  version 4.0.0-dev-ebb72e353e5    
2024-06-17 14:50:04 ❤️  by Substrate DevHub <https://github.com/substrate-developer-hub>, 2017-2024    
2024-06-17 14:50:04 📋 Chain specification: Bittensor    
2024-06-17 14:50:04 🏷  Node name: Bob    
2024-06-17 14:50:04 👤 Role: AUTHORITY    
2024-06-17 14:50:04 💾 Database: RocksDb at /tmp/bob/chains/bittensor/db/full    
2024-06-17 14:50:04 Subtensor Node    
2024-06-17 14:50:04 ✌️  version 4.0.0-dev-ebb72e353e5    
2024-06-17 14:50:04 ❤️  by Substrate DevHub <https://github.com/substrate-developer-hub>, 2017-2024    
2024-06-17 14:50:04 📋 Chain specification: Bittensor    
2024-06-17 14:50:04 🏷  Node name: Alice    
2024-06-17 14:50:04 👤 Role: AUTHORITY    
2024-06-17 14:50:04 💾 Database: RocksDb at /tmp/alice/chains/bittensor/db/full    
2024-06-17 14:50:05 Using default protocol ID "sup" because none is configured in the chain specs    
2024-06-17 14:50:05 🏷  Local node identity is: 12D3KooW9wi7xkoYqjKst12kJKWBAg3kAygpgcg5ZM1xoHEtCx4W    
2024-06-17 14:50:05 💻 Operating system: linux    
2024-06-17 14:50:05 💻 CPU architecture: x86_64    
2024-06-17 14:50:05 💻 Target environment: gnu    
2024-06-17 14:50:05 💻 CPU: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz    
2024-06-17 14:50:05 💻 CPU cores: 4    
2024-06-17 14:50:05 💻 Memory: 31808MB    
2024-06-17 14:50:05 💻 Kernel: 6.6.28    
2024-06-17 14:50:05 💻 Linux distribution: NixOS 24.05 (Uakari)    
2024-06-17 14:50:05 💻 Virtual machine: no    
2024-06-17 14:50:05 📦 Highest known block at #0    
2024-06-17 14:50:05 Running JSON-RPC server: addr=127.0.0.1:9946, allowed origins=["*"]    
2024-06-17 14:50:05 〽️ Prometheus exporter started at 127.0.0.1:9615    
2024-06-17 14:50:05 Using default protocol ID "sup" because none is configured in the chain specs    
2024-06-17 14:50:05 🏷  Local node identity is: 12D3KooWNCYHzJMecM1NSdb9UgUjFrA7Po8AXJ6fo5dt1tpwAmer    
2024-06-17 14:50:05 💻 Operating system: linux    
2024-06-17 14:50:05 💻 CPU architecture: x86_64    
2024-06-17 14:50:05 💻 Target environment: gnu    
2024-06-17 14:50:05 💻 CPU: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz    
2024-06-17 14:50:05 💻 CPU cores: 4    
2024-06-17 14:50:05 💻 Memory: 31808MB    
2024-06-17 14:50:05 💻 Kernel: 6.6.28    
2024-06-17 14:50:05 💻 Linux distribution: NixOS 24.05 (Uakari)    
2024-06-17 14:50:05 💻 Virtual machine: no    
2024-06-17 14:50:05 📦 Highest known block at #0    
2024-06-17 14:50:05 Running JSON-RPC server: addr=127.0.0.1:9945, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2024-06-17 14:50:10 💤 Idle (0 peers), best: #0 (0xc6f4…53e6), finalized #0 (0xc6f4…53e6), ⬇ 0 ⬆ 0    
2024-06-17 14:50:10 💤 Idle (0 peers), best: #0 (0xc6f4…53e6), finalized #0 (0xc6f4…53e6), ⬇ 0 ⬆ 0    
2024-06-17 14:50:15 💤 Idle (0 peers), best: #0 (0xc6f4…53e6), finalized #0 (0xc6f4…53e6), ⬇ 0 ⬆ 0    
2024-06-17 14:50:15 💤 Idle (0 peers), best: #0 (0xc6f4…53e6), finalized #0 (0xc6f4…53e6), ⬇ 0 ⬆ 0    
2024-06-17 14:50:20 💤 Idle (0 peers), best: #0 (0xc6f4…53e6), finalized #0 (0xc6f4…53e6), ⬇ 0 ⬆ 0    
2024-06-17 14:50:20 💤 Idle (0 peers), best: #0 (0xc6f4…53e6), finalized #0 (0xc6f4…53e6), ⬇ 0 ⬆ 0    
[…]

When I run:

$ btcli wallet faucet --wallet.name owner --subtensor.chain_endpoint ws://127.0.0.1:9946
Run Faucet ?
 coldkey:    5F93HA9yz1TnHqAnLV4BChgYY8TjSEmqq24BBQcFAYTQtMQk
 network:    local [y/n]: y

It just hangs, no logs from both sides.

To Reproduce

Just follow documentation on subnet creation: https://docs.bittensor.com/subnets/create-a-subnet

Fails on wallet faucet command due to freeze.

Expected behavior

I expect the wallet faucet command to output:

>> Balance: τ0.000000000 ➡ τ100.000000000

Screenshots

No response

Environment

NixOS 24.05, bittensor cli v7.2.0, subtensor branch development (ebb72e)

Additional context

No response

@soywod soywod added the bug Something isn't working label Jun 17, 2024
@distributedstatemachine
Copy link
Contributor

Thanks for reaching out @soywod . What branch subtensor branch are you building off ?

@soywod
Copy link
Author

soywod commented Jun 17, 2024

I tried main, then v1.1.2, v1.1.1-pre-release and finally development.

I initiated the discussion on Discord (the forum section), I received some help. Somehow running the localnet script from a docker (debian) works, so it looks like an issue with the network (related to NixOS?). Now I have a ConnectionResetError: [Errno 104] Connection reset by peer when I attempt to wallet faucet.

@soywod
Copy link
Author

soywod commented Jun 17, 2024

I finally found the solution: mDNS was disabled on my OS and I needed to enable it for nodes to be discovered. I will propose a PR to improve the doc.

@distributedstatemachine
Copy link
Contributor

Sounds good. can you please submit the PR and link it to this issue so we can close it.

@soywod
Copy link
Author

soywod commented Jun 17, 2024

Sounds good. can you please submit the PR and link it to this issue so we can close it.

Yes, I was planning to do so. Thank you!

@distributedstatemachine
Copy link
Contributor

@soywod still waiting on that PR sir!

@soywod
Copy link
Author

soywod commented Jul 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants