mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-09 12:19:29 +00:00
Raise core versions.
Litecoin .17 -> .18 pidfile name changed from litecoin.pid -> litecoind.pid
This commit is contained in:
parent
e3b2213fe1
commit
7928625a7b
6 changed files with 57 additions and 50 deletions
|
@ -7,9 +7,9 @@ stages:
|
||||||
- test
|
- test
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- PART_VERSION=0.18.1.6
|
- PART_VERSION=0.19.1.1
|
||||||
- BTC_VERSION=0.19.0.1
|
- BTC_VERSION=0.20.1
|
||||||
- LTC_VERSION=0.17.1
|
- LTC_VERSION=0.18.1
|
||||||
- TEST_DIR=~/test_basicswap2/
|
- TEST_DIR=~/test_basicswap2/
|
||||||
- TEST_RELOAD_PATH=~/test_basicswap1/
|
- TEST_RELOAD_PATH=~/test_basicswap1/
|
||||||
- BIN_DIRS=~/binaries
|
- BIN_DIRS=~/binaries
|
||||||
|
@ -23,7 +23,7 @@ before_install:
|
||||||
- sudo apt-get install -y wget gnupg2
|
- sudo apt-get install -y wget gnupg2
|
||||||
before_script:
|
before_script:
|
||||||
- if [ ! -d "$BIN_DIRS" ]; then mkdir -p "$BIN_DIRS" ; fi
|
- if [ ! -d "$BIN_DIRS" ]; then mkdir -p "$BIN_DIRS" ; fi
|
||||||
- if [ ! -d "$PARTICL_BINDIR" ]; then cd "$BIN_DIRS" && wget https://github.com/particl/particl-core/releases/download/v${PART_VERSION}/particl-${PART_VERSION}-x86_64-linux-gnu.tar.gz && tar xvf particl-${PART_VERSION}-x86_64-linux-gnu.tar.gz ; fi
|
- if [ ! -d "$PARTICL_BINDIR" ]; then cd "$BIN_DIRS" && wget https://github.com/tecnovert/particl-core/releases/download/v${PART_VERSION}/particl-${PART_VERSION}-x86_64-linux-gnu.tar.gz && tar xvf particl-${PART_VERSION}-x86_64-linux-gnu.tar.gz ; fi
|
||||||
- if [ ! -d "$BITCOIN_BINDIR" ]; then cd "$BIN_DIRS" && wget https://bitcoincore.org/bin/bitcoin-core-${BTC_VERSION}/bitcoin-${BTC_VERSION}-x86_64-linux-gnu.tar.gz && tar xvf bitcoin-${BTC_VERSION}-x86_64-linux-gnu.tar.gz ; fi
|
- if [ ! -d "$BITCOIN_BINDIR" ]; then cd "$BIN_DIRS" && wget https://bitcoincore.org/bin/bitcoin-core-${BTC_VERSION}/bitcoin-${BTC_VERSION}-x86_64-linux-gnu.tar.gz && tar xvf bitcoin-${BTC_VERSION}-x86_64-linux-gnu.tar.gz ; fi
|
||||||
- if [ ! -d "$LITECOIN_BINDIR" ]; then cd "$BIN_DIRS" && wget https://download.litecoin.org/litecoin-${LTC_VERSION}/linux/litecoin-${LTC_VERSION}-x86_64-linux-gnu.tar.gz && tar xvf litecoin-${LTC_VERSION}-x86_64-linux-gnu.tar.gz ; fi
|
- if [ ! -d "$LITECOIN_BINDIR" ]; then cd "$BIN_DIRS" && wget https://download.litecoin.org/litecoin-${LTC_VERSION}/linux/litecoin-${LTC_VERSION}-x86_64-linux-gnu.tar.gz && tar xvf litecoin-${LTC_VERSION}-x86_64-linux-gnu.tar.gz ; fi
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -424,7 +424,7 @@ class BasicSwap(BaseApp):
|
||||||
authcookiepath = os.path.join(self.getChainDatadirPath(coin), '.cookie')
|
authcookiepath = os.path.join(self.getChainDatadirPath(coin), '.cookie')
|
||||||
|
|
||||||
pidfilename = cc['name']
|
pidfilename = cc['name']
|
||||||
if cc['name'] == 'bitcoin' or cc['name'] == 'namecoin':
|
if cc['name'] == 'bitcoin' or cc['name'] == 'litecoin' or cc['name'] == 'namecoin':
|
||||||
pidfilename += 'd'
|
pidfilename += 'd'
|
||||||
pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
|
pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
|
||||||
self.log.debug('Reading %s rpc credentials from auth cookie %s', coin, authcookiepath)
|
self.log.debug('Reading %s rpc credentials from auth cookie %s', coin, authcookiepath)
|
||||||
|
|
|
@ -12,22 +12,23 @@ CONFIG_FILENAME = 'basicswap.json'
|
||||||
DEFAULT_DATADIR = '~/.basicswap'
|
DEFAULT_DATADIR = '~/.basicswap'
|
||||||
TEST_DATADIRS = os.path.expanduser(os.getenv('DATADIRS', '/tmp/basicswap'))
|
TEST_DATADIRS = os.path.expanduser(os.getenv('DATADIRS', '/tmp/basicswap'))
|
||||||
|
|
||||||
|
bin_suffix = ('.exe' if os.name == 'nt' else '')
|
||||||
PARTICL_BINDIR = os.path.expanduser(os.getenv('PARTICL_BINDIR', ''))
|
PARTICL_BINDIR = os.path.expanduser(os.getenv('PARTICL_BINDIR', ''))
|
||||||
PARTICLD = os.getenv('PARTICLD', 'particld' + ('.exe' if os.name == 'nt' else ''))
|
PARTICLD = os.getenv('PARTICLD', 'particld' + bin_suffix)
|
||||||
PARTICL_CLI = os.getenv('PARTICL_CLI', 'particl-cli' + ('.exe' if os.name == 'nt' else ''))
|
PARTICL_CLI = os.getenv('PARTICL_CLI', 'particl-cli' + bin_suffix)
|
||||||
PARTICL_TX = os.getenv('PARTICL_TX', 'particl-tx' + ('.exe' if os.name == 'nt' else ''))
|
PARTICL_TX = os.getenv('PARTICL_TX', 'particl-tx' + bin_suffix)
|
||||||
|
|
||||||
BITCOIN_BINDIR = os.path.expanduser(os.getenv('BITCOIN_BINDIR', ''))
|
BITCOIN_BINDIR = os.path.expanduser(os.getenv('BITCOIN_BINDIR', ''))
|
||||||
BITCOIND = os.getenv('BITCOIND', 'bitcoind' + ('.exe' if os.name == 'nt' else ''))
|
BITCOIND = os.getenv('BITCOIND', 'bitcoind' + bin_suffix)
|
||||||
BITCOIN_CLI = os.getenv('BITCOIN_CLI', 'bitcoin-cli' + ('.exe' if os.name == 'nt' else ''))
|
BITCOIN_CLI = os.getenv('BITCOIN_CLI', 'bitcoin-cli' + bin_suffix)
|
||||||
BITCOIN_TX = os.getenv('BITCOIN_TX', 'bitcoin-tx' + ('.exe' if os.name == 'nt' else ''))
|
BITCOIN_TX = os.getenv('BITCOIN_TX', 'bitcoin-tx' + bin_suffix)
|
||||||
|
|
||||||
LITECOIN_BINDIR = os.path.expanduser(os.getenv('LITECOIN_BINDIR', ''))
|
LITECOIN_BINDIR = os.path.expanduser(os.getenv('LITECOIN_BINDIR', ''))
|
||||||
LITECOIND = os.getenv('LITECOIND', 'litecoind' + ('.exe' if os.name == 'nt' else ''))
|
LITECOIND = os.getenv('LITECOIND', 'litecoind' + bin_suffix)
|
||||||
LITECOIN_CLI = os.getenv('LITECOIN_CLI', 'litecoin-cli' + ('.exe' if os.name == 'nt' else ''))
|
LITECOIN_CLI = os.getenv('LITECOIN_CLI', 'litecoin-cli' + bin_suffix)
|
||||||
LITECOIN_TX = os.getenv('LITECOIN_TX', 'litecoin-tx' + ('.exe' if os.name == 'nt' else ''))
|
LITECOIN_TX = os.getenv('LITECOIN_TX', 'litecoin-tx' + bin_suffix)
|
||||||
|
|
||||||
NAMECOIN_BINDIR = os.path.expanduser(os.getenv('NAMECOIN_BINDIR', ''))
|
NAMECOIN_BINDIR = os.path.expanduser(os.getenv('NAMECOIN_BINDIR', ''))
|
||||||
NAMECOIND = os.getenv('NAMECOIND', 'namecoind' + ('.exe' if os.name == 'nt' else ''))
|
NAMECOIND = os.getenv('NAMECOIND', 'namecoind' + bin_suffix)
|
||||||
NAMECOIN_CLI = os.getenv('NAMECOIN_CLI', 'namecoin-cli' + ('.exe' if os.name == 'nt' else ''))
|
NAMECOIN_CLI = os.getenv('NAMECOIN_CLI', 'namecoin-cli' + bin_suffix)
|
||||||
NAMECOIN_TX = os.getenv('NAMECOIN_TX', 'namecoin-tx' + ('.exe' if os.name == 'nt' else ''))
|
NAMECOIN_TX = os.getenv('NAMECOIN_TX', 'namecoin-tx' + bin_suffix)
|
||||||
|
|
|
@ -113,7 +113,7 @@ def callrpc(rpc_port, auth, method, params=[], wallet=None):
|
||||||
def callrpc_cli(bindir, datadir, chain, cmd, cli_bin='particl-cli'):
|
def callrpc_cli(bindir, datadir, chain, cmd, cli_bin='particl-cli'):
|
||||||
cli_bin = os.path.join(bindir, cli_bin)
|
cli_bin = os.path.join(bindir, cli_bin)
|
||||||
|
|
||||||
args = cli_bin + ('' if chain == 'mainnet' else ' -' + chain) + ' -datadir=' + datadir + ' ' + cmd
|
args = cli_bin + ('' if chain == 'mainnet' else (' -' + chain)) + ' -datadir=' + datadir + ' ' + cmd
|
||||||
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
out = p.communicate()
|
out = p.communicate()
|
||||||
|
|
||||||
|
|
66
bin/basicswap_prepare.py
Normal file → Executable file
66
bin/basicswap_prepare.py
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (c) 2019 tecnovert
|
# Copyright (c) 2019-2020 tecnovert
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php.
|
# file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ else:
|
||||||
BIN_ARCH = 'x86_64-linux-gnu.tar.gz'
|
BIN_ARCH = 'x86_64-linux-gnu.tar.gz'
|
||||||
|
|
||||||
known_coins = {
|
known_coins = {
|
||||||
'particl': '0.18.1.6',
|
'particl': '0.19.1.1',
|
||||||
'litecoin': '0.17.1',
|
'litecoin': '0.18.1',
|
||||||
'bitcoin': '0.19.0.1',
|
'bitcoin': '0.20.1',
|
||||||
'namecoin': '0.18.0',
|
'namecoin': '0.18.0',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,33 @@ def downloadFile(url, path):
|
||||||
urlretrieve(url, path, make_reporthook())
|
urlretrieve(url, path, make_reporthook())
|
||||||
|
|
||||||
|
|
||||||
|
def extractCore(coin, version, settings, bin_dir, release_path):
|
||||||
|
logger.info('extractCore %s v%s', coin, version)
|
||||||
|
|
||||||
|
bins = [coin + 'd', coin + '-cli', coin + '-tx']
|
||||||
|
|
||||||
|
versions = version.split('.')
|
||||||
|
if coin == 'particl' and int(versions[1]) >= 19:
|
||||||
|
bins.append(coin + '-wallet')
|
||||||
|
if 'win32' in BIN_ARCH or 'win64' in BIN_ARCH:
|
||||||
|
with zipfile.ZipFile(release_path) as fz:
|
||||||
|
for b in bins:
|
||||||
|
b += '.exe'
|
||||||
|
out_path = os.path.join(bin_dir, b)
|
||||||
|
with open(out_path, 'wb') as fout:
|
||||||
|
fout.write(fz.read('{}-{}/bin/{}'.format(coin, version, b)))
|
||||||
|
os.chmod(out_path, stat.S_IRWXU | stat.S_IXGRP | stat.S_IXOTH)
|
||||||
|
else:
|
||||||
|
with tarfile.open(release_path) as ft:
|
||||||
|
for b in bins:
|
||||||
|
out_path = os.path.join(bin_dir, b)
|
||||||
|
fi = ft.extractfile('{}-{}/bin/{}'.format(coin, version, b))
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
def prepareCore(coin, version, settings, data_dir):
|
def prepareCore(coin, version, settings, data_dir):
|
||||||
logger.info('prepareCore %s v%s', coin, version)
|
logger.info('prepareCore %s v%s', coin, version)
|
||||||
|
|
||||||
|
@ -100,9 +127,9 @@ def prepareCore(coin, version, settings, data_dir):
|
||||||
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'
|
||||||
release_url = 'https://github.com/particl/particl-core/releases/download/v{}/{}'.format(version, release_filename)
|
release_url = 'https://github.com/tecnovert/particl-core/releases/download/v{}/{}'.format(version, release_filename)
|
||||||
assert_filename = '{}-{}-{}-build.assert'.format(coin, os_name, version)
|
assert_filename = '{}-{}-{}-build.assert'.format(coin, os_name, version)
|
||||||
assert_url = 'https://raw.githubusercontent.com/particl/gitian.sigs/master/%s-%s/%s/%s' % (version, os_dir_name, signing_key_name, assert_filename)
|
assert_url = 'https://raw.githubusercontent.com/tecnovert/gitian.sigs/master/%s-%s/%s/%s' % (version, os_dir_name, signing_key_name, assert_filename)
|
||||||
elif coin == 'litecoin':
|
elif coin == 'litecoin':
|
||||||
signing_key_name = 'thrasher'
|
signing_key_name = 'thrasher'
|
||||||
release_url = 'https://download.litecoin.org/litecoin-{}/{}/{}'.format(version, os_name, release_filename)
|
release_url = 'https://download.litecoin.org/litecoin-{}/{}/{}'.format(version, os_name, release_filename)
|
||||||
|
@ -174,24 +201,7 @@ def prepareCore(coin, version, settings, data_dir):
|
||||||
if verified.username is None:
|
if verified.username is None:
|
||||||
raise ValueError('Signature verification failed.')
|
raise ValueError('Signature verification failed.')
|
||||||
|
|
||||||
bins = [coin + 'd', coin + '-cli', coin + '-tx']
|
extractCore(coin, version, settings, bin_dir, release_path)
|
||||||
if os_name == 'win':
|
|
||||||
with zipfile.ZipFile(release_path) as fz:
|
|
||||||
for b in bins:
|
|
||||||
b += '.exe'
|
|
||||||
out_path = os.path.join(bin_dir, b)
|
|
||||||
with open(out_path, 'wb') as fout:
|
|
||||||
fout.write(fz.read('{}-{}/bin/{}'.format(coin, version, b)))
|
|
||||||
os.chmod(out_path, stat.S_IRWXU | stat.S_IXGRP | stat.S_IXOTH)
|
|
||||||
else:
|
|
||||||
with tarfile.open(release_path) as ft:
|
|
||||||
for b in bins:
|
|
||||||
out_path = os.path.join(bin_dir, b)
|
|
||||||
fi = ft.extractfile('{}-{}/bin/{}'.format(coin, version, b))
|
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
def prepareDataDir(coin, settings, data_dir, chain, particl_mnemonic):
|
def prepareDataDir(coin, settings, data_dir, chain, particl_mnemonic):
|
||||||
|
@ -238,10 +248,6 @@ def prepareDataDir(coin, settings, data_dir, chain, particl_mnemonic):
|
||||||
logger.warning('Unknown coin %s', coin)
|
logger.warning('Unknown coin %s', coin)
|
||||||
|
|
||||||
|
|
||||||
def extractCore(coin, version, settings):
|
|
||||||
logger.info('extractCore %s v%s', coin, version)
|
|
||||||
|
|
||||||
|
|
||||||
def printVersion():
|
def printVersion():
|
||||||
from basicswap import __version__
|
from basicswap import __version__
|
||||||
logger.info('Basicswap version:', __version__)
|
logger.info('Basicswap version:', __version__)
|
||||||
|
@ -271,7 +277,7 @@ def printHelp():
|
||||||
def make_rpc_func(bin_dir, data_dir, chain):
|
def make_rpc_func(bin_dir, data_dir, chain):
|
||||||
bin_dir = bin_dir
|
bin_dir = bin_dir
|
||||||
data_dir = data_dir
|
data_dir = data_dir
|
||||||
chain = '' if chain == 'mainnet' else chain
|
chain = chain
|
||||||
|
|
||||||
def rpc_func(cmd):
|
def rpc_func(cmd):
|
||||||
nonlocal bin_dir
|
nonlocal bin_dir
|
||||||
|
@ -402,7 +408,7 @@ def main():
|
||||||
'use_segwit': True,
|
'use_segwit': True,
|
||||||
'blocks_confirmed': 2,
|
'blocks_confirmed': 2,
|
||||||
'conf_target': 2,
|
'conf_target': 2,
|
||||||
'core_version_group': 17,
|
'core_version_group': 18,
|
||||||
'chain_lookups': 'local',
|
'chain_lookups': 'local',
|
||||||
},
|
},
|
||||||
'bitcoin': {
|
'bitcoin': {
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
export TEST_RELOAD_PATH=/tmp/test_basicswap
|
export TEST_RELOAD_PATH=/tmp/test_basicswap
|
||||||
mkdir -p ${TEST_RELOAD_PATH}/bin/{particl,bitcoin}
|
mkdir -p ${TEST_RELOAD_PATH}/bin/{particl,bitcoin}
|
||||||
cp ~/tmp/particl-0.18.1.6-x86_64-linux-gnu.tar.gz ${TEST_RELOAD_PATH}/bin/particl
|
cp ~/tmp/particl-0.19.1.1-x86_64-linux-gnu.tar.gz ${TEST_RELOAD_PATH}/bin/particl
|
||||||
cp ~/tmp/bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz ${TEST_RELOAD_PATH}/bin/bitcoin
|
cp ~/tmp/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz ${TEST_RELOAD_PATH}/bin/bitcoin
|
||||||
export PYTHONPATH=$(pwd)
|
export PYTHONPATH=$(pwd)
|
||||||
python tests/basicswap/test_reload.py
|
python tests/basicswap/test_reload.py
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue