Ejemplo n.º 1
0
 def start_wallet(self):
     if not os.path.isdir(self.wallet_state):
         os.makedirs(self.wallet_state)
     start_background_proc(
         self.keosd_dir +
         ' --unlock-timeout %d --http-server-address 127.0.0.1:8999' %
         (self.unlockTimeout),
         log_file(join(self.wallet_state, 'stderr.txt')),
         join(self.wallet_state, 'keosd.pid'))
     sleep(.4)
Ejemplo n.º 2
0
 def start(self, delay_time=1.0):
     if not os.path.isdir(self.path):
         os.makedirs(self.path)
     cmd = NodeFactory.nodeos_dir + ' --config-dir %s --genesis-json %s --delete-all-blocks'
     genesis_dir = join(self.path, 'genesis.json')
     print('Starting node: %s' % self.name)
     start_background_proc(cmd % (self.path, genesis_dir),
                           log_file(join(self.path, 'stderr.txt')),
                           join(self.path, 'node.pid'))
     sleep(delay_time)
Ejemplo n.º 3
0
 def restart(self, delay_time=1.0):
     if self.is_running():
         self.stop()
     if os.path.isdir(self.path):
         cmd = NodeFactory.nodeos_dir + ' --config-dir %s --hard-replay-blockchain'
         start_background_proc(cmd % self.path,
                               log_file(join(self.path, 'stderr.txt')),
                               join(self.path, 'node.pid'))
         sleep(delay_time)
     else:
         print('nodeos folder path: %s does not exist' % self.path)
Ejemplo n.º 4
0
 def start(self, delay_time=1.0, flags={}):
     print(flags)
     if not os.path.isdir(self.path):
         os.makedirs(self.path)
     cmd = NodeFactory.nodeos + ' --config-dir %s --genesis-json %s --delete-all-blocks'
     for key in flags:
         cmd += " --{} {}".format(key, flags[key])
     genesis_dir = join(self.path, 'genesis.json')
     print('Starting node: %s' % self.name)
     start_background_proc(cmd % (self.path, genesis_dir),
                           log_file(join(self.path, 'stderr.txt')),
                           join(self.path, 'node.pid'))
     sleep(delay_time)