frostfs-node/cmd/frostfs-adm
Evgenii Stratonikov 39e3339df6
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 2m37s
DCO action / DCO (pull_request) Failing after 2m53s
Build / Build Components (pull_request) Successful in 4m9s
Tests and linters / Staticcheck (pull_request) Successful in 4m15s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m0s
Vulncheck / Vulncheck (pull_request) Successful in 4m54s
Tests and linters / Lint (pull_request) Successful in 5m7s
Tests and linters / gopls check (pull_request) Successful in 6m27s
Tests and linters / Tests (pull_request) Successful in 8m21s
Tests and linters / Tests with -race (pull_request) Successful in 8m28s
adm: Allow to use --local-dump everywhere --rpc-endpoint is present
Currently, we allow using `--local-dump` in `morph init` command.
We also have this flag in other commands, but no `--protocol` which is
also needed. And in new command we do not have the ability to use local
dump at all.

This commit makes it possible to work either with an RPC or with
local-dump in every command.

Refs #1035.
Refs TrueCloudLab/frostfs-dev-env#42.

Writing gopatch this time was really satisfying, btw:
```
@@
var flags expression
@@

-flags.StringP(commonflags.EndpointFlag, ...)
+commonflags.InitRPC(flags)

@@
var flags expression
@@
-_ = viper.BindPFlag(commonflags.EndpointFlag, flags.Lookup(...))
+commonflags.BindRPC(flags)
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-20 14:31:47 +03:00
..
docs [#1369] Update obsolete URLs 2024-09-11 11:31:10 +00:00
internal adm: Allow to use --local-dump everywhere --rpc-endpoint is present 2024-11-20 14:31:47 +03:00
main.go Rename package name 2023-03-07 16:38:26 +03:00
README.md [#218] adm: Update doc for morph generate-alphabet 2024-07-01 06:56:02 +00:00

FrostFS Admin Tool

Overview

Admin tool provides an easier way to deploy and maintain private installation of FrostFS. Private installation provides a set of N3 consensus nodes, FrostFS Alphabet, and Storage nodes. Admin tool generates consensus keys, initializes the sidechain, and provides functions to update the network and register new Storage nodes.

Build

To build binary locally, use make bin/frostfs-adm command.

For clean build inside a docker container, use make docker/bin/frostfs-adm.

Build docker image with make image-adm.

At FrostFS private install deployment, frostfs-adm requires compiled FrostFS contracts. Find them in the latest release of frostfs-contract repository.

Commands

Config

Config section provides init command that creates a configuration file for private installation deployment and updates. Config file is optional, all parameters can be passed by arguments or read from standard input (wallet passwords).

Config example:

rpc-endpoint: https://address:port # sidechain RPC node endpoint
alphabet-wallets: /path            # path to consensus node / alphabet wallets storage
network:
  max_object_size: 67108864 # max size of a single FrostFS object, bytes
  epoch_duration: 240       # duration of a FrostFS epoch in blocks, consider block generation frequency in the sidechain
  fee:
    candidate: 0 # inner ring candidate registration fee, for private installation consider 0
    container: 0 # container creation fee, for private installation consider 0
    container_alias: 0 # container nice-name registration fee, for private installation consider 0
    withdraw: 0  # withdraw fee, for private installation consider 0
credentials:     # passwords for consensus node / alphabet wallets
  az: password1
  buky: password2
  vedi: password3
  glagoli: password4
  dobro: password5
  yest: password6
  zhivete: password7

Morph

Network deployment

  • generate-alphabet generates a set of wallets for consensus and Alphabet nodes. The list of the name for alphabet wallets(no gaps between names allowed, order is important):

    • az, buky, vedi, glagoli, dobro, yest, zhivete, dzelo, zemlja, izhe, izhei, gerv, kako, ljudi, mislete, nash, on, pokoj, rtsi, slovo, tverdo, uk
  • init initializes the sidechain by deploying smart contracts and setting provided FrostFS network configuration.

  • generate-storage-wallet generates a wallet for the Storage node that is ready for deployment. It also transfers a bit of sidechain GAS, so this wallet can be used for FrostFS bootstrap.

Network maintenance

  • set-config add/update configuration values in the Netmap contract.

  • force-new-epoch increments FrostFS epoch number and executes new epoch handlers in FrostFS nodes.

  • refill-gas transfers sidechain GAS to the specified wallet.

  • update-contracts updates contracts to a new version.

Container migration

If a network has to be redeployed, these commands will migrate all container meta info. These commands do not migrate actual objects.

  • dump-containers saves all containers and metadata registered in the container contract to a file.

  • restore-containers restores previously saved containers by their repeated registration in the container contract.

  • list-containers output all containers ids.

Network info

  • dump-config prints FrostFS network configuration.

  • dump-hashes prints FrostFS contract addresses stored in NNS.

Private network deployment

Read step-by-step guide of private storage deployment in docs.