Changeset View
Changeset View
Standalone View
Standalone View
qa/rpc-tests/test_framework/util.py
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | def initialize_datadir(dirname, n): | ||||
rpc_u, rpc_p = rpc_auth_pair(n) | rpc_u, rpc_p = rpc_auth_pair(n) | ||||
with open(os.path.join(datadir, "bitcoin.conf"), 'w', encoding='utf8') as f: | with open(os.path.join(datadir, "bitcoin.conf"), 'w', encoding='utf8') as f: | ||||
f.write("regtest=1\n") | f.write("regtest=1\n") | ||||
f.write("rpcuser=" + rpc_u + "\n") | f.write("rpcuser=" + rpc_u + "\n") | ||||
f.write("rpcpassword=" + rpc_p + "\n") | f.write("rpcpassword=" + rpc_p + "\n") | ||||
f.write("port=" + str(p2p_port(n)) + "\n") | f.write("port=" + str(p2p_port(n)) + "\n") | ||||
f.write("rpcport=" + str(rpc_port(n)) + "\n") | f.write("rpcport=" + str(rpc_port(n)) + "\n") | ||||
f.write("listenonion=0\n") | f.write("listenonion=0\n") | ||||
f.write("usecashaddr=1\n") | |||||
return datadir | return datadir | ||||
def rpc_auth_pair(n): | def rpc_auth_pair(n): | ||||
return 'rpcuser💻' + str(n), 'rpcpass🔑' + str(n) | return 'rpcuser💻' + str(n), 'rpcpass🔑' + str(n) | ||||
def rpc_url(i, rpchost=None): | def rpc_url(i, rpchost=None): | ||||
▲ Show 20 Lines • Show All 674 Lines • Show Last 20 Lines |