From 8b08f8c171e819026d21fce4fa4599a902e3ec78 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Thu, 26 Sep 2024 11:37:24 +0000 Subject: [PATCH] Demo of progressive storage bootstrap fees --- extra/.gitignore | 4 ++ extra/Makefile | 47 +++++++++++++++++++ extra/config/devenv.yml | 1 + extra/config/extra.yml | 77 +++++++++++++++++++++++++++++++ extra/new_storage_wallet.template | 2 + 5 files changed, 131 insertions(+) create mode 100644 extra/.gitignore create mode 100644 extra/Makefile create mode 120000 extra/config/devenv.yml create mode 100644 extra/config/extra.yml create mode 100644 extra/new_storage_wallet.template diff --git a/extra/.gitignore b/extra/.gitignore new file mode 100644 index 0000000..c3c4c74 --- /dev/null +++ b/extra/.gitignore @@ -0,0 +1,4 @@ +bin +storage +.frostfs-storage-state +new_storage_wallet.json diff --git a/extra/Makefile b/extra/Makefile new file mode 100644 index 0000000..758cd70 --- /dev/null +++ b/extra/Makefile @@ -0,0 +1,47 @@ +WALLET=new_storage_wallet.json +GAS?=1000 + +INNERRING_IP?=$(call docker_ip,ir01) +MORPH_IP?=$(call docker_ip,morph_chain) +MORPH_ENDPOINT=http://$(MORPH_IP):30333 + +ADM=../vendor/frostfs-adm +CLI=../vendor/frostfs-cli +NEO=./bin/neo-go +NODE=./bin/frostfs-node + +.PHONY: up +up: wallet | $(NEO) $(NODE) + $(NEO) wallet nep17 balance -r $(MORPH_ENDPOINT) -w $(WALLET) + $(ADM) morph refill-gas --storage-wallet $(WALLET) --gas $(GAS) \ + --rpc-endpoint $(MORPH_ENDPOINT) --alphabet-wallets ../services/ir \ + --config ../frostfs-adm.yml + $(NEO) wallet nep17 balance -r $(MORPH_ENDPOINT) -w $(WALLET) + $(NODE) --config-dir config & + NODE_PID=$$! + sleep 10 + kill $$NODE_PID + $(NEO) wallet nep17 balance -r $(MORPH_ENDPOINT) -w $(WALLET) + +.PHONY: wallet +wallet: | $(NEO) + rm $(WALLET) || true + $(NEO) wallet init --account --wallet-config new_storage_wallet.template + +$(NEO): + mkdir -p $(dir $@) + curl -o $@ -sSL https://github.com/nspcc-dev/neo-go/releases/download/v0.106.3/neo-go-linux-amd64 + chmod +x $@ + +$(NODE): + mkdir -p $(dir $@) + curl -o $@ -sSL https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v0.42.9/frostfs-node + chmod +x $@ + +define docker_ip +$(firstword $(shell docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}} {{end}}' $(1))) +endef + +SHELL=/bin/bash +.SHELLFLAGS=-euo pipefail -c +.ONESHELL: diff --git a/extra/config/devenv.yml b/extra/config/devenv.yml new file mode 120000 index 0000000..4ee37d4 --- /dev/null +++ b/extra/config/devenv.yml @@ -0,0 +1 @@ +../../services/storage/cfg/config.yml \ No newline at end of file diff --git a/extra/config/extra.yml b/extra/config/extra.yml new file mode 100644 index 0000000..86fc3ed --- /dev/null +++ b/extra/config/extra.yml @@ -0,0 +1,77 @@ +logger: + loki: + enabled: false + +pprof: + enabled: false + +prometheus: + enabled: false + +tracing: + enabled: false + +morph: + rpc_endpoint: # Side chain NEO RPC endpoints + - address: ws://morph-chain.frostfs.devenv:30333/ws + priority: 1 + +# Common storage node settings +node: + wallet: + path: new_storage_wallet.json + password: "" + addresses: + - grpc://s01.frostfs.devenv:8080 + notification: + enabled: false + +grpc: + - endpoint: 127.0.88.1:8802 + tls: + enabled: false + +tree: + enabled: true + +storage: + shard: + 0: + writecache: + enabled: true + path: storage/wc0 # Write-cache root directory + + metabase: + path: storage/meta0 # Path to the metabase + + blobstor: + - type: blobovnicza + path: storage/blobovnicza0 # Blobovnicza root directory + depth: 2 + width: 4 + - type: fstree + path: storage/fstree0 # FSTree root directory + depth: 2 + + pilorama: + path: storage/pilorama0 # Path to the pilorama database + + 1: + writecache: + enabled: true + path: storage/wc1 # Write-cache root directory + + metabase: + path: storage/meta1 # Path to the metabase + + blobstor: + - type: blobovnicza + path: storage/blobovnicza1 # Blobovnicza root directory + depth: 2 + width: 4 + - type: fstree + path: storage/fstree1 # FSTree root directory + depth: 2 + + pilorama: + path: storage/pilorama1 # Path to the pilorama database diff --git a/extra/new_storage_wallet.template b/extra/new_storage_wallet.template new file mode 100644 index 0000000..c6c60bd --- /dev/null +++ b/extra/new_storage_wallet.template @@ -0,0 +1,2 @@ +Path: new_storage_wallet.json +Password: ""