Skip to content

Commit 23b98ca

Browse files
authored
fix(docs): improve entity docs (#686)
2 parents 8f98370 + 3e9b7f0 commit 23b98ca

File tree

2 files changed

+61
-91
lines changed

2 files changed

+61
-91
lines changed

docs/2-run-node.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ Does not participate in consensus.
2323
{
2424
type: "link",
2525
label: "Check System requirements",
26-
href: "run-node/system-requirements",
26+
href: "/run-node/system-requirements",
2727
description: "Minimum hardware requirements for running a node.",
2828
},
2929
{
3030
type: "link",
3131
label: "Run Node from source",
32-
href: "run-node/from-source",
32+
href: "/run-node/from-source",
3333
description: "Run a Flare node from go-flare source code.",
3434
},
3535
{
3636
type: "link",
3737
label: "Run Node using Docker",
38-
href: "run-node/using-docker",
38+
href: "/run-node/using-docker",
3939
description: "Run a Flare node using Docker.",
4040
},
4141
]}
@@ -52,7 +52,7 @@ Once your node is running, proceed with the registration:
5252
{
5353
type: "link",
5454
label: "Register as Validator",
55-
href: "run-node/register-validator",
55+
href: "/run-node/register-validator",
5656
description: "Register your Flare node as a validator.",
5757
},
5858
]}
@@ -69,7 +69,7 @@ Requires a running [Validator Node](#validator-node). To set up a Flare Entity:
6969
{
7070
type: "link",
7171
label: "Set Up Flare Entity",
72-
href: "run-node/flare-entity",
72+
href: "/run-node/flare-entity",
7373
description: "Provide data for Flare's enshrined FTSO and FDC protocols.",
7474
},
7575
]}

docs/run-node/5-flare-entity.mdx

