-
Notifications
You must be signed in to change notification settings - Fork 0
/
v0.1.38.sh
42 lines (40 loc) · 2.24 KB
/
v0.1.38.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
echo "-----------------------------------------------------------------------------"
curl -s https://raw.githubusercontent.com/razumv/helpers/main/doubletop.sh | bash
echo "-----------------------------------------------------------------------------"
sudo apt update &>/dev/null
sudo apt install jq -y &>/dev/null
blockGraffiti=`docker exec ironfish ./bin/run config:show | jq -r .blockGraffiti`
nodeName=`docker exec ironfish ./bin/run config:show | jq -r .nodeName`
cd $HOME
var=`docker-compose logs --tail=1000 ironfish | grep "Added block to fork seq"`
if [ -z "$var" ]
then
echo "выполняем обновление"
echo "-----------------------------------------------------------------------------"
docker-compose run --rm --entrypoint "./bin/run config:set minerBatchSize 60000" ironfish
docker-compose run --rm --entrypoint "./bin/run config:set enableTelemetry true" ironfish
docker-compose down
docker-compose pull
docker-compose up -d
else
echo "выполняем сброс и обновление"
echo "-----------------------------------------------------------------------------"
wallet_name=`docker exec ironfish ./bin/run accounts:which` &>/dev/null
docker exec ironfish rm -f wallet &>/dev/null
docker exec ironfish ./bin/run accounts:export $wallet_name wallet &>/dev/null
docker cp ironfish:/usr/src/app/wallet .
docker-compose down
docker-compose pull
rm -f $HOME/.ironfish/accounts.backup.json
docker-compose run --rm --entrypoint "./bin/run reset --confirm" ironfish
docker-compose run -v $HOME/wallet:/usr/src/app/wallet --rm --entrypoint "./bin/run accounts:import wallet" ironfish
docker-compose run --rm --entrypoint "./bin/run accounts:use $wallet_name" ironfish &>/dev/null
docker-compose run --rm --entrypoint "./bin/run config:set nodeName $nodeName" ironfish
docker-compose run --rm --entrypoint "./bin/run config:set blockGraffiti $blockGraffiti" ironfish
docker-compose run --rm --entrypoint "./bin/run config:set minerBatchSize 60000" ironfish
docker-compose run --rm --entrypoint "./bin/run config:set enableTelemetry true" ironfish
docker-compose up -d
fi
echo "Обновление завершено"
echo "-----------------------------------------------------------------------------"