Skip to content

Commit 602d11c

Browse files
werner-stacksgitbook-bot
authored andcommitted
GITBOOK: Signer Quickstart: Docker tabs and reference deep links
1 parent 8710354 commit 602d11c

1 file changed

Lines changed: 95 additions & 10 deletions

File tree

‎docs/operate/run-a-signer/signer-quickstart.md‎

Lines changed: 95 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ From this file, you'll need the `privateKey` value.
8282
{% step %}
8383
#### Set Up Your Stacks Signer
8484

85-
**Download the stacks-signer binary**
85+
**Get the stacks-signer**
8686

87+
{% tabs %}
88+
{% tab title="Binary" %}
8789
Download the [latest signer release ZIP file](https://github.com/stacks-network/stacks-core/releases/latest) for your server's architecture and decompress it. Inside that folder is a `stacks-signer` binary.
8890

89-
Assuming a `Linux x64 glibc` machine, the commands to download and uncompress the signer binary look like this:
91+
Assuming a `Linux x64 glibc` machine:
9092

9193
```bash
9294
# Enter the signer directory
@@ -98,6 +100,19 @@ wget https://github.com/stacks-network/stacks-core/releases/latest/download/linu
98100
# Unzip the signer binary archive
99101
unzip linux-glibc-x64.zip
100102
```
103+
{% endtab %}
104+
105+
{% tab title="Docker" %}
106+
Pull the image, pinned by digest so the same bytes land on every architecture:
107+
108+
```bash
109+
IMG="ghcr.io/stacks-network/stacks-signer"
110+
VER="4.0.1@sha256:815b5518ec0f3a9b4c30d7fdca8f048a1fe8c263790ca65c5785e119b87d8590"
111+
112+
docker pull $IMG:$VER
113+
```
114+
{% endtab %}
115+
{% endtabs %}
101116

102117
**Create the configuration file**
103118

@@ -120,8 +135,6 @@ db_path = "$HOME/stacks-signer/data/signer.sqlite"
120135
auth_password = "$AUTH_TOKEN"
121136
stacks_private_key = "$PRIVATE_KEY"
122137
metrics_endpoint = "127.0.0.1:9154"
123-
block_proposal_timeout_ms = 180000
124-
tenure_idle_timeout_secs = 120
125138
EOF
126139
```
127140
{% endcode %}
@@ -143,13 +156,23 @@ db_path = "$HOME/stacks-signer/data/signer.sqlite"
143156
auth_password = "$AUTH_TOKEN"
144157
stacks_private_key = "$PRIVATE_KEY"
145158
metrics_endpoint = "127.0.0.1:9154"
146-
block_proposal_timeout_ms = 180000
147159
EOF
148160
```
149161
{% endcode %}
150162
{% endtab %}
151163
{% endtabs %}
152164
165+
{% hint style="info" %}
166+
**Running under Docker?** Some values change, because the signer and the node sit in separate containers rather than on one loopback interface:
167+
168+
```toml
169+
node_host = "stacks-node:20443" # the node container's name
170+
endpoint = "0.0.0.0:30000" # so the node container can reach the signer
171+
db_path = "/var/stacks/signer.sqlite" # inside the mounted volume
172+
metrics_endpoint = "0.0.0.0:9154"
173+
```
174+
{% endhint %}
175+
153176
**Verify the setup**
154177
155178
Check the version and the config file:
@@ -174,7 +197,7 @@ Stacks address: SP1G... # address from keychain file
174197
Public key: 03a3... # publicKey from keychain file
175198
Network: mainnet # or testnet
176199
Chain ID: 0x1 # or 0x80000000 for testnet
177-
Database path: /home/admin/stacks-signer/data/signer.sqlite
200+
Database path: /home/user/stacks-signer/data/signer.sqlite
178201
Metrics endpoint: 127.0.0.1:9154
179202
Dry run: false
180203
```
@@ -183,9 +206,31 @@ Dry run: false
183206
184207
If the output is correct, start the signer:
185208
209+
{% tabs %}
210+
{% tab title="Binary" %}
186211
```bash
187212
~/stacks-signer/stacks-signer run -c ~/stacks-signer/signer-config.toml
188213
```
214+
{% endtab %}
215+
216+
{% tab title="Docker" %}
217+
```bash
218+
docker run -d \
219+
--restart unless-stopped \
220+
--name stacks-signer \
221+
-v ~/stacks-signer/signer-config.toml:/config.toml \
222+
-v ~/stacks-signer/data:/var/stacks \
223+
-p 30000:30000 \
224+
-e RUST_BACKTRACE=full \
225+
$IMG:$VER \
226+
stacks-signer run --config /config.toml
227+
```
228+
229+
The port you set as `endpoint` has to reach your Stacks node and nothing else, and the volume holding `db_path` needs a few GB free.
230+
231+
On a host that is not x64, add `--platform=linux/amd64`, or the run fails with a manifest or platform mismatch.
232+
{% endtab %}
233+
{% endtabs %}
189234
{% endstep %}
190235
191236
{% step %}
@@ -199,11 +244,13 @@ We have created guides for running both a [full Bitcoin node](../run-a-node/run-
199244
{% step %}
200245
#### Set Up Your Stacks Node
201246
202-
**Download the stacks-node binary**
247+
**Get the stacks-node**
203248
249+
{% tabs %}
250+
{% tab title="Binary" %}
204251
Download the [latest node release ZIP file](https://github.com/stacks-network/stacks-core/releases/latest) for your server's architecture and decompress it. Inside that folder is a `stacks-node` binary.
205252
206-
Assuming a `Linux x64 glibc` machine, the commands to download and uncompress the node binary look like this:
253+
Assuming a `Linux x64 glibc` machine:
207254
208255
```bash
209256
# Enter the node directory
@@ -215,6 +262,17 @@ wget https://github.com/stacks-network/stacks-core/releases/latest/download/linu
215262
# Unzip the node binary archive
216263
unzip linux-glibc-x64.zip
217264
```
265+
{% endtab %}
266+
267+
{% tab title="Docker" %}
268+
```bash
269+
NODE_IMG="ghcr.io/stacks-network/stacks-core"
270+
NODE_VER="4.0.1@sha256:ceb768f881ef52a1d2792a2b4a89d81e092b1df11293b04c31ce36613c3f9711"
271+
272+
docker pull $NODE_IMG:$NODE_VER
273+
```
274+
{% endtab %}
275+
{% endtabs %}
218276
219277
**Create the configuration file**
220278
@@ -255,6 +313,8 @@ events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
255313
EOF
256314
```
257315
{% endcode %}
316+
317+
Based on the [mainnet follower example](https://docs.stacks.co/reference/node-operations/readme-1#example-mainnet-follower-configuration), with `stacker`, the auth token and the events observer added so the node can serve a signer.
258318
{% endtab %}
259319
260320
{% tab title="Testnet" %}
@@ -401,6 +461,8 @@ start_height = 2702
401461
EOF
402462
```
403463
{% endcode %}
464+
465+
Based on the [Stacks node testnet config](https://docs.stacks.co/reference/node-operations/signer-configuration#stacks-node-testnet-config), which is the follower config plus the fields a node serving a signer needs.
404466
{% endtab %}
405467
{% endtabs %}
406468
@@ -459,17 +521,40 @@ stacks-node 4.0.1 (62e03cc, release build, linux [x86_64])
459521
460522
# Output:
461523
INFO [1786366428.987308] [stacks-node/src/main.rs:329] [main] stacks-node 4.0.1 (62e03cc, release build, linux [x86_64])
462-
INFO [1786366428.987352] [stacks-node/src/main.rs:359] [main] Loading config at path /home/admin/stacks-node/node-config.toml
524+
INFO [1786366428.987352] [stacks-node/src/main.rs:359] [main] Loading config at path /home/user/stacks-node/node-config.toml
463525
INFO [1786366429.090617] [stacks-node/src/main.rs:372] [main] Loaded config!
464526
```
465527
466528
**Start the node**
467529
468-
If the output is correct, start the node:
530+
Start the signer first. The node will not run unless it can reach the endpoint it is configured to send events to.
469531
532+
{% tabs %}
533+
{% tab title="Binary" %}
470534
```bash
471535
~/stacks-node/stacks-node start --config ~/stacks-node/node-config.toml
472536
```
537+
{% endtab %}
538+
539+
{% tab title="Docker" %}
540+
```bash
541+
docker run -d \
542+
--restart unless-stopped \
543+
--name stacks-node \
544+
-v ~/stacks-node/node-config.toml:/config.toml \
545+
-v ~/stacks-node/data:/root/stacks-node/data \
546+
-p 20443:20443 \
547+
-p 20444:20444 \
548+
-e RUST_BACKTRACE=full \
549+
$NODE_IMG:$NODE_VER \
550+
stacks-node start --config /config.toml
551+
```
552+
553+
Expose `p2p_bind` to the internet and keep `rpc_bind` reachable only by your signer. `working_dir` needs 500 GB to 1 TB.
554+
555+
In Docker's default bridge network, `localhost` inside a container is that container, not the host, so `events_observer.endpoint` has to name the signer container rather than `127.0.0.1`. Connection refused errors here almost always mean that.
556+
{% endtab %}
557+
{% endtabs %}
473558
{% endstep %}
474559
475560
{% step %}

0 commit comments

Comments
 (0)