def build0(cls, *_): os.makedirs(Makefile.build_path, exist_ok=True) if not os.path.isfile( os.path.join(Makefile.build_path, 'node100/config/genesis.json')): pipe( 'docker run --rm -v %s/:/tendermint:Z %s init --home /tendermint/node100' % (Makefile.build_path, Makefile.node_name)) pipe('docker-compose -f %s up' % (Makefile.compose_run_file0))
def build(cls, *_): os.makedirs(Makefile.build_path, exist_ok=True) if not os.path.isfile( os.path.join(Makefile.build_path, 'node0/config/genesis.json')): pipe( 'docker run --rm -v %s/:/tendermint:Z %s testnet --v %s --o . --populate-persistent-peers --starting-ip-address 192.167.233.2' % (Makefile.build_path, Makefile.node_name, Makefile.count)) pipe('docker-compose -f %s up' % (Makefile.compose_run_file))
def pipe(cls, cmd, *_): if not cls.silent: print(cmd) pipe(cmd)
def down(cls, *_): pipe('docker-compose -f %s down' % (cls.compose_file))
def up(cls, *_): pipe('docker-compose -f %s up' % (cls.compose_file))
def stop(cls, *_): pipe('docker-compose -f %s stop' % (cls.compose_file))
def start(cls, *_): pipe('docker-compose -f %s start' % (cls.compose_file))
def down0(cls, *_): pipe('docker-compose -f %s down' % (Makefile.compose_run_file0))
def restart(cls, *_): pipe('docker-compose -f %s restart' % (Makefile.compose_run_file))
def stop(cls, *_): pipe('docker-compose -f %s stop' % (Makefile.compose_run_file))
def tendermint(cls, *_): os.makedirs(Makefile.build_path, exist_ok=True) if not os.path.isfile(Makefile.tendermint_file_path): pipe( 'curl -o %s -L https://github.com/HyperService-Consortium/NSB/releases/download/v0.7.4/tendermint-linux-v0.32.2-8ba8497a' % (Makefile.tendermint_file_path, ))
def image(cls, *_): pipe('cp build/NSB node/NSB') pipe('docker build --tag %s node' % Makefile.node_name)
def clean(cls, *_): pipe('rm -rf -r %s/node*' % (Makefile.build_path)) pipe('rm -rf -r %s/data*' % (Makefile.build_path)) pipe('rm -rf -r %s/nsbstate.db' % (Makefile.build_path)) pipe('rm -rf -r %s/trienode.db' % (Makefile.build_path))
def start0(cls, *_): pipe('docker-compose -f %s start' % (Makefile.compose_run_file0))