How to sync a Stacks node
Learn how to sync a Stacks node for running a local devnet or mainnet.
Running a Stacks node is crucial for developers aiming to interact directly with the Stacks blockchain. It allows for the verification of transactions, ensures decentralized operations, and enhances blockchain security.
What you'll learn
Clone the Stacks blockchain Docker repository
Clone the Stacks blockchain Docker repository from GitHub:
$git clone git@github.com:hirosystems/stacks-blockchain-docker.git$cd stacks-blockchain-docker
Start the service
Inside of the stacks-blockchain-docker
directory, run the following command to start the Stacks node:
$chmod +x manage.sh$./manage.sh -n <network> -a start
The <network>
placeholder used below can be replaced with one of:
mainnet
testnet
mocknet
Monitor the node's synchronization process
To follow the logs for the Stacks node, run the following command:
$./manage.sh -n <network> -a logs
For networks other than mocknet
, downloading the initial headers can take several minutes. Until the headers are downloaded, the /v2/info
endpoints won't return any data.