Add possibility to import different dump of chains
- import dump only if `node` sub command passed - ACC env variable default value is `6000-privnet-blocks.acc.gz` - ACC env variable can be declared in `docker-compose` - ACC env variable can be one of: - `/6000-privnet-blocks.acc.gz` - `/1600-privnet-blocks-single.acc.gz` - custom path to dump of blockchain
This commit is contained in:
parent
9e92749b05
commit
2cb2a6d320
1 changed files with 17 additions and 4 deletions
|
@ -1,6 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if test -f /privnet-blocks.acc.gz; then
|
|
||||||
gunzip /privnet-blocks.acc.gz
|
BIN=/usr/bin/neo-go
|
||||||
/usr/bin/neo-go db restore -i /privnet-blocks.acc
|
|
||||||
|
if [ -z "$ACC"]; then
|
||||||
|
ACC=/6000-privnet-blocks.acc.gz
|
||||||
fi
|
fi
|
||||||
/usr/bin/neo-go "$@"
|
|
||||||
|
case $@ in
|
||||||
|
"node"*)
|
||||||
|
echo "=> Try to restore blocks before running node"
|
||||||
|
if test -f $ACC; then
|
||||||
|
gunzip --stdout /$ACC > /privnet.acc
|
||||||
|
${BIN} db restore -p --config-path /config -i /privnet.acc
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
${BIN} "$@"
|
||||||
|
|
Loading…
Reference in a new issue