First, build stacks-node
:
cd testnet/stacks-node
cargo build --features monitoring_prom,slog_json --release
# if build is successful, stacks-node is in stacks-blockchain/target/release/
Then, make sure you have the chainstate. A snapshot can be downloaded from the Hiro Archiver.
Setup the config file in stacks-node/config/mainnet/Config.toml.
- Set the appropriate working directory:
[node] working_dir = "/path/to/stacks-node/data"
- Setup the connection to the Bitcoin node
[burnchain] chain = "bitcoin" mode = "mainnet" peer_host = "1.2.3.4" username = "username" password = "password" rpc_port = 8332 peer_port = 8333
- Set the flags to enable mock mining, under
[node]
:miner = true mock_mining = true
Run the mock-miner (with output teed to mock.out):
/path/to/stacks-blockchain/target/release/stacks-node start --config=/path/to/stacks-node/config/mainnet/Config.toml 2>&1 | tee mock.out
Optionally, prefix the above command with STACKS_LOG_DEBUG=1
to enable more logging.