Lines changed: 56 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ A Flare Entity consists of the following six components:
3636
- [Docker Engine](https://docs.docker.com/engine/install/), ensure the Docker data root directory has sufficient disk space. If necessary, configure Docker to use a specific storage location or mount point (refer to Docker's [storage documentation](https://docs.docker.com/engine/storage/)).
3737
- [jq](https://jqlang.github.io/jq/)
3838
- [envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html)
39+
- [yarn](https://yarnpkg.com) (optional, for performing [automated registration](#register-and-fund-fsp-addresses) on testnets)
3940

4041
:::tip
4142

@@ -73,11 +74,11 @@ You need five specific addresses for FSP operations.
7374
You can register them using an automated script (Testnets only) or manually via contract calls (Mainnet).
7475

7576
<details>
76-
<summary>Method 1: Automated Registration (Testnet only).</summary>
77+
<summary>Method 1: Automated Registration (Testnets only).</summary>
7778

7879
:::danger
7980

80-
This automated method requires placing private keys in a configuration file.
81+
This automated method requires placing private keys in a JSON file.
8182
This significantly increases security risk and is **NOT recommended for mainnet**.
8283
Use this method **only** where key security is less critical.
8384
For mainnet, **always use Method 2: Manual process.**
@@ -88,103 +89,72 @@ On testnets, you can automate the registration of your five FSP addresses **and*
8889

8990
1. Clone and build [flare-smart-contracts-v2](https://github.com/flare-foundation/flare-smart-contracts-v2/):
9091

91-
```bash
92-
git clone https://github.com/flare-foundation/flare-smart-contracts-v2/
93-
cd flare-smart-contracts-v2
94-
yarn
95-
yarn c
96-
```
92+
```bash
93+
git clone https://github.com/flare-foundation/flare-smart-contracts-v2/
94+
cd flare-smart-contracts-v2
95+
yarn
96+
yarn c
97+
```
9798

9899
2. Create an `entities.json` file with the following account addresses and private keys. Generate a sortition private key by following step 1 in [Register sortition key](#register-sortition-key). :
99100

100-
```json
101-
[
102-
{
103-
"identity": {
104-
"address": "<address>",
105-
"privateKey": "<private key hex>"
106-
},
107-
"submit": {
108-
"address": "<address>",
109-
"privateKey": "<private key hex>"
110-
},
111-
"submitSignatures": {
112-
"address": "<address>",
113-
"privateKey": "<private key hex>"
114-
},
115-
"signingPolicy": {
116-
"address": "<address>",
117-
"privateKey": "<private key hex>"
118-
},
119-
"delegation": {
120-
"address": "<address>",
121-
"privateKey": "<private key hex>"
122-
},
123-
"sortitionPrivateKey": "<private key hex>" // docker run --rm ghcr.io/flare-foundation/fast-updates/go-client:latest keygen
124-
}
125-
]
126-
```
127-
128-
3. Configure your `.env`:
129-
130-
<Tabs groupId="network">
131-
<TabItem value="coston2" label="Flare Testnet Coston2" default>
132-
133-
```text title=".env"
134-
ENTITIES_FILE_PATH="<path to entities.json>"
135-
COSTON2_RPC=<non-public Coston2 RPC>
136-
CHAIN_CONFIG="coston2"
137-
```
138-
139-
</TabItem>
140-
<TabItem value="songbird" label="Songbird Canary-Network">
141-
142-
```text title=".env"
143-
ENTITIES_FILE_PATH="<path to entities.json>"
144-
SONGBIRD_RPC=<non-public Songbird RPC>
145-
CHAIN_CONFIG="songbird"
146-
```
101+
```json
102+
[
103+
{
104+
"identity": {
105+
"address": "<address>",
106+
"privateKey": "<private key hex>"
107+
},
108+
"submit": {
109+
"address": "<address>",
110+
"privateKey": "<private key hex>"
111+
},
112+
"submitSignatures": {
113+
"address": "<address>",
114+
"privateKey": "<private key hex>"
115+
},
116+
"signingPolicy": {
117+
"address": "<address>",
118+
"privateKey": "<private key hex>"
119+
},
120+
"delegation": {
121+
"address": "<address>",
122+
"privateKey": "<private key hex>"
123+
},
124+
"sortitionPrivateKey": "<private key hex>"
125+
}
126+
]
127+
```
147128

148-
</TabItem>
149-
<TabItem value="coston" label="Songbird Testnet Coston">
129+
3. Rename `.env.template` to `.env` and add the path to your `entities.json` file:
150130

151-
```text title=".env"
152-
ENTITIES_FILE_PATH="<path to entities.json>"
153-
COSTON_RPC=<non-public Coston RPC>
154-
CHAIN_CONFIG="coston"
155-
```
131+
```text title=".env"
132+
ENTITIES_FILE_PATH=entities.json # <-- REPLACE WITH PATH TO YOUR entities.json
133+
```
156134

157-
</TabItem>
158-
</Tabs>
135+
4. Run the registration tasks ([`register-entities.ts`](https://github.com/flare-foundation/flare-smart-contracts-v2/blob/main/deployment/tasks/register-entities.ts) and [`register-public-keys.ts`](https://github.com/flare-foundation/flare-smart-contracts-v2/blob/main/deployment/tasks/register-public-keys.ts)):
159136

160-
4. Run the registration tasks:
137+
<Tabs groupId="network">
161138

162-
<Tabs groupId="network">
163-
<TabItem value="coston2" label="Flare Testnet Coston2" default>
139+
<TabItem value="coston2" label="Flare Testnet Coston2" default>
164140

165-
```bash
166-
yarn hardhat --network coston2 register-entities
167-
yarn hardhat --network coston2 register-public-keys
168-
```
141+
```bash
142+
yarn run register_entities_network_coston2
143+
yarn run register_public_keys_network_coston2
144+
```
169145

170-
</TabItem>
171-
<TabItem value="songbird" label="Songbird Canary-Network">
146+
</TabItem>
172147

173-
```bash
174-
yarn hardhat --network songbird register-entities
175-
yarn hardhat --network songbird register-public-keys
176-
```
148+
<TabItem value="coston" label="Songbird Testnet Coston">
177149

178-
</TabItem>
179-
<TabItem value="coston" label="Songbird Testnet Coston">
150+
```bash
151+
yarn run register_entities_network_coston
152+
yarn run register_public_keys_network_coston
153+
```
180154

181-
```bash
182-
yarn hardhat --network coston register-entities
183-
yarn hardhat --network coston register-public-keys
184-
```
155+
</TabItem>
185156

186-
</TabItem>
187-
</Tabs>
157+
</Tabs>
188158

189159
If these scripts complete successfully, you have registered both the FSP addresses and the sortition key.
190160
You can proceed directly to [Fund FSP addresses](#fund-fsp-addresses).
@@ -193,7 +163,7 @@ You can proceed directly to [Fund FSP addresses](#fund-fsp-addresses).
193163

194164
#### Method 2: Manual registration
195165

196-
On mainnet, or if you prefer not to use the automated script on testnets, you must manually register the required FSP addresses by interacting directly with the `EntityManager` smart contract.
166+
On mainnet, or if you prefer not to use the automated script on testnets, you must manually register the required FSP addresses by interacting directly with the [`EntityManager`](/network/fsp/solidity-reference/IEntityManager) smart contract.
197167

198168
1. Ensure you have generated the following five addresses and **securely stored their private keys**. Understand their roles:
199169

0 commit comments

Comments
 (0)