def create_accounts(self, accounts_num): print("Creating accounts and genesis block ...") with open(os.path.join(self.templates_dir, 'accounts.template.js'), 'r') as f: data = f.read() tmpl = Template(data) s = tmpl.substitute(accounts_number=accounts_num) with open('accounts.js', "w") as f: f.write(s) output = self.run_script('accounts.js') self.accounts = json.loads(output) # creating genesis block with a generous allocation for all accounts create_genesis(self.accounts) print("Done!")
def create_accounts(self, accounts_num): print("Creating accounts and genesis block ...") with open( os.path.join(self.templates_dir, 'accounts.template.js'), 'r' ) as f: data = f.read() tmpl = Template(data) s = tmpl.substitute(accounts_number=accounts_num) with open('accounts.js', "w") as f: f.write(s) output = self.run_script('accounts.js') self.accounts = json.loads(output) # creating genesis block with a generous allocation for all accounts create_genesis(self.accounts) print("Done!")
def init_data(self, accounts_num): print("Creating accounts and genesis block ...") with open(os.path.join(self.templates_dir, 'accounts.template.js'), 'r') as f: data = f.read() tmpl = Template(data) s = tmpl.substitute(accounts_number=accounts_num) with open('accounts.js', "w") as f: f.write(s) output = self.run_script('accounts.js') self.accounts = json.loads(output) # creating genesis block with a generous allocation for all accounts create_genesis(self.accounts) # now initialize geth with the new blockchain subprocess.check_output( [self.geth, "--datadir", "./data", "init", "./genesis_block.json"]) print("Done!")
def init_data(self, accounts_num): print("Creating accounts and genesis block ...") with open( os.path.join(self.templates_dir, 'accounts.template.js'), 'r' ) as f: data = f.read() tmpl = Template(data) s = tmpl.substitute(accounts_number=accounts_num) with open('accounts.js', "w") as f: f.write(s) output = self.run_script('accounts.js') self.accounts = json.loads(output) # creating genesis block with a generous allocation for all accounts create_genesis(self.accounts) # now initialize geth with the new blockchain subprocess.check_output([ self.geth, "--datadir", "./data", "init", "./genesis_block.json" ]) print("Done!")