Signer Quickstart
1
Prerequisites
# Create the required directories
mkdir -p ~/stacks-signer/data
mkdir -p ~/stacks-node/data
# Install needed packages
sudo apt install -y npm wget unzip jq tar
# Install Stacks CLI globally
npm install --global @stacks/cli
# Generate a new account and store details in a file
stx make_keychain | jq > ~/stacks-signer/keychain.json# Create the required directories
mkdir -p ~/stacks-signer/data
mkdir -p ~/stacks-node/data
# Install needed packages
sudo apt install -y npm wget unzip jq tar
# Install Stacks CLI globally
npm install --global @stacks/cli
# Generate a new account and store details in a file
# '-t' option makes this a testnet account
stx make_keychain -t | jq > ~/stacks-signer/keychain.json{
"mnemonic": "aaa bbb ccc ddd ...",
"keyInfo": {
"privateKey": "65f3...",
"publicKey": "03a3...",
"address": "SP1G...",
"btcAddress": "19tg...",
"wif": "Kzdt...",
"index": 0
}
}2
Set Up Your Stacks Signer
# The CLI examples below may show outdated release versions.
# Enter the signer directory
cd ~/stacks-signer
# Download the signer binary zip
wget https://github.com/stacks-network/stacks-core/releases/latest/download/linux-glibc-x64.zip
# Unzip the signer binary archive
unzip linux-glibc-x64.zip# The CLI examples below may show outdated release versions.
# Set environment variables
AUTH_TOKEN=<your_token> # Used for signer-node authentication
PRIVATE_KEY=<your_private_key> # privateKey from Step 1, this is the signer's private key
# Create the signer's configuration file
cat <<EOF> ~/stacks-signer/signer-config.toml
node_host = "127.0.0.1:20443"
endpoint = "127.0.0.1:30000"
network = "mainnet"
db_path = "$HOME/stacks-signer/data/signer.sqlite"
auth_password = "$AUTH_TOKEN"
stacks_private_key = "$PRIVATE_KEY"
metrics_endpoint = "127.0.0.1:9154"
block_proposal_timeout_ms = 180000
tenure_idle_timeout_secs = 120
EOF# Set environment variables
AUTH_TOKEN=<your_token> # Used for signer-node authentication
PRIVATE_KEY=<your_private_key> # privateKey from Step 1, this is the signer's private key
# Create the signer's configuration file
cat <<EOF> ~/stacks-signer/signer-config.toml
node_host = "127.0.0.1:20443"
endpoint = "127.0.0.1:30000"
network = "testnet"
db_path = "$HOME/stacks-signer/data/signer.sqlite"
auth_password = "$AUTH_TOKEN"
stacks_private_key = "$PRIVATE_KEY"
metrics_endpoint = "127.0.0.1:9154"
block_proposal_timeout_ms = 180000
EOF# The CLI examples below may show outdated release versions.
# Verify the signer's version
~/stacks-signer/stacks-signer --version
# Output:
stacks-signer stacks-signer signer-3.1.0.0.5.0 (release/signer-3.1.0.0.5.0:513dbc5, release build, linux [x86_64])
# Verify the config file
~/stacks-signer/stacks-signer check-config -c ~/stacks-signer/signer-config.toml
# Output:
Config:
Stacks node host: 127.0.0.1:20443
Signer endpoint: 127.0.0.1:30000
Stacks address: SP1G... # address from keychain file
Public key: 03a3... # publicKey from keychain file
Network: mainnet # or testnet
Chain ID: 0x1 # or 0x80000000 for testnet
Database path: /home/admin/stacks-signer/data/signer.sqlite
Metrics endpoint: 127.0.0.1:9154~/stacks-signer/stacks-signer run -c ~/stacks-signer/signer-config.toml4
Set Up Your Stacks Node
# The CLI examples below may show outdated release versions.
# Enter the node directory
cd ~/stacks-node
# Download the node binary zip
wget https://github.com/stacks-network/stacks-core/releases/latest/download/linux-glibc-x64.zip
# Unzip the node binary archive
unzip linux-glibc-x64.zip# The CLI examples below may show outdated release versions.
# Set environment variables
AUTH_TOKEN=<your_token> # Used for signer-node authentication, same token as the one set up in the signer configuration
# Create the node's configuration file
cat <<EOF> ~/stacks-node/node-config.toml
[node]
working_dir = "$HOME/stacks-node/data"
rpc_bind = "127.0.0.1:20443"
p2p_bind = "0.0.0.0:20444"
prometheus_bind = "127.0.0.1:9153"
bootstrap_node = "02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444,02539449ad94e6e6392d8c1deb2b4e61f80ae2a18964349bc14336d8b903c46a8c@cet.stacksnodes.org:20444,02ececc8ce79b8adf813f13a0255f8ae58d4357309ba0cedd523d9f1a306fcfb79@sgt.stacksnodes.org:20444,0303144ba518fe7a0fb56a8a7d488f950307a4330f146e1e1458fc63fb33defe96@est.stacksnodes.org:20444"
stacker = true
[burnchain]
chain = "bitcoin"
mode = "mainnet"
peer_host = "bitcoin.mainnet.stacks.org"
[connection_options]
auth_token = "$AUTH_TOKEN"
[[events_observer]]
endpoint = "127.0.0.1:30000"
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
EOF# The CLI examples below may show outdated release versions.
# Verify the node's version
~/stacks-node/stacks-node version
# Output:
INFO [1738695915.769633] [testnet/stacks-node/src/main.rs:278] [main] stacks-node 3.1.0.0.5 (release/3.1.0.0.5:513dbc5, release build, linux [x86_64])
stacks-node 3.1.0.0.5 (release/3.1.0.0.5:513dbc5, release build, linux [x86_64])
# Verify the node's config
~/stacks-node/stacks-node check-config --config ~/stacks-node/node-config.toml
# Output:
INFO [1738695915.769633] [testnet/stacks-node/src/main.rs:278] [main] stacks-node 3.1.0.0.5 (release/3.1.0.0.5:513dbc5, release build, linux [x86_64])
INFO [1729788064.913175] [testnet/stacks-node/src/main.rs:318] [main] Loading config at path /home/admin/stacks-node/node-config.toml
INFO [1729788064.969551] [testnet/stacks-node/src/main.rs:331] [main] Loaded config!~/stacks-node/stacks-node start --config ~/stacks-node/node-config.toml5
Generate your signer signature
~/stacks-signer/stacks-signer generate-stacking-signature \
--method stack-stx \
--max-amount 1000000000000 \
--auth-id 195591226970828652622091037492597751808 \
--period 12 \
--reward-cycle 100 \
--pox-address 19tg... \
--config ~/stacks-signer/signer-config.toml \
--jsonLast updated
Was this helpful?