Skip to content

Commit 81cc560

Browse files
committed
fix(docs): improve validator registration steps
1 parent a4152f3 commit 81cc560

File tree

1 file changed

+148
-63
lines changed

1 file changed

+148
-63
lines changed

docs/run-node/4-register-validator.mdx

Lines changed: 148 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ description: Register your node as a validator.
77

88
import Tabs from "@theme/Tabs";
99
import TabItem from "@theme/TabItem";
10+
import DocCardList from "@theme/DocCardList";
1011

1112
This guide explains how to register a node as a validator.
1213
On Flare, any node can be registered as a validator by performing a self-bond on the P-chain against the node's Node-ID, effectively activating the node as a validator.
@@ -37,9 +38,10 @@ Failure to implement these measures significantly increases the risk to your nod
3738
- **NEVER** expose the node's main API port (default: `9650`) to the public internet. Use a firewall to **only allow** inbound connections on the staking port (default: `9651/TCP`).
3839
- **NEVER** use the same node instance for both validation and serving public RPC API requests. Public APIs expose your node to potential DoS attacks and exploits that could halt your validator. Run a separate node for RPC needs.
3940
- **ALWAYS** disable password authentication for SSH. Use strong, key-based authentication exclusively. Consider disabling root login via SSH.
40-
:::
4141

42-
### Recommended Hardening
42+
:::
43+
44+
### Recommended hardening
4345

4446
- Configure your node to **enable only** the essential APIs required for validation (often just `["web3"]` within `eth-apis`). Explicitly disable admin APIs (`snowman-api-enabled`, `coreth-admin-api-enabled`).
4547
- **Firewall Best Practices:**
@@ -52,6 +54,8 @@ Failure to implement these measures significantly increases the risk to your nod
5254

5355
## Configure the node
5456

