Running a testnet node

Learn how to set up and run a testnet node.
15 minutes


This tutorial will walk you through the following steps:

  • Download and install the node software
  • Run the node
  • Mine Stacks token


Note: If you use Linux, you may need to manually install libssl-dev and other packages. In your command line, run the following to get all packages:

sudo apt-get install build-essential cmake libssl-dev pkg-configsudo apt-get install build-essential cmake libssl-dev pkg-config

Ensure that you have Rust installed. If you are using macOS, Linux, or another Unix-like OS, run the following. If you are on a different OS, follow the official Rust installation guide.

curl --proto '=https' --tlsv1.2 -sSf | sh -s -- -ycurl --proto '=https' --tlsv1.2 -sSf | sh -s -- -y

In case you just installed Rust, you will be prompted to run the following command to make the cargo command available:

source $HOME/.cargo/envsource $HOME/.cargo/env

Step 1: Installing the node

Next, clone this repository:

git clone cd stacks-blockchaingit clone stacks-blockchain

Install the Stacks node by running:

cargo install --path ./testnet/stacks-nodecargo install --path ./testnet/stacks-node

Step 2: Running the node

You're all set to run a node that connects to the testnet network.

Back in the command line, run:

stacks-node kryptonstacks-node krypton

The first time you run this, you'll see some logs indicating that the Rust code is being compiled. Once that's done, you should see some logs that look something like the this:

INFO [1588108047.585] [src/chainstate/stacks/index/] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206INFO [1588108047.585] [src/chainstate/stacks/index/] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206

Awesome! Your node is now connected to the testnet network. Your node will receive new blocks when they are produced, and you can use your node's RPC API to send transactions, fetch information for contracts and accounts, and more.

Step 3: Mining Stacks token

Now that you have a running testnet node, you can easily set up a miner.

Graphic for: Mine Stacks tokens
Mine Stacks tokens
Set up and run a miner on the Stacks 2.0 testnet
Sending tokens
Stacks 1.0 Info