You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,9 +8,9 @@ The following is an abridged version of the [walkthrough here](https://github.co
8
8
9
9
If you're interested in mining on the Stacks testnet, you can find instructions on how to do that here:
10
10
11
-
### Running a Bitcoin Testnet Full Node
11
+
### Running a Bitcoin Node for the Stacks Testnet
12
12
13
-
To participate as a miner on testnet, you must have access to a testnet bitcoin node with a wallet (and the wallet's private key). One way to accomplish this is to run bitcoin locally.
13
+
The Stacks testnet does not run on the public Bitcoin testnet - it uses a Bitcoin **regtest** network operated by Hiro (`bitcoin.regtest.hiro.so`). To participate as a miner, you must have access to a bitcoin node on that network with a wallet (and the wallet's private key). One way to accomplish this is to run bitcoin locally, peered with the Hiro regtest node.
14
14
15
15
*[Ensure your computer meets the minimum hardware requirements before continuing.](https://bitcoin.org/en/bitcoin-core/features/requirements#system-requirements)
16
16
@@ -31,7 +31,7 @@ Next, update the bitcoin configuration:
Note: It will take a few hours for the node to synchronize with Bitcoin Testnet.
63
+
Note: The testnet regtest chain is much smaller than the public Bitcoin testnet, so the node should synchronize within minutes.
63
64
{% endhint %}
64
65
65
-
While it's syncing, you can track the progress with `bitcoin-cli` or the logfile (will be located where the chainstate is stored, i.e. `/bitcoin/testnet3/debug.log`):
66
+
While it's syncing, you can track the progress with `bitcoin-cli` or the logfile (will be located where the chainstate is stored, i.e. `/bitcoin/regtest/debug.log`):
66
67
67
68
```bash
68
69
$ bitcoin-cli \
69
70
-rpcconnect=127.0.0.1 \
70
-
-rpcport=18332 \
71
+
-rpcport=18443 \
71
72
-rpcuser=btcuser \
72
73
-rpcpassword=btcpass \
73
74
getblockchaininfo | jq .blocks
74
-
2583513
75
+
7746
75
76
```
76
77
77
78
***
78
79
79
80
### Running a Stacks Blockchain miner
80
81
81
-
First, download the latest tagged [stacks blockchain binary](https://github.com/stacks-network/stacks-blockchain/releases/latest), or [build from source](https://github.com/stacksfoundation/miner-docs/blob/testnet/stacks-blockchain.md#build-and-install-stacks-blockchain-from-source) (_there may be some extra requirements to building,_[_defined here_](https://github.com/stacksfoundation/miner-docs/blob/testnet/prerequisites.md#install-required-packages)).
82
+
First, download the [`stacks-core` 4.0.2 binary](https://github.com/stacks-network/stacks-core/releases/tag/4.0.2), or [build from source](https://github.com/stacksfoundation/miner-docs/blob/testnet/stacks-blockchain.md#build-and-install-stacks-blockchain-from-source) (_there may be some extra requirements to building,_[_defined here_](https://github.com/stacksfoundation/miner-docs/blob/testnet/prerequisites.md#install-required-packages)).
82
83
83
84
{% hint style="info" %}
84
85
Tip: It is recommended to use a persistent location for the chainstate, in the steps below we're using `/stacks-blockchain`.
@@ -124,7 +125,7 @@ Next, a bitcoin wallet is created:
124
125
```bash
125
126
bitcoin-cli \
126
127
-rpcconnect=127.0.0.1 \
127
-
-rpcport=18332 \
128
+
-rpcport=18443 \
128
129
-rpcuser=btcuser \
129
130
-rpcpassword=btcpass \
130
131
-named createwallet \
@@ -146,7 +147,7 @@ First, convert the wif into its public descriptor:
146
147
```bash
147
148
bitcoin-cli \
148
149
-rpcconnect=127.0.0.1 \
149
-
-rpcport=18332 \
150
+
-rpcport=18443 \
150
151
-rpcuser=btcuser \
151
152
-rpcpassword=btcpass \
152
153
getdescriptorinfo "combo(<wif from JSON above>)"
@@ -157,7 +158,7 @@ Then import the `descriptor` value returned above into the `miner` wallet - past
157
158
```bash
158
159
bitcoin-cli \
159
160
-rpcconnect=127.0.0.1 \
160
-
-rpcport=18332 \
161
+
-rpcport=18443 \
161
162
-rpcuser=btcuser \
162
163
-rpcpassword=btcpass \
163
164
-rpcwallet=miner \
@@ -180,47 +181,76 @@ After the import has completed successfully, you can check that the address is i
180
181
```bash
181
182
bitcoin-cli \
182
183
-rpcconnect=127.0.0.1 \
183
-
-rpcport=18332 \
184
+
-rpcport=18443 \
184
185
-rpcuser=btcuser \
185
186
-rpcpassword=btcpass \
186
187
-rpcwallet=miner \
187
188
getaddressinfo <btcAddress from JSON above>
188
189
```
189
190
190
-
Once imported, we need to get some testnet BTC to that address. Grab the `btcAddress` field, and paste it into [this Bitcoin testnet faucet](https://tbtc.bitaps.com/). You'll be sent `0.01` testnet BTC to that address.
191
+
Once imported, we need to get some testnet BTC to that address. The public Bitcoin testnet faucets won't work here - the Stacks testnet runs on its own regtest network, so use the Hiro testnet BTC faucet with the `btcAddress` from the keychain step:
192
+
193
+
```bash
194
+
curl -X POST "https://api.testnet.hiro.so/extended/v1/faucets/btc?address=<btcAddress from JSON above>"
195
+
```
191
196
192
197
#### Update the Stacks Blockchain Configuration File
193
198
194
-
Now, we need to configure our node to use this Bitcoin keychain. Copy the [sample testnet miner config](https://raw.githubusercontent.com/stacks-network/stacks-blockchain/master/testnet/stacks-node/conf/testnet-miner-conf.toml) to your local machine in a memorable location like `$HOME/testnet-miner-conf.toml`.
199
+
Now, we need to configure our node to use this Bitcoin keychain. Copy the [sample testnet miner config](https://raw.githubusercontent.com/stacks-network/stacks-core/master/sample/conf/testnet-miner-conf.toml) to your local machine in a memorable location like `$HOME/testnet-miner-conf.toml`.
195
200
196
201
Next, update the stacks configuration:
197
202
198
203
* Optional, but recommended: Use a persistent directory to store the Stacks chainstate, i.e. `working_dir = "/stacks-blockchain"`
199
204
* From the `make_keychain` step, modify the `seed` value with `privatekey`
200
205
* Required: set `wallet_name` to the bitcoin wallet you created above (`miner`)
206
+
* Required: set `username` and `password` to match the `rpcuser` and `rpcpassword` from your bitcoin configuration
201
207
* Store the following configuration somewhere on your filesystem (ex: `$HOME/testnet-miner-conf.toml`)
The `[connection_options]` and `[[events_observer]]` sections connect the node to a Stacks signer: `auth_token` must match the signer's `auth_password`, and the events observer `endpoint` must match the signer's `endpoint`. See the [signer quickstart](../run-a-signer/signer-quickstart.md) for setting one up.
Now, we need to get some tBTC. Grab the `btcAddress` field, and paste it into [this Bitcoin testnet faucet](https://tbtc.bitaps.com/). You'll be sent `0.01` tBTC to that address.
400
+
Now, we need to get some tBTC. Grab the `btcAddress` field and request funds from the Hiro testnet BTC faucet:
401
+
402
+
```bash
403
+
curl -X POST "https://api.testnet.hiro.so/extended/v1/faucets/btc?address=<btcAddress from JSON above>"
0 commit comments