57+
### Sample `config.json`
58+
5559
As described in [Secure the node](#secure-the-node), a validator node should have minimal APIs enabled.
5660
Below is a sample `config.json` demonstrating a secure configuration with limited `eth-apis` and disabled admin APIs:
5761

@@ -92,20 +96,22 @@ Below is a sample `config.json` demonstrating a secure configuration with limite
9296
}
9397
```
9498

95-
## Staking key and certificate
99+
### Prepare your staking keys
96100

97-
When a node is started, it will generate a `staker.key` and `staker.crt` in the `~/.avalanchego/staking` directory.
98-
These files define your node's identity (Node-ID) and is the identifier used when staking.
99-
Before registering your node as a validator, you should backup these files and keep them safe.
100-
Refer to the [Avalanche documentation](https://build.avax.network/docs/nodes/maintain/backup-restore) for an in-depth breakdown of backup and restoration of staking keys and certificates.
101+
Your node's identity is defined by two files, `staker.key` and `staker.crt`, which are created in `~/.avalanchego/staking/` the first time you start the node.
102+
Your `Node-ID` is derived from these files.
101103

102-
If you decide to move these files to a secure location, you can add the following parameters in your start command to start the node with the existing key and certificate and thus persist the Node-ID:
104+
:::warning[Backup your staking keys]
103105

104-
```bash
105-
--staking-tls-cert-file=<NODE_CRT_PATH> --staking-tls-key-file=<NODE_KEY_PATH>
106-
```
106+
Backup the `staker.key` and `staker.crt` and store them in a secure, private location.
107+
108+
:::
109+
110+
To ensure your node maintains the same `Node-ID` across restarts and machine migrations, you must explicitly tell `go-flare` where to find these files.
107111

108-
Confirm your node's Node-ID by running the following command:
112+
#### Get your Node-ID
113+
114+
After starting your node for the first time, retrieve and save your `Node-ID`.
109115

110116
```bash
111117
curl --data '{
@@ -116,9 +122,95 @@ curl --data '{
116122
}' http://localhost:9650/ext/info | jq -r ".result.nodeID"
117123
```
118124

119-
## Staking
125+
#### Create a Persistent Staking Directory (Recommended for Docker)
126+
127+
To make it easier to manage your keys with Docker, move them to a dedicated directory outside the default location.
128+
129+
```bash
130+
# Create a dedicated directory
131+
sudo mkdir -p /opt/flare/staking
132+
133+
# Move your keys
134+
sudo mv ~/.avalanchego/staking/staker.key /opt/flare/staking/
135+
sudo mv ~/.avalanchego/staking/staker.crt /opt/flare/staking/
136+
```
137+
138+
## Run the node
139+
140+
Now, start your node using command-line flags or environment variables that point to your `staker.key` and `staker.crt` files.
141+
This ensures your node always starts with the correct `Node-ID`.
142+
143+
### From source
144+
145+
Add the `--staking-tls-cert-file` and `--staking-tls-key-file` flags to your [startup command](/run-node/from-source#run-the-node).
146+
147+
```bash
148+
# Assumes keys are in the default location
149+
./build/avalanchego --network-id=flare \
150+
--http-host= \
151+
--bootstrap-ips="$(curl -sX POST --data '{"jsonrpc":"2.0", "id":1, "method":"info.getNodeIP"}' -H 'content-type:application/json;' [https://flare-bootstrap.flare.network/ext/info](https://flare-bootstrap.flare.network/ext/info) | jq -r '.result.ip')" \
152+
--bootstrap-ids="$(curl -sX POST --data '{"jsonrpc":"2.0", "id":1, "method":"info.getNodeID"}' -H 'content-type:application/json;' [https://flare-bootstrap.flare.network/ext/info](https://flare-bootstrap.flare.network/ext/info) | jq -r '.result.nodeID')" \
153+
--staking-tls-cert-file="~/.avalanchego/staking/staker.crt" \
154+
--staking-tls-key-file="~/.avalanchego/staking/staker.key"
155+
```
156+
157+
### Using Docker CLI
158+
159+
Modify your [`docker run`](/run-node/using-docker#using-docker-cli) command to [mount the directory](/run-node/register-validator#create-a-persistent-staking-directory-recommended-for-docker) containing your keys into the container and set the environment variables to point to the mounted files.
160+
161+
```bash
162+
# Find the latest tag at [https://hub.docker.com/r/flarefoundation/go-flare/tags](https://hub.docker.com/r/flarefoundation/go-flare/tags)
163+
LATEST_TAG="vX.Y.Z" # e.g., v1.10.0
164+
165+
docker run -d --name flare-node \
166+
-v /mnt/flare-db:/app/db \
167+
-v /opt/flare/conf:/app/conf \
168+
-v /opt/flare/staking:/app/staking \ # <-- Mount the staking keys
169+
-v /opt/flare/logs:/app/logs \
170+
-p 127.0.0.1:9650:9650 \
171+
-p 0.0.0.0:9651:9651 \
172+
-e NETWORK_ID="flare" \
173+
-e AUTOCONFIGURE_BOOTSTRAP="1" \
174+
-e AUTOCONFIGURE_BOOTSTRAP_ENDPOINT="[https://flare-bootstrap.flare.network/ext/info](https://flare-bootstrap.flare.network/ext/info)" \
175+
-e STAKING_TLS_CERT_FILE="/app/staking/staker.crt" \ # <-- Path inside the container
176+
-e STAKING_TLS_KEY_FILE="/app/staking/staker.key" \ # <-- Path inside the container
177+
flarefoundation/go-flare:${LATEST_TAG}
178+
```
179+
180+
### Using Docker Compose
181+
182+
Modify your [`docker-compose.yaml`](/run-node/using-docker#using-docker-compose) file to include the [staking key volume](/run-node/register-validator#create-a-persistent-staking-directory-recommended-for-docker) and environment variables.
183+
184+
```yaml
185+
services:
186+
node:
187+
image: flarefoundation/go-flare:vX.Y.Z # <-- REPLACE with the latest stable tag
188+
container_name: flare-node
189+
restart: on-failure
190+
ports:
191+
- "127.0.0.1:9650:9650"
192+
- "0.0.0.0:9651:9651"
193+
volumes:
194+
- /mnt/flare-db:/app/db
195+
- /opt/flare/conf:/app/conf
196+
- /opt/flare/staking:/app/staking # <-- Mount the staking keys
197+
- /opt/flare/logs:/app/logs
198+
environment:
199+
- NETWORK_ID=flare
200+
- AUTOCONFIGURE_BOOTSTRAP=1
201+
- AUTOCONFIGURE_BOOTSTRAP_ENDPOINT=[https://flare-bootstrap.flare.network/ext/info](https://flare-bootstrap.flare.network/ext/info)
202+
- STAKING_TLS_CERT_FILE=/app/staking/staker.crt # <-- Path inside the container
203+
- STAKING_TLS_KEY_FILE=/app/staking/staker.key # <-- Path inside the container
204+
```
205+
206+
## Stake and verify
120207
121-
### Staking phases
208+
With your node running and properly identified, the final step is to submit the self-bond transaction.
209+
210+
<details>
211+
<summary>Staking phases on Flare.</summary>
212+
213+
**Summary:**
122214
123215
The deployment of validator staking on Flare occurs in three distinct phases, each with its own set of rules and requirements.
124216
The following table summarizes the key differences between the phases:
@@ -134,8 +226,7 @@ The following table summarizes the key differences between the phases:
134226
135227
\*Current phase
136228
137-
<details>
138-
<summary>Detailed breakdown of staking phases.</summary>
229+
**Detailed breakdown:**
139230
140231
The Flare network is designed to be progressively decentralized, with the transition occurring in three phases:
141232
@@ -175,61 +266,55 @@ The goal is for funds staked on the P-chain to have the same rights as wrapped F
175266
176267
### Stake requirements
177268
178-
| **Requirement** | **Value** |
179-
| -------------------------------------------- | --------- |
180-
| Minimum self-bond amount | 1M FLR |
181-
| Minimum delegation amount | 50K FLR |
182-
| Minimum stake duration | 2 months |
183-
| Minimum delegation duration | 2 weeks |
184-
| Stake delay | immediate |
185-
| Delegation factor | 15 times |
186-
| Maximum total stake | 200M FLR |
187-
| Maximum validators per infrastructure entity | 4 |
269+
| **Requirement** | **Value** | **Description** |
270+
| :------------------------------ | :-------- | :-------------------------------------------------------------------------------------------------------------- |
271+
| **Minimum self-bond amount** | 1M FLR | The minimum stake required to register a validator. |
272+
| **Minimum delegation amount** | 50K FLR | The minimum amount an FLR holder can delegate to a validator. |
273+
| **Minimum stake duration** | 2 months | The minimum time a validator's self-bond must be locked. |
274+
| **Minimum delegation duration** | 2 weeks | The minimum time delegated funds must be locked. |
275+
| **Stake delay** | Immediate | The time between submitting a stake and it becoming active. |
276+
| **Delegation factor** | 15x | A multiplier on the self-bond that sets the maximum total stake (including delegations) a validator can accept. |
277+
| **Maximum total stake** | 200M FLR | The absolute maximum stake a validator can have, including all delegations. |
278+
| **Max validators per entity** | 4 | The maximum number of validators a single entity can operate. |
188279
189-
<details>
190-
<summary>Understanding the requirements.</summary>
191-
192-
- **Minimum self-bond amount:** Minimum stake that an entity must provide to become a validator. This setting reduces staking requests, which frees network resources.
193-
194-
- **Minimum delegation amount:** Validators can accept stake delegations from any FLR holder, so their stake and validation rewards are increased.
195-
The specified value is the minimum stake amount that can be delegated. This setting reduces delegation requests, which frees network resources. Validators can set a staking fee and will earn staking rewards for its own self-bond and a fee on any stake delegated on them.
196-
This stake delegation is not related to FTSO delegation nor governance delegation.
280+
See [FIP.05](https://proposals.flare.network/FIP/FIP_5.html) for further details.
197281
198-
- **Minimum stake duration:** Minimum amount of time that self-bond funds must remain staked, and therefore locked.
199-
- **Minimum delegation duration:** Minimum amount of time that delegated funds must remain staked, and therefore locked. This setting does not change. It is included in this list for clarity.
200-
- **Stake delay:** Duration that passes between the time when funds are staked and the time when they become effective. During this period funds are locked. This delay provided added security when staking was enabled for the first time and stakes were small, since any suspicious stake could be analyzed before it became effective. Now that larger stakes are in place this restriction will be lifted to simplify onboarding of new validators.
201-
Note that there is no such delay involved when withdrawing staked funds once the staking period expires.
282+
### Perform the self-bond
202283
203-
- **Delegation factor:** The total amount that can be staked to a validator is limited to its self-bond times this factor. For example, with the proposed value of 15, if a validator has a self-bond stake of 1M FLR, the total sum of all stakes, including delegations, cannot exceed 15M FLR. This allows for 14M FLR of delegations.
284+
To perform the actual staking transaction (the self-bond), you will use the Flare Stake Tool.
285+
Follow the instructions in the guide below to stake FLR to your `Node-ID` (see how to [get your Node-ID](/run-node/register-validator#get-your-node-id)).
204286

205-
- **Maximum total stake:** Maximum stake per validator, including self-bond and delegations.
287+
<DocCardList
288+
items={[
289+
{
290+
type: "link",
291+
label: "Using Flare Stake Tool",
292+
href: "/network/guides/using-flare-stake-tool",
293+
description: "Stake FLR using the flare-stake-tool CLI.",
294+
},
295+
]}
296+
/>
206297

207-
- **Maximum validators per infrastructure entity:** A single infrastructure entity can include up to this amount of validators.
208-
Infrastructure entities also include FTSO data providers. For example, a single FTSO data provider can create up to 4 validators, each one with its own stake, and claim the validation rewards for all of them.
209-
This restriction is not enforced by the P-chain staking mechanism but by the mirroring service, and will not take effect until [Staking Phase 3](#staking).
210-
If an infrastructure entity has more than one validator, each of the validators must fulfill the above requirements.
298+
### Verify validator status
211299

212-
See [FIP.05](https://proposals.flare.network/FIP/FIP_5.html) for further details.
300+
Once your self-bond transaction is confirmed and the staking period begins, your node will join the active validator set.
301+
You can monitor its status using an API call or a validator monitoring site.
213302

214-
</details>
303+
- **Via API:**
215304

216-
A node becomes a validator when it's owner stakes to their node, referred to as a self-bond.
217-
The self-bond is performed on the P-chain against the node's Node-ID.
218-
To understand requirements for the staking process and how to stake, refer to the [Using Flare Stake Tool](/network/guides/using-flare-stake-tool) page.
305+
```bash
306+
curl --data '{
307+
"jsonrpc": "2.0",
308+
"method": "platform.getCurrentValidators",
309+
"params": {
310+
"nodeIDs": ["<NODE_ID>"]
311+
},
312+
"id": 1
313+
}' -H 'content-type:application/json;' https://flare-api.flare.network/ext/P | jq
314+
```
219315

220-
Once the self-bond is complete and the staking start time is reached, the node will join the current validator set.
221-
You can inspect the validator's status by running the following command:
316+
Check the `uptime` and `connected` fields in the response.
222317

223-
```bash
224-
curl --data '{
225-
"jsonrpc": "2.0",
226-
"method": "platform.getCurrentValidators",
227-
"params": {
228-
"nodeIDs": ["<NODE_ID>"]
229-
},
230-
"id": 1
231-
}' -H 'content-type:application/json;' https://flare-api.flare.network/ext/P | jq
232-
```
318+
- **Via Web:**
233319

234-
Observe the `uptime` and `connected` fields to ensure the node is healthy and connected to the network.
235-
Additionally, you can use the [validator monitoring site](https://flare-validators.flare.network/) to observe the validator's status.
320+
Use the [Flare Validator Monitoring Site](https://flare-validators.flare.network/) to see your validator's status.

0 commit comments

Comments
 (0)