forked from TrueCloudLab/frostfs-dev-env
47 lines
1.3 KiB
Makefile
47 lines
1.3 KiB
Makefile
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:
|