mirror of https://github.com/lukechilds/docs.git
CharlieC3
4 years ago
committed by
Charlie
10 changed files with 712 additions and 46 deletions
After Width: | Height: | Size: 755 B |
After Width: | Height: | Size: 538 B |
@ -0,0 +1,367 @@ |
|||
--- |
|||
title: Mine mainnet Stacks tokens |
|||
description: Set up and run a miner on the Stacks 2.0 mainnet |
|||
icon: MainnetIcon |
|||
experience: beginners |
|||
duration: 10 minutes |
|||
tags: |
|||
- tutorial |
|||
images: |
|||
large: /images/pages/start-mining.svg |
|||
sm: /images/pages/start-mining-sm.svg |
|||
--- |
|||
|
|||
## Introduction |
|||
|
|||
Make sure you've followed the [Running mainnet node](/understand-stacks/running-mainnet-node) tutorial. Once completed it's only a few more steps to run a proof-of-burn miner on the mainnet. |
|||
|
|||
[@page-reference | inline] |
|||
| /understand-stacks/running-mainnet-node |
|||
|
|||
If you're interested in mining on the testnet, you can find instructions on how to do that here: |
|||
|
|||
[@page-reference | inline] |
|||
| /start-mining/testnet |
|||
|
|||
If you want to learn more about the technical details of mining, please review the mining guide: |
|||
|
|||
[@page-reference | inline] |
|||
| /understand-stacks/mining |
|||
|
|||
## Running bitcoind locally |
|||
|
|||
To participate as a miner on mainnet, you must have access to a mainnet bitcoin node. One way to accomplish this is to run bitcoind locally. [Ensure your computer meets the minimum hardware requirements before continuing.](https://bitcoin.org/en/bitcoin-core/features/requirements) |
|||
|
|||
First, download the bitcoind software for your platform from https://bitcoin.org/en/download. |
|||
|
|||
Next, start bitcoind with the following configuration: |
|||
|
|||
``` |
|||
server=1 |
|||
rpcuser=your-bitcoind-username |
|||
rpcpassword=your-bitcoind-password |
|||
txindex=0 |
|||
listen=1 |
|||
rpcserialversion=0 |
|||
maxorphantx=1 |
|||
banscore=1 |
|||
bind=0.0.0.0:8333 |
|||
rpcbind=0.0.0.0:8332 |
|||
rpcport=8332 |
|||
``` |
|||
|
|||
Finally, start bitcoind as follows: |
|||
|
|||
```bash |
|||
bitcoind -conf=path/to/bitcoin.conf |
|||
``` |
|||
|
|||
It may take a few days for the node to synchronize with the Bitcoin mainnet. |
|||
|
|||
## Running a miner |
|||
|
|||
First, a keychain needs to be generated. With this keychain, we'll purchase some BTC from a crytpocurrency exchange, and then use that BTC to start mining. |
|||
|
|||
To get a keychain, the simplest way is to use the `stacks-cli`. We'll use the `make_keychain` command. |
|||
|
|||
```bash |
|||
npx @stacks/cli make_keychain 2>/dev/null |
|||
``` |
|||
|
|||
After this runs, you'll probably see some installation logs, and at the end you should see some JSON that looks like this: |
|||
|
|||
```json |
|||
{ |
|||
"mnemonic": "exhaust spin topic distance hole december impulse gate century absent breeze ostrich armed clerk oak peace want scrap auction sniff cradle siren blur blur", |
|||
"keyInfo": { |
|||
"privateKey": "2033269b55026ff2eddaf06d2e56938f7fd8e9d697af8fe0f857bb5962894d5801", |
|||
"address": "STTX57EGWW058FZ6WG3WS2YRBQ8HDFGBKEFBNXTF", |
|||
"btcAddress": "mkRYR7KkPB1wjxNjVz3HByqAvVz8c4B6ND", |
|||
"index": 0 |
|||
} |
|||
} |
|||
``` |
|||
|
|||
**Don't lose this information** - we'll need to use the `privateKey` field later on. |
|||
|
|||
The above BTC address will then need to be imported into the BTC network. |
|||
|
|||
```bash |
|||
bitcoin-cli -rpcport=8332 -rpcuser=your-user -rpcpassword=your-password importaddress <btcAddress from JSON above> |
|||
``` |
|||
|
|||
Once imported, we need to get some BTC to that address. You should be able to transfer BTC to this address using a crytpocurrency exchange such as [Coinbase](https://www.coinbase.com), [Binance](https://www.binance.com), or [Kraken](https://www.kraken.com). |
|||
|
|||
Now, we need to configure our node to use this Bitcoin keychain. In the `stacks-blockchain` folder, create a new file called `mainnet-miner-conf.toml`. |
|||
|
|||
Paste in the following configuration: |
|||
|
|||
```toml |
|||
[node] |
|||
rpc_bind = "0.0.0.0:20443" |
|||
p2p_bind = "0.0.0.0:20444" |
|||
# Enter your private key here |
|||
seed = "replace-with-your-private-key" |
|||
miner = true |
|||
|
|||
[burnchain] |
|||
chain = "bitcoin" |
|||
mode = "mainnet" |
|||
# peer_host should point to your local bitcoind node |
|||
peer_host = "127.0.0.1" |
|||
username = "your-bitcoind-username" |
|||
password = "your-bitcoind-password" |
|||
rpc_port = 8332 |
|||
peer_port = 8333 |
|||
``` |
|||
|
|||
Now, grab your `privateKey` from earlier, when you ran the `make_keychain` command. Replace the `seed` field with your private key. Save and close this configuration file. |
|||
|
|||
To run your miner, run this in the command line: |
|||
|
|||
```bash |
|||
stacks-node start --config=./mainnet-miner-conf.toml |
|||
``` |
|||
|
|||
Your node should start. It will take some time to sync, and then your miner will be running. |
|||
|
|||
### Creating an optimized binary |
|||
|
|||
The steps above are great for trying to run a node temporarily. If you want to host a node on a server somewhere, you might want to generate an optimized binary. To do so, use the same configuration as above, but run: |
|||
|
|||
```bash |
|||
cd testnet/stacks-node |
|||
cargo build --release --bin stacks-node |
|||
``` |
|||
|
|||
The above code will compile an optimized binary. To use it, run: |
|||
|
|||
```bash |
|||
cd ../.. |
|||
./target/release/stacks-node start --config=./mainnet-miner-conf.toml |
|||
``` |
|||
|
|||
For a full reference of subcommands and configuration options used by `stacks-node`, please see this page. |
|||
|
|||
[@page-reference | inline] |
|||
| /references/stacks-node-configuration |
|||
|
|||
To read more about the technical details of mining on the Stacks 2.0 network, have a look at the minig guide: |
|||
|
|||
[@page-reference | inline] |
|||
| /understand-stacks/mining |
|||
|
|||
### Enable debug logging |
|||
|
|||
In case you are running into issues or would like to see verbose logging, you can run your node with debug logging enabled. In the command line, run: |
|||
|
|||
```bash |
|||
BLOCKSTACK_DEBUG=1 stacks-node mainnet |
|||
``` |
|||
|
|||
## Running a miner in Windows |
|||
|
|||
### Prerequisites |
|||
|
|||
Make sure you've followed the [Running the mainnet node on Windows](/understand-stacks/running-mainnet-node#running-the-mainnet-node-on-windows) tutorial and [Running itcoind locally](#running-bitcoind-locally) section above before starting this tutorial. |
|||
|
|||
### Generate keychain and get mainnet tokens in Windows |
|||
|
|||
To setup the miner, first we need to generate a keychain. With this keychain, we'll purchase some BTC from a crytpocurrency exchange, and then use that BTC to start mining. |
|||
|
|||
To get a keychain, the simplest way is to use the `stacks-cli`. We'll use the `stx make-keychain` command. |
|||
|
|||
Generate a keychain: |
|||
|
|||
```bash |
|||
npm install --global @stacks/cli |
|||
stx make_keychain > cli_keychain.json |
|||
type cli_keychain.json |
|||
``` |
|||
|
|||
After this runs, you'll probably see some installation logs, and at the end you should see some JSON that looks like this: |
|||
|
|||
```json |
|||
{ |
|||
"mnemonic": "exhaust spin topic distance hole december impulse gate century absent breeze ostrich armed clerk oak peace want scrap auction sniff cradle siren blur blur", |
|||
"keyInfo": { |
|||
"privateKey": "2033269b55026ff2eddaf06d2e56938f7fd8e9d697af8fe0f857bb5962894d5801", |
|||
"address": "STTX57EGWW058FZ6WG3WS2YRBQ8HDFGBKEFBNXTF", |
|||
"btcAddress": "mkRYR7KkPB1wjxNjVz3HByqAvVz8c4B6ND", |
|||
"index": 0 |
|||
} |
|||
} |
|||
``` |
|||
|
|||
-> Check out the [Stacks CLI reference](/references/stacks-cli) for more details |
|||
|
|||
The above BTC address will then need to be imported into the BTC network. |
|||
|
|||
```bash |
|||
bitcoin-cli -rpcport=8332 -rpcuser=your-user -rpcpassword=your-password importaddress <btcAddress from JSON above> |
|||
``` |
|||
|
|||
Once imported, we need to get some BTC to that address. You should be able to transfer BTC to this address using a crytpocurrency exchange such as [Coinbase](https://www.coinbase.com), [Binance](https://www.binance.com), or [Kraken](https://www.kraken.com). |
|||
|
|||
### Create configuration file |
|||
|
|||
Now, we need to configure our node to use this Bitcoin keychain. In the **folder where your binary is extracted**, create a new file called `mainnet-miner-conf.toml`. |
|||
|
|||
Paste in the following configuration: |
|||
|
|||
```toml |
|||
[node] |
|||
rpc_bind = "0.0.0.0:20443" |
|||
p2p_bind = "0.0.0.0:20444" |
|||
# Enter your private key here |
|||
seed = "replace-with-your-private-key" |
|||
miner = true |
|||
|
|||
[burnchain] |
|||
chain = "bitcoin" |
|||
mode = "mainnet" |
|||
# peer_host should point to your local bitcoind node |
|||
peer_host = "127.0.0.1" |
|||
username = "your-bitcoind-username" |
|||
password = "your-bitcoind-password" |
|||
rpc_port = 8332 |
|||
peer_port = 8333 |
|||
``` |
|||
|
|||
Now, grab your `privateKey` from earlier, when you ran the `stx make_keychain` command. Replace the seed field with your private key. Save and close this configuration file. |
|||
|
|||
### Run the miner |
|||
|
|||
To start your miner, run this in the command line: |
|||
|
|||
```bash |
|||
stacks-node start --config=mainnet-miner-conf.toml |
|||
``` |
|||
|
|||
-> **Note** : While starting the node for the first time, windows defender might pop up with a message to allow access. If so, allow access to run the node. |
|||
![Windows Defender](/images/windows-defender.png) |
|||
|
|||
Your node should start. It will take some time to sync, and then your miner will be running. |
|||
|
|||
### Enable debug logging in Windows |
|||
|
|||
In case you are running into issues or would like to see verbose logging, you can run your node with debug logging enabled. In the command line, run: |
|||
|
|||
```bash |
|||
set RUST_BACKTRACE=full; |
|||
set BLOCKSTACK_DEBUG=1; |
|||
stacks-node start --config=mainnet-miner-conf.toml |
|||
``` |
|||
|
|||
## Optional: Running with Docker |
|||
|
|||
Alternatively, you can run the mainnet node with Docker. |
|||
|
|||
-> Ensure you have [Docker](https://docs.docker.com/get-docker/) installed on your machine. |
|||
|
|||
### Generate keychain and get tokens |
|||
|
|||
Generate a keychain: |
|||
|
|||
```bash |
|||
docker run -i node:14-alpine npx @stacks/cli make_keychain 2>/dev/null |
|||
``` |
|||
|
|||
We need to get some BTC to that address. You should be able to transfer BTC to this address using a crytpocurrency exchange such as [Coinbase](https://www.coinbase.com), [Binance](https://www.binance.com), or [Kraken](https://www.kraken.com). |
|||
|
|||
### Create a config file directory |
|||
|
|||
You need a dedicated directory to keep the config files: |
|||
|
|||
```bash |
|||
mkdir -p $HOME/stacks |
|||
``` |
|||
|
|||
### Create config file |
|||
|
|||
Inside the new `$HOME/stacks` folder, you should create a new miner config `Config.toml`: |
|||
|
|||
```toml |
|||
[node] |
|||
rpc_bind = "0.0.0.0:20443" |
|||
p2p_bind = "0.0.0.0:20444" |
|||
# Enter your private key here |
|||
seed = "replace-with-your-private-key" |
|||
miner = true |
|||
|
|||
[burnchain] |
|||
chain = "bitcoin" |
|||
mode = "mainnet" |
|||
# peer_host should point to your local bitcoind node |
|||
peer_host = "127.0.0.1" |
|||
username = "your-bitcoind-username" |
|||
password = "your-bitcoind-password" |
|||
rpc_port = 8332 |
|||
peer_port = 8333 |
|||
``` |
|||
|
|||
### Start the miner |
|||
|
|||
-> The ENV VARS `RUST_BACKTRACE` and `BLOCKSTACK_DEBUG` are optional. If removed, debug logs will be disabled |
|||
|
|||
```bash |
|||
docker run -d \ |
|||
--name stacks_miner \ |
|||
--rm \ |
|||
--network host \ |
|||
-e RUST_BACKTRACE="full" \ |
|||
-e BLOCKSTACK_DEBUG="1" \ |
|||
-v "$HOME/stacks/Config.toml:/src/stacks-node/Config.toml" \ |
|||
-p 20443:20443 \ |
|||
-p 20444:20444 \ |
|||
blockstack/stacks-blockchain:latest \ |
|||
/bin/stacks-node start --config /src/stacks-node/Config.toml |
|||
``` |
|||
|
|||
You can review the node logs with this command: |
|||
|
|||
```bash |
|||
docker logs -f stacks_miner |
|||
``` |
|||
|
|||
## Optional: Running in Kubernetes with Helm |
|||
|
|||
In addition, you're also able to run a mainnet node in a Kubernetes cluster using the [stacks-blockchain Helm chart](https://github.com/blockstack/stacks-blockchain/tree/master/deployment/helm/stacks-blockchain). |
|||
|
|||
Ensure you have the following prerequisites installed on your machine: |
|||
|
|||
- [Docker](https://docs.docker.com/get-docker/) |
|||
- [minikube](https://minikube.sigs.k8s.io/docs/start/) (Only needed if standing up a local Kubernetes cluster) |
|||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) |
|||
- [helm](https://helm.sh/docs/intro/install/) |
|||
|
|||
### Generate keychain and get some tokens |
|||
|
|||
Generate a keychain: |
|||
|
|||
```bash |
|||
docker run -i node:14-alpine npx @stacks/cli make_keychain 2>/dev/null |
|||
``` |
|||
|
|||
We need to get some BTC to that address. You should be able to transfer BTC to this address using a crytpocurrency exchange such as [Coinbase](https://www.coinbase.com), [Binance](https://www.binance.com), or [Kraken](https://www.kraken.com). |
|||
|
|||
### Install the chart and run the miner |
|||
|
|||
To install the chart with the release name `my-release` and run the node as a miner: |
|||
|
|||
```bash |
|||
minikube start # Only run this if standing up a local Kubernetes cluster |
|||
helm repo add blockstack https://charts.blockstack.xyz |
|||
helm install my-release blockstack/stacks-blockchain \ |
|||
--set config.node.miner=true \ |
|||
--set config.node.seed="replace-with-your-privateKey-from-generate-keychain-step" \ |
|||
--set config.burnchain.mode="mainnet" |
|||
``` |
|||
|
|||
You can review the node logs with this command: |
|||
|
|||
```bash |
|||
kubectl logs -l app.kubernetes.io/name=stacks-blockchain |
|||
``` |
|||
|
|||
For more information on the Helm chart and configuration options, please refer to the [chart's homepage](https://github.com/blockstack/stacks-blockchain/tree/master/deployment/helm/stacks-blockchain). |
@ -0,0 +1,242 @@ |
|||
--- |
|||
title: Running a mainnet node |
|||
description: Learn how to set up and run a mainnet node |
|||
icon: MainnetIcon |
|||
duration: 15 minutes |
|||
experience: beginners |
|||
tags: |
|||
- tutorial |
|||
images: |
|||
large: /images/pages/mainnet.svg |
|||
sm: /images/pages/mainnet-sm.svg |
|||
--- |
|||
|
|||
## Introduction |
|||
|
|||
This tutorial will walk you through the following steps: |
|||
|
|||
- Download and install the node software |
|||
- Run the node |
|||
- Mine Stacks token |
|||
|
|||
## Requirements |
|||
|
|||
In order to run a node, some software and hardware requirements need to be considered. |
|||
|
|||
### Hardware |
|||
|
|||
Running a node has no specialized hardware requirements. People were successful at running a node on Raspberry Pis, for instance. |
|||
Minimum requirements are moving targets due to the nature of the project and some factors should be considered: |
|||
|
|||
- compiling node sources locally requires computing and storage resources |
|||
- as the chain grows, the on-disk state will grow over time |
|||
|
|||
With these considerations in mind, we suggest hardware based on a general-purpose specification, similarly to [GCP E2 machine standard 2](https://cloud.google.com/compute/docs/machine-types#general_purpose) or [AWS EC2 t3.large standard](https://aws.amazon.com/ec2/instance-types/): |
|||
|
|||
- 2 vCPUs |
|||
- 8 GB memory |
|||
- ~50-GB disk (preferably SSDs) |
|||
|
|||
It is also recommended to run the node with a publicly routable IP, that way other peers in the network will be able to connect to it. |
|||
|
|||
### Software |
|||
|
|||
If you use Linux, you may need to manually install [`libssl-dev`](https://wiki.openssl.org/index.php/Libssl_API) and other packages. In your command line, run the following to get all packages: |
|||
|
|||
```bash |
|||
sudo 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](https://www.rust-lang.org/tools/install). |
|||
|
|||
```bash |
|||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
|||
``` |
|||
|
|||
In case you just installed Rust, you will be prompted to run the following command to make the `cargo` command available: |
|||
|
|||
```bash |
|||
source $HOME/.cargo/env |
|||
``` |
|||
|
|||
## Installing the node from pre-built binary |
|||
|
|||
### Step 1: Get the distributable |
|||
|
|||
Download and unzip the distributable which cooresponds to your environment [from the latest release](https://github.com/blockstack/stacks-blockchain/releases/latest). |
|||
|
|||
If you're running on Windows, [please follow our instructions from installing a node on Windows.](#running-the-mainnet-node-on-windows) |
|||
|
|||
### Step 2: Run the binary |
|||
|
|||
To run the `stacks-node` binary, execute the following: |
|||
|
|||
```bash |
|||
./stacks-node mainnet |
|||
``` |
|||
|
|||
**Awesome. Your node is now connected to the mainnet network.** |
|||
|
|||
Your node will receive new blocks when they are produced, and you can use the [Stacks Node RPC API](/understand-stacks/stacks-blockchain-api#proxied-stacks-node-rpc-api-endpoints) to send transactions, fetch information for contracts and accounts, and more. |
|||
|
|||
## Installing the node from source |
|||
|
|||
You might want to build and install from source if there are some updates in the [main branch](https://github.com/blockstack/stacks-blockchain) which aren't yet released, or if there is no pre-built binary for your environment. |
|||
|
|||
### Step 1: Install the node |
|||
|
|||
Clone this repository: |
|||
|
|||
```bash |
|||
git clone https://github.com/blockstack/stacks-blockchain.git; cd stacks-blockchain |
|||
``` |
|||
|
|||
Install the Stacks node by running: |
|||
|
|||
```bash |
|||
cargo build --workspace --release --bin stacks-node |
|||
# binary will be in target/release/stacks-node |
|||
``` |
|||
|
|||
To install Stacks node with extra debugging symbols, run: |
|||
|
|||
```bash |
|||
cargo build --workspace --bin stacks-node |
|||
# binary will be in target/debug/stacks-node |
|||
``` |
|||
|
|||
-> This process will take a few minutes to complete |
|||
|
|||
### Step 2: Run the node |
|||
|
|||
You're all set to run a node that connects to the mainnet network. |
|||
|
|||
If installed without debugging symbols, run: |
|||
|
|||
```bash |
|||
target/release/stacks-node mainnet |
|||
``` |
|||
|
|||
If installed with debugging symbols, run: |
|||
|
|||
```bash |
|||
target/debug/stacks-node mainnet |
|||
``` |
|||
|
|||
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: |
|||
|
|||
```bash |
|||
INFO [1588108047.585] [src/chainstate/stacks/index/marf.rs:732] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 |
|||
``` |
|||
|
|||
## Running the mainnet node on Windows |
|||
|
|||
### Prerequisites |
|||
|
|||
Before you begin, check that you have the below necessary softwares installed on your PC |
|||
|
|||
- [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). |
|||
|
|||
-> **Tip**: While installing the Microsoft Visual Studio Build tools using the above link, select the C++ Build tools option when prompted. |
|||
![C++ Build Tools](/images/C++BuildTools.png) |
|||
|
|||
- [NodeJs](https://nodejs.org/en/download/). |
|||
- [Git](https://git-scm.com/downloads). |
|||
|
|||
#### Optional Dependencies |
|||
|
|||
- [Python](https://www.python.org/downloads/). |
|||
- [Rust](https://www.rust-lang.org/tools/install). |
|||
|
|||
### Download the Binary and run the follower node |
|||
|
|||
-> **Note**: Please make sure to download the new Binary and follow the below steps as and when a [new release build](https://github.com/blockstack/stacks-blockchain/releases/latest) is available. |
|||
|
|||
First, Visit the [Stacks Github releases repo](https://github.com/blockstack/stacks-blockchain/releases/latest). From the various binary list, click to download the Windows binary. Refer the image below. |
|||
![BinaryList](/images/mining-windows.png) |
|||
|
|||
Next, click on save file and Press **Ok** in the popup window. |
|||
![Windowspopup](/images/mining-windows-popup.png) |
|||
|
|||
Once saved, Extract the binary. Open the command prompt **from the folder where binary is extracted** and execute the below command: |
|||
|
|||
```bash |
|||
stacks-node mainnet |
|||
# This command will start the mainnet follower node. |
|||
``` |
|||
|
|||
-> **Note** : While starting the node for the first time, windows defender will pop up with a message to allow access. If so, allow access to run the node. |
|||
![Windows Defender](/images/windows-defender.png) |
|||
|
|||
To execute Stacks node with extra debugging enabled, run: |
|||
|
|||
```bash |
|||
set RUST_BACKTRACE=full |
|||
set BLOCKSTACK_DEBUG=1 |
|||
stacks-node mainnet |
|||
# This command will execute the binary and start the follower node with debug enabled. |
|||
``` |
|||
|
|||
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: |
|||
|
|||
```bash |
|||
INFO [1588108047.585] [src/chainstate/stacks/index/marf.rs:732] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 |
|||
``` |
|||
|
|||
**Awesome. Your node is now connected to the mainnet network.** |
|||
|
|||
## Optional: Running with Docker |
|||
|
|||
Alternatively, you can run the mainnet node with Docker. |
|||
|
|||
-> Ensure you have [Docker](https://docs.docker.com/get-docker/) installed on your machine. |
|||
|
|||
```bash |
|||
docker run -d \ |
|||
--name stacks_follower \ |
|||
-p 20443:20443 \ |
|||
-p 20444:20444 \ |
|||
blockstack/stacks-blockchain \ |
|||
stacks-node mainnet |
|||
``` |
|||
|
|||
-> To enable debug logging, add the ENV VARS `RUST_BACKTRACE="full"` and `BLOCKSTACK_DEBUG="1"`. |
|||
|
|||
You can review the node logs with this command: |
|||
|
|||
```bash |
|||
docker logs -f stacks_follower |
|||
``` |
|||
|
|||
## Optional: Running in Kubernetes with Helm |
|||
|
|||
In addition, you're also able to run a mainnet node in a Kubernetes cluster using the [stacks-blockchain Helm chart](https://github.com/blockstack/stacks-blockchain/tree/master/deployment/helm/stacks-blockchain). |
|||
|
|||
Ensure you have the following prerequisites installed on your machine: |
|||
|
|||
- [minikube](https://minikube.sigs.k8s.io/docs/start/) (Only needed if standing up a local Kubernetes cluster) |
|||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) |
|||
- [helm](https://helm.sh/docs/intro/install/) |
|||
|
|||
To install the chart with the release name `my-release` and run the node as a follower: |
|||
|
|||
```bash |
|||
minikube start # Only run this if standing up a local Kubernetes cluster |
|||
helm repo add blockstack https://charts.blockstack.xyz |
|||
helm install my-release blockstack/stacks-blockchain |
|||
``` |
|||
|
|||
You can review the node logs with this command: |
|||
|
|||
```bash |
|||
kubectl logs -l app.kubernetes.io/name=stacks-blockchain |
|||
``` |
|||
|
|||
For more information on the Helm chart and configuration options, please refer to the [chart's homepage](https://github.com/blockstack/stacks-blockchain/tree/master/deployment/helm/stacks-blockchain). |
|||
|
|||
## Optional: Mining Stacks token |
|||
|
|||
Now that you have a running mainnet node, you can easily set up a miner. |
|||
|
|||
[@page-reference | inline] |
|||
| /start-mining |
Loading…
Reference in new issue