Setting Up a Primary Post Nakamoto Testnet Node
Setup A Stacks Primary Testnet Node
Automated Bash Script
STACKS_DIR="${HOME}/nakamoto-testnet"
STACKS_RPC_PORT="40443"
STACKS_P2P_PORT="40444"
IMG="blockstack/stacks-core"
VER="3.1.0.0.5"
STX_NODE_CONFIG="${STACKS_DIR}/Config.toml"
mkdir -p ${STACKS_DIR}/data
curl -# <https://archive.hiro.so/testnet/stacks-blockchain/testnet-stacks-blockchain-latest.tar.gz> -o ${STACKS_DIR}/data/testnet-stacks-blockchain-latest.tar.gz
tar -xzvf ${STACKS_DIR}/data/testnet-stacks-blockchain-latest.tar.gz -C ${STACKS_DIR}/data/
cat <<EOF> ${STX_NODE_CONFIG}
[node]
working_dir = "/stacks-blockchain/data"
rpc_bind = "0.0.0.0:20443"
p2p_bind = "0.0.0.0:20444"
bootstrap_node = "029266faff4c8e0ca4f934f34996a96af481df94a89b0c9bd515f3536a95682ddc@seed.testnet.hiro.so:30444"
prometheus_bind = "0.0.0.0:9153"
stacker = true
[burnchain]
chain = "bitcoin"
mode = "krypton"
peer_host = "bitcoin.regtest.hiro.so"
peer_port = 18444
pox_prepare_length = 100
pox_reward_length = 900
# Set your auth token, which the signer uses
# This should match the auth_password field of your signer config
[connection_options]
auth_token = "12345"
[[events_observer]]
endpoint = "0.0.0.0.0:30000"
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
[[ustx_balance]]
address = "ST2QKZ4FKHAH1NQKYKYAYZPY440FEPK7GZ1R5HBP2"
amount = 10000000000000000
[[ustx_balance]]
address = "ST319CF5WV77KYR1H3GT0GZ7B8Q4AQPY42ETP1VPF"
amount = 10000000000000000
[[ustx_balance]]
address = "ST221Z6TDTC5E0BYR2V624Q2ST6R0Q71T78WTAX6H"
amount = 10000000000000000
[[ustx_balance]]
address = "ST2TFVBMRPS5SSNP98DQKQ5JNB2B6NZM91C4K3P7B"
amount = 10000000000000000
[fee_estimation]
fee_estimator = "fuzzed_weighted_median_fee_rate"
[[burnchain.epochs]]
epoch_name = "1.0"
start_height = 0
[[burnchain.epochs]]
epoch_name = "2.0"
start_height = 0
[[burnchain.epochs]]
epoch_name = "2.05"
start_height = 1
[[burnchain.epochs]]
epoch_name = "2.1"
start_height = 2
[[burnchain.epochs]]
epoch_name = "2.2"
start_height = 3
[[burnchain.epochs]]
epoch_name = "2.3"
start_height = 4
[[burnchain.epochs]]
epoch_name = "2.4"
start_height = 5
[[burnchain.epochs]]
epoch_name = "2.5"
start_height = 6
[[burnchain.epochs]]
epoch_name = "3.0"
start_height = 1_900
[[burnchain.epochs]]
epoch_name = "3.1"
start_height = 2_000
[[burnchain.epochs]]
epoch_name = "3.2"
start_height = 71_525
EOF
docker run -d \\
-v ${STX_NODE_CONFIG}:/config.toml \\
-v ${STACKS_DIR}/data:/stacks-blockchain/data \\
-p ${STACKS_RPC_PORT}:20443 \\
-p ${STACKS_P2P_PORT}:20444 \\
-e RUST_BACKTRACE=full \\
--name stacks-node \\
$IMG:$VER \\
stacks-node start --config /config.tomlManual Setup
Was this helpful?