|
|
@ -46,7 +46,7 @@ known_coins = { |
|
|
|
'litecoin': '0.18.1', |
|
|
|
'litecoin': '0.18.1', |
|
|
|
'bitcoin': '0.20.1', |
|
|
|
'bitcoin': '0.20.1', |
|
|
|
'namecoin': '0.18.0', |
|
|
|
'namecoin': '0.18.0', |
|
|
|
'monero': '0.17.0.1', |
|
|
|
'monero': '0.17.1.5', |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logger = logging.getLogger() |
|
|
|
logger = logging.getLogger() |
|
|
@ -86,6 +86,22 @@ def extractCore(coin, version, settings, bin_dir, release_path): |
|
|
|
|
|
|
|
|
|
|
|
bins = [coin + 'd', coin + '-cli', coin + '-tx'] |
|
|
|
bins = [coin + 'd', coin + '-cli', coin + '-tx'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if coin == 'monero': |
|
|
|
|
|
|
|
with tarfile.open(release_path) as ft: |
|
|
|
|
|
|
|
for member in ft.getmembers(): |
|
|
|
|
|
|
|
if member.isdir(): |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
out_path = os.path.join(bin_dir, os.path.basename(member.name)) |
|
|
|
|
|
|
|
fi = ft.extractfile(member) |
|
|
|
|
|
|
|
with open(out_path, 'wb') as fout: |
|
|
|
|
|
|
|
fout.write(fi.read()) |
|
|
|
|
|
|
|
fi.close() |
|
|
|
|
|
|
|
os.chmod(out_path, stat.S_IRWXU | stat.S_IXGRP | stat.S_IXOTH) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print('member', member) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bins = [coin + 'd', coin + '-cli', coin + '-tx'] |
|
|
|
versions = version.split('.') |
|
|
|
versions = version.split('.') |
|
|
|
if coin == 'particl' and int(versions[1]) >= 19: |
|
|
|
if coin == 'particl' and int(versions[1]) >= 19: |
|
|
|
bins.append(coin + '-wallet') |
|
|
|
bins.append(coin + '-wallet') |
|
|
@ -125,17 +141,21 @@ def prepareCore(coin, version, settings, data_dir): |
|
|
|
os_dir_name = 'linux' |
|
|
|
os_dir_name = 'linux' |
|
|
|
os_name = 'linux' |
|
|
|
os_name = 'linux' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
release_filename = '{}-{}-{}'.format(coin, version, BIN_ARCH) |
|
|
|
if coin == 'monero': |
|
|
|
if coin == 'monero': |
|
|
|
url = 'https://downloads.getmonero.org/cli/monero-linux-x64-v${}.tar.bz2'.format(version) |
|
|
|
release_url = 'https://downloads.getmonero.org/cli/monero-linux-x64-v{}.tar.bz2'.format(version) |
|
|
|
|
|
|
|
|
|
|
|
# TODO |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
release_path = os.path.join(bin_dir, release_filename) |
|
|
|
release_path = os.path.join(bin_dir, release_filename) |
|
|
|
if not os.path.exists(release_path): |
|
|
|
if not os.path.exists(release_path): |
|
|
|
downloadFile(release_url, release_path) |
|
|
|
downloadFile(release_url, release_path) |
|
|
|
|
|
|
|
|
|
|
|
raise ValueError('TODO') |
|
|
|
# TODO: How to get version specific hashes |
|
|
|
|
|
|
|
assert_filename = 'monero-{}-hashes.txt'.format(version) |
|
|
|
|
|
|
|
assert_url = 'https://www.getmonero.org/downloads/hashes.txt' |
|
|
|
|
|
|
|
assert_path = os.path.join(bin_dir, assert_filename) |
|
|
|
|
|
|
|
if not os.path.exists(assert_path): |
|
|
|
|
|
|
|
downloadFile(assert_url, assert_path) |
|
|
|
|
|
|
|
else: |
|
|
|
release_filename = '{}-{}-{}'.format(coin, version, BIN_ARCH) |
|
|
|
release_filename = '{}-{}-{}'.format(coin, version, BIN_ARCH) |
|
|
|
if coin == 'particl': |
|
|
|
if coin == 'particl': |
|
|
|
signing_key_name = 'tecnovert' |
|
|
|
signing_key_name = 'tecnovert' |
|
|
@ -197,6 +217,21 @@ def prepareCore(coin, version, settings, data_dir): |
|
|
|
""" |
|
|
|
""" |
|
|
|
gpg = gnupg.GPG() |
|
|
|
gpg = gnupg.GPG() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if coin == 'monero': |
|
|
|
|
|
|
|
with open(assert_path, 'rb') as fp: |
|
|
|
|
|
|
|
verified = gpg.verify_file(fp) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if verified.username is None: |
|
|
|
|
|
|
|
logger.warning('Signature not verified.') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pubkeyurl = 'https://raw.githubusercontent.com/monero-project/monero/master/utils/gpg_keys/binaryfate.asc' |
|
|
|
|
|
|
|
logger.info('Importing public key from url: ' + pubkeyurl) |
|
|
|
|
|
|
|
rv = gpg.import_keys(urllib.request.urlopen(pubkeyurl).read()) |
|
|
|
|
|
|
|
assert('F0AF4D462A0BDF92' in rv) |
|
|
|
|
|
|
|
print('import_keys', rv) |
|
|
|
|
|
|
|
with open(assert_path, 'rb') as fp: |
|
|
|
|
|
|
|
verified = gpg.verify_file(fp) |
|
|
|
|
|
|
|
else: |
|
|
|
with open(assert_sig_path, 'rb') as fp: |
|
|
|
with open(assert_sig_path, 'rb') as fp: |
|
|
|
verified = gpg.verify_file(fp, assert_path) |
|
|
|
verified = gpg.verify_file(fp, assert_path) |
|
|
|
|
|
|
|
|
|
|
@ -449,6 +484,17 @@ def main(): |
|
|
|
'conf_target': 2, |
|
|
|
'conf_target': 2, |
|
|
|
'core_version_group': 18, |
|
|
|
'core_version_group': 18, |
|
|
|
'chain_lookups': 'local', |
|
|
|
'chain_lookups': 'local', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'monero': { |
|
|
|
|
|
|
|
'connection_type': 'rpc' if 'monero' in with_coins else 'none', |
|
|
|
|
|
|
|
'manage_daemon': True if 'monero' in with_coins else False, |
|
|
|
|
|
|
|
'rpcport': 29798 + port_offset, |
|
|
|
|
|
|
|
'walletrpcport': 29799 + port_offset, |
|
|
|
|
|
|
|
#'walletrpcuser': 'test' + str(node_id), |
|
|
|
|
|
|
|
#'walletrpcpassword': 'test_pass' + str(node_id), |
|
|
|
|
|
|
|
'walletfile': 'basicswap', |
|
|
|
|
|
|
|
'datadir': os.path.join(data_dir, 'monero'), |
|
|
|
|
|
|
|
'bindir': os.path.join(bin_dir, 'monero'), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|