MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / setup_chain

Method setup_chain

test/functional/rpc_users.py:28–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 self.num_nodes = 2
27
28 def setup_chain(self):
29 super().setup_chain()
30 #Append rpcauth to bitcoingold.conf before initialization
31 rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
32 rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e"
33 rpcuser = "rpcuser=rpcuser💻"
34 rpcpassword = "rpcpassword=rpcpassword🔑"
35
36 self.user = ''.join(SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(10))
37 config = configparser.ConfigParser()
38 config.read_file(open(self.options.configfile))
39 gen_rpcauth = config['environment']['RPCAUTH']
40 p = subprocess.Popen([sys.executable, gen_rpcauth, self.user], stdout=subprocess.PIPE, universal_newlines=True)
41 lines = p.stdout.read().splitlines()
42 rpcauth3 = lines[1]
43 self.password = lines[3]
44
45 with open(os.path.join(get_datadir_path(self.options.tmpdir, 0), "bitcoingold.conf"), 'a', encoding='utf8') as f:
46 f.write(rpcauth+"\n")
47 f.write(rpcauth2+"\n")
48 f.write(rpcauth3+"\n")
49 with open(os.path.join(get_datadir_path(self.options.tmpdir, 1), "bitcoingold.conf"), 'a', encoding='utf8') as f:
50 f.write(rpcuser+"\n")
51 f.write(rpcpassword+"\n")
52
53 def run_test(self):
54

Callers

nothing calls this directly

Calls 4

get_datadir_pathFunction · 0.90
joinMethod · 0.80
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected