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

Function initialize_datadir

test/functional/test_framework/util.py:291–307  ·  view source on GitHub ↗
(dirname, n)

Source from the content-addressed store, hash-verified

289################
290
291def initialize_datadir(dirname, n):
292 datadir = get_datadir_path(dirname, n)
293 if not os.path.isdir(datadir):
294 os.makedirs(datadir)
295 with open(os.path.join(datadir, "bitcoingold.conf"), 'w', encoding='utf8') as f:
296 f.write("regtest=1\n")
297 f.write("[regtest]\n")
298 f.write("port=" + str(p2p_port(n)) + "\n")
299 f.write("rpcport=" + str(rpc_port(n)) + "\n")
300 f.write("server=1\n")
301 f.write("keypool=1\n")
302 f.write("discover=0\n")
303 f.write("listenonion=0\n")
304 f.write("printtoconsole=0\n")
305 os.makedirs(os.path.join(datadir, 'stderr'), exist_ok=True)
306 os.makedirs(os.path.join(datadir, 'stdout'), exist_ok=True)
307 return datadir
308
309def get_datadir_path(dirname, n):
310 return os.path.join(dirname, "node" + str(n))

Callers 3

run_testMethod · 0.90
_initialize_chainMethod · 0.85

Calls 5

get_datadir_pathFunction · 0.85
p2p_portFunction · 0.85
rpc_portFunction · 0.85
joinMethod · 0.80
writeMethod · 0.45

Tested by 2

_initialize_chainMethod · 0.68