Having trouble installing a Stacks 2.0 miner on testnet

I’m trying to setup a Stacks Miner on Stacks 2.0 testnet.

I followed the tutorial on the documentation: https://docs.blockstack.org/start-mining

What I did

docker run -d \
  --name stacks_follower \
  --restart=always \
  --log-driver json-file --log-opt max-size=50m \
  -e RUST_BACKTRACE="full" \
  -e BLOCKSTACK_DEBUG="1" \
  -p 20443:20443 \
  -p 20444:20444 \
  blockstack/stacks-blockchain:latest \
/bin/stacks-node xenon
  • I installed bitcoind locally using the latest version from bitcoin.org website. Then I setup a local bitcoind node using the following command:
bitcoind -conf=/root/bitcoin-node/bitcoin.conf -daemon -datadir=/var/lib/bitcoind/.bitcoin
  • It took some time to sync with the testnet blockchain. After a few hours, it was ready!
  • I generated a keychain using the Docker command in the tutorial, worked fine.
  • I imported the address using the command in the tutorial:
bitcoin-cli -rpcport=18332 -rpcuser=your-user -rpcpassword=your-password  -rpcclienttimeout=0  importaddress <btcAddress from JSON above>

Note: I added -rpcclienttimeout=0 to the command, because on my machine importing an address took some time! (The bitcoin node is running on HDD, not SSD)

  • I added some BTC on the address using a testnet faucet (by the way, the faucet you recommend is not working, I had to use another one). I have 0.6 tBTC on the address.

  • Then, when I run:

docker run -d \
  --name stacks_miner \
  --restart=always \
  --network host \
  --log-driver json-file --log-opt max-size=50m \
  -e RUST_BACKTRACE="full" \
  -e BLOCKSTACK_DEBUG="1" \
  -v "/root/stacks-mining/Config.toml:/src/stacks-node/Config.toml" \
  -p 20443:20443 \
  -p 20444:20444 \
  blockstack/stacks-blockchain:latest \
/bin/stacks-node start --config /src/stacks-node/Config.toml

I got an error:

DEBG [1607695005.580338] [src/burnchains/bitcoin/spv.rs:473] [ThreadId(1)] Initialized block headers at /root/stacks-node/current/burnchain/spv-headers.dat
INFO [1607695005.621882] [testnet/stacks-node/src/run_loop/neon.rs:114] [ThreadId(1)] Miner node: checking UTXOs at address: "MY_BTC_ADDRESS_GENERATED_PREVIOUSLY"
DEBG [1607695005.622509] [testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:1120] [ThreadId(1)] BitcoinRPC builder: Some(“MY_RPC_USER”):Some(“MY_RPC_PASSWORD”)@http://127.0.0.1:18333/
Process abort due to thread panic
   0: stacks_node::main::{{closure}}
             at src/testnet/stacks-node/src/main.rs:56
   1: std::panicking::rust_panic_with_hook
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:581
   2: std::panicking::begin_panic::{{closure}}
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:506
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:153
   4: std::panicking::begin_panic
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:505
   5: async_h1::client::decode::{{closure}}
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-h1-1.0.2/src/client.rs:146
      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/future/mod.rs:80
      async_h1::client::connect::{{closure}}
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-h1-1.0.2/src/client.rs:62
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/future/mod.rs:80
      stacks_node::burnchains::bitcoin_regtest_controller::BitcoinRPCRequest::send::{{closure}}
             at src/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:1295
      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/future/mod.rs:80
      async_std::task::block_on::block_on::{{closure}}
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/block_on.rs:68
      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/future/mod.rs:80
   7: async_std::task::block_on::run::{{closure}}
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/block_on.rs:128
      std::thread::local::LocalKey<T>::try_with
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:272
      std::thread::local::LocalKey<T>::with
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:248
   8: async_std::task::block_on::run
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/block_on.rs:118
      async_std::task::block_on::block_on::{{closure}}
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/block_on.rs:72
      async_std::task::task::Task::set_current::{{closure}}
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/task.rs:129
      std::thread::local::LocalKey<T>::try_with
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:272
      std::thread::local::LocalKey<T>::with
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:248
   9: async_std::task::task::Task::set_current
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/task.rs:124
      async_std::task::block_on::block_on
             at usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/task/block_on.rs:72
  10: stacks_node::burnchains::bitcoin_regtest_controller::BitcoinRPCRequest::send
             at src/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:1284
  11: stacks_node::burnchains::bitcoin_regtest_controller::BitcoinRPCRequest::list_unspent
             at src/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:1174
  12: stacks_node::burnchains::bitcoin_regtest_controller::BitcoinRegtestController::get_utxos
             at src/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:450
  13: stacks_node::run_loop::neon::RunLoop::start
             at src/testnet/stacks-node/src/run_loop/neon.rs:116
  14: stacks_node::main
             at src/testnet/stacks-node/src/main.rs:146
  15: core::ops::function::FnOnce::call_once
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:227
      std::sys_common::backtrace::__rust_begin_short_backtrace
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:137
  16: std::rt::lang_start::{{closure}}
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/rt.rs:66
  17: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:259
      std::panicking::try::do_call
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
      std::panicking::try
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
      std::panic::catch_unwind
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
      std::rt::lang_start_internal
             at rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/rt.rs:51
  18: main

Dumping core for pid 1

Any idea if I did something wrong ?

Hi pierrer-gilles.

I edited a video with Jason that perhaps could help you. Be aware that it is with a Mac:

You can also go to the Discord channel. There is a section for mining. People is friendly and willing to help.

Thanks for sharing this video :slight_smile: I’ll have a look and see if I did something wrong.

I tried to join Discord but all links on Blockstacks website are expired. Do you have an invite link? :slight_smile:

I am quite new. I do not know how to do that. I will ask that. There is also a Telegram channel. Look for Blockstack. I think anyone can go there.

@pierrer-gilles @narcis ill pass that on! Here is the invite link to Discord :slight_smile: https://discord.gg/Gs9apyD

Thanks @stacksadmin ! Just joined Discord :slight_smile:

1 Like