コード例 #1
0
 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!")
コード例 #2
0
ファイル: test.py プロジェクト: stephantual/DAO
 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!")
コード例 #3
0
 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!")
コード例 #4
0
ファイル: test.py プロジェクト: ether-camp/DAO
 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!")