2023-01-11 14:26:49 +00:00
|
|
|
# Step-by-step private FrostFS deployment
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-01-11 14:26:49 +00:00
|
|
|
This is a short guide on how to deploy a private FrostFS storage network on bare
|
2021-10-11 13:06:24 +00:00
|
|
|
metal without docker images. This guide does not cover details on how to start
|
2023-03-02 10:56:11 +00:00
|
|
|
consensus, Alphabet, or Storage nodes. This guide covers only `frostfs-adm`
|
2021-10-11 13:06:24 +00:00
|
|
|
related configuration details.
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
To follow this guide you need:
|
|
|
|
- latest released version of [neo-go](https://github.com/nspcc-dev/neo-go/releases) (v0.97.2 at the moment),
|
2024-09-11 09:40:04 +00:00
|
|
|
- latest released version of [frostfs-adm](https://git.frostfs.info/TrueCloudLab/frostfs-node/releases) utility (v0.42.9 at the moment),
|
|
|
|
- latest released version of compiled [frostfs-contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/releases) (v0.19.2 at the moment).
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
## Step 1: Prepare network configuration
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
To start a network, you need a set of consensus nodes, the same number of
|
|
|
|
Alphabet nodes and any number of Storage nodes. While the number of Storage
|
|
|
|
nodes can be scaled almost infinitely, the number of consensus and Alphabet
|
2021-10-11 15:29:00 +00:00
|
|
|
nodes can't be changed so easily right now. Consider this before going any further.
|
2023-05-16 08:22:20 +00:00
|
|
|
Note also that there is an upper limit on the number of alphabet nodes (currently 22).
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2022-12-23 17:35:35 +00:00
|
|
|
It is easier to use`frostfs-adm` with a predefined configuration. First, create
|
2022-04-21 11:28:05 +00:00
|
|
|
a network configuration file. In this example, there is going to be only one
|
2021-10-11 13:06:24 +00:00
|
|
|
consensus / Alphabet node in the network.
|
|
|
|
|
|
|
|
```
|
2022-12-23 17:35:35 +00:00
|
|
|
$ frostfs-adm config init --path foo.network.yml
|
2021-10-11 13:06:24 +00:00
|
|
|
Initial config file saved to foo.network.yml
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
$ cat foo.network.yml
|
2021-10-11 13:06:24 +00:00
|
|
|
rpc-endpoint: https://neo.rpc.node:30333
|
|
|
|
alphabet-wallets: /home/user/deploy/alphabet-wallets
|
|
|
|
network:
|
|
|
|
max_object_size: 67108864
|
|
|
|
epoch_duration: 240
|
2024-04-08 09:27:30 +00:00
|
|
|
max_ec_data_count: 12
|
|
|
|
max_ec_parity_count: 4
|
2021-10-11 13:06:24 +00:00
|
|
|
fee:
|
|
|
|
candidate: 0
|
|
|
|
container: 0
|
|
|
|
withdraw: 0
|
|
|
|
credentials:
|
|
|
|
az: hunter2
|
|
|
|
```
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
For private installation, it is recommended to set all **fees** and **basic
|
|
|
|
income rate** to 0.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
As for **epoch duration**, consider consensus node block generation frequency.
|
|
|
|
With default 15 seconds per block, 240 blocks are going to be a 1-hour epoch.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
For **max object size**, 67108864 (64 MiB) or 134217728 (128 MiB) should provide
|
2021-10-11 13:06:24 +00:00
|
|
|
good chunk distribution in most cases.
|
|
|
|
|
2021-10-11 15:29:00 +00:00
|
|
|
With this config, generate wallets (private keys) of consensus nodes. The same
|
2023-03-02 10:56:11 +00:00
|
|
|
wallets will be used for Alphabet nodes. Make sure, that dir for alphabet
|
2021-10-11 15:29:00 +00:00
|
|
|
wallets already exists.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
|
|
|
```
|
2022-12-23 17:35:35 +00:00
|
|
|
$ frostfs-adm -c foo.network.yml morph generate-alphabet --size 1
|
2021-10-11 13:06:24 +00:00
|
|
|
size: 1
|
|
|
|
alphabet-wallets: /home/user/deploy/alphabet-wallets
|
|
|
|
wallet[0]: hunter2
|
|
|
|
```
|
|
|
|
|
2024-06-26 14:10:27 +00:00
|
|
|
This command generates wallets with the following names:
|
|
|
|
- az, buky, vedi, glagoli, dobro, yest, zhivete, dzelo, zemlja, izhe, izhei, gerv, kako, ljudi, mislete, nash, on, pokoj, rtsi, slovo, tverdo, uk
|
|
|
|
|
|
|
|
No gaps between names allowed, order is important.
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Do not lose wallet files and network config. Store it in an encrypted backed up
|
2021-10-11 13:06:24 +00:00
|
|
|
storage.
|
|
|
|
|
|
|
|
## Step 2: Launch consensus nodes
|
|
|
|
|
|
|
|
Configure blockchain nodes with the generated wallets from the previous step.
|
2023-03-02 10:56:11 +00:00
|
|
|
Config examples can be found in
|
2021-10-11 13:06:24 +00:00
|
|
|
[neo-go repository](https://github.com/nspcc-dev/neo-go/tree/master/config).
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Gather public keys from **all** generated wallets. We are interested in the first
|
2021-10-11 13:06:24 +00:00
|
|
|
`simple signature contract` public key.
|
|
|
|
|
|
|
|
```
|
2023-03-02 10:56:11 +00:00
|
|
|
$ neo-go wallet dump-keys -w alphabet-wallets/az.json
|
2021-10-11 13:06:24 +00:00
|
|
|
NitdS4k4f1Hh5mbLJhAswBK3WC2gQgPN1o (simple signature contract):
|
|
|
|
02c1cc85f9c856dbe2d02017349bcb7b4e5defa78b8056a09b3240ba2a8c078869
|
|
|
|
|
|
|
|
NiMKabp3ddi3xShmLAXhTfbnuWb4cSJT6E (1 out of 1 multisig contract):
|
|
|
|
02c1cc85f9c856dbe2d02017349bcb7b4e5defa78b8056a09b3240ba2a8c078869
|
|
|
|
|
|
|
|
NiMKabp3ddi3xShmLAXhTfbnuWb4cSJT6E (1 out of 1 multisig contract):
|
|
|
|
02c1cc85f9c856dbe2d02017349bcb7b4e5defa78b8056a09b3240ba2a8c078869
|
|
|
|
```
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
Put the list of public keys into `ProtocolConfiguration.StandbyCommittee`
|
2021-10-11 14:26:28 +00:00
|
|
|
section. Specify the wallet path and the password in `ApplicationConfiguration.P2PNotary`
|
2021-10-11 15:29:00 +00:00
|
|
|
and `ApplicationConfiguration.UnlockWallet` sections. If config includes
|
2023-03-02 10:56:11 +00:00
|
|
|
`ProtocolConfiguration.NativeActivations` section, add notary
|
2021-10-11 15:29:00 +00:00
|
|
|
contract `Notary: [0]`.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
ProtocolConfiguration:
|
|
|
|
StandbyCommittee:
|
|
|
|
- 02c1cc85f9c856dbe2d02017349bcb7b4e5defa78b8056a09b3240ba2a8c078869
|
2021-10-11 15:29:00 +00:00
|
|
|
NativeActivations:
|
|
|
|
Notary: [0]
|
2021-10-11 13:06:24 +00:00
|
|
|
ApplicationConfiguration:
|
|
|
|
P2PNotary:
|
|
|
|
Enabled: true
|
|
|
|
UnlockWallet:
|
|
|
|
Path: "/home/user/deploy/alphabet-wallets/az.json"
|
|
|
|
Password: "hunter2"
|
|
|
|
UnlockWallet:
|
|
|
|
Path: "/home/user/deploy/alphabet-wallets/az.json"
|
|
|
|
Password: "hunter2"
|
|
|
|
```
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Then, launch consensus nodes. They should connect to each other and start
|
2021-10-11 13:06:24 +00:00
|
|
|
producing blocks in consensus. You might want to deploy additional RPC
|
|
|
|
nodes at this stage because Storage nodes should be connected to the chain too.
|
2022-04-21 11:28:05 +00:00
|
|
|
It is not recommended to use a consensus node as an RPC node due to security policies
|
2021-10-11 13:06:24 +00:00
|
|
|
and possible overload issues.
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
## Step 3: Initialize sidechain
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-01-11 14:26:49 +00:00
|
|
|
Use archive with compiled FrostFS contracts to initialize the sidechain.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
|
|
|
```
|
2023-03-02 10:56:11 +00:00
|
|
|
$ tar -xzvf frostfs-contract-v0.11.0.tar.gz
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2022-12-23 17:35:35 +00:00
|
|
|
$ ./frostfs-adm -c foo.network.yml morph init --contracts ./frostfs-contract-v0.11.0
|
2021-10-11 13:06:24 +00:00
|
|
|
Stage 1: transfer GAS to alphabet nodes.
|
|
|
|
Waiting for transactions to persist...
|
|
|
|
Stage 2: set notary and alphabet nodes in designate contract.
|
|
|
|
Waiting for transactions to persist...
|
|
|
|
Stage 3: deploy NNS contract.
|
|
|
|
Waiting for transactions to persist...
|
2023-01-11 14:26:49 +00:00
|
|
|
Stage 4: deploy FrostFS contracts.
|
2021-10-11 13:06:24 +00:00
|
|
|
Waiting for transactions to persist...
|
|
|
|
Stage 4.1: Transfer GAS to proxy contract.
|
|
|
|
Waiting for transactions to persist...
|
|
|
|
Stage 5: register candidates.
|
|
|
|
Waiting for transactions to persist...
|
|
|
|
Stage 6: transfer NEO to alphabet contracts.
|
|
|
|
Waiting for transactions to persist...
|
|
|
|
Stage 7: set addresses in NNS.
|
|
|
|
Waiting for transactions to persist...
|
2023-01-11 14:26:49 +00:00
|
|
|
NNS: Set alphabet0.frostfs -> f692dfb4d43a15b464eb51a7041160fb29c44b6a
|
|
|
|
NNS: Set balance.frostfs -> 103519b3067a66307080a66570c0491ee8f68879
|
|
|
|
NNS: Set container.frostfs -> cae60bdd689d185901e495352d0247752ce50846
|
|
|
|
NNS: Set frostfsid.frostfs -> c421fb60a3895865a8f24d197d6a80ef686041d2
|
|
|
|
NNS: Set netmap.frostfs -> 894eb854632f50fb124412ce7951ebc00763525e
|
|
|
|
NNS: Set proxy.frostfs -> ac6e6fe4b373d0ca0ca4969d1e58fa0988724e7d
|
2021-10-11 13:06:24 +00:00
|
|
|
Waiting for transactions to persist...
|
|
|
|
```
|
|
|
|
|
|
|
|
## Step 4: Launch Alphabet nodes
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
Configure Alphabet nodes with the wallets generated in step 1. For
|
|
|
|
`morph.validators` use a list of public keys from
|
2021-10-11 13:06:24 +00:00
|
|
|
`ProtocolConfiguration.StandbyCommittee`.
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
wallet:
|
|
|
|
path: "/home/user/deploy/alphabet-wallets/az.json"
|
|
|
|
password: "hunter2"
|
|
|
|
account: "NitdS4k4f1Hh5mbLJhAswBK3WC2gQgPN1o"
|
|
|
|
|
|
|
|
morph:
|
|
|
|
validators:
|
|
|
|
- 02c1cc85f9c856dbe2d02017349bcb7b4e5defa78b8056a09b3240ba2a8c078869
|
|
|
|
|
|
|
|
contracts:
|
|
|
|
alphabet:
|
|
|
|
amount: 1
|
|
|
|
```
|
|
|
|
|
|
|
|
## Step 4: Launch Storage node
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Generate a new wallet for a Storage node.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
|
|
|
```
|
2022-12-23 17:35:35 +00:00
|
|
|
$ frostfs-adm -c foo.network.yml morph generate-storage-wallet --storage-wallet ./sn01.json --initial-gas 10.0
|
2023-03-02 10:56:11 +00:00
|
|
|
New password >
|
2021-10-11 13:06:24 +00:00
|
|
|
Waiting for transactions to persist...
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
$ neo-go wallet dump-keys -w sn01.json
|
2021-10-11 13:06:24 +00:00
|
|
|
Ngr7p8Z9S22XDH6VkUG9oXobv8zZRAWwwv (simple signature contract):
|
|
|
|
0355eccb72cd46f09a3e5237eaa0f4949cceb5ecfa5a225bd3bb9fd021c4d75b85
|
|
|
|
```
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Configure the Storage node to use this wallet.
|
2021-10-11 13:06:24 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
node:
|
|
|
|
wallet:
|
|
|
|
path: "/home/user/deploy/sn01.json"
|
|
|
|
address: "Ngr7p8Z9S22XDH6VkUG9oXobv8zZRAWwwv"
|
|
|
|
password: "foobar"
|
|
|
|
```
|
|
|
|
|
2023-01-11 14:26:49 +00:00
|
|
|
The storage node will be included in the network map in the next FrostFS epoch. To
|
2021-10-11 13:06:24 +00:00
|
|
|
speed up this process, you can increment epoch counter immediately.
|
|
|
|
|
|
|
|
```
|
2022-12-23 17:35:35 +00:00
|
|
|
$ frostfs-adm -c foo.network.yml morph force-new-epoch
|
2021-10-11 13:06:24 +00:00
|
|
|
Current epoch: 8, increase to 9.
|
|
|
|
Waiting for transactions to persist...
|
|
|
|
```
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
---
|
2021-10-11 13:06:24 +00:00
|
|
|
|
2023-01-11 14:26:49 +00:00
|
|
|
After that, FrostFS Storage is ready to work. You can access it directly or
|
2021-10-11 13:06:24 +00:00
|
|
|
with protocol gates.
|