Merge branch 'setup' into develop
This commit is contained in:
commit
8972df2693
@ -43,14 +43,16 @@ def main():
|
|||||||
parser = argparse.ArgumentParser('Send electrumx an RPC command' )
|
parser = argparse.ArgumentParser('Send electrumx an RPC command' )
|
||||||
parser.add_argument('-p', '--port', metavar='port_num', type=int,
|
parser.add_argument('-p', '--port', metavar='port_num', type=int,
|
||||||
help='RPC port number')
|
help='RPC port number')
|
||||||
parser.add_argument('command', nargs='*', default=[],
|
parser.add_argument('command', nargs=1, default=[],
|
||||||
help='command to send')
|
help='command to send')
|
||||||
|
parser.add_argument('param', nargs='*', default=[],
|
||||||
|
help='params to send')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.port is None:
|
if args.port is None:
|
||||||
args.port = int(environ.get('ELECTRUMX_RPC_PORT', 8000))
|
args.port = int(environ.get('ELECTRUMX_RPC_PORT', 8000))
|
||||||
|
|
||||||
payload = {'method': args.command[0], 'params': args.command[1:]}
|
payload = {'method': args.command[0], 'params': args.param}
|
||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
proto_factory = partial(RPCClient, loop)
|
proto_factory = partial(RPCClient, loop)
|
||||||
@ -60,7 +62,7 @@ def main():
|
|||||||
protocol.send(payload)
|
protocol.send(payload)
|
||||||
loop.run_forever()
|
loop.run_forever()
|
||||||
except OSError:
|
except OSError:
|
||||||
print('error connecting - is ElectrumX running?')
|
print('error connecting - is ElectrumX catching up or not running?')
|
||||||
finally:
|
finally:
|
||||||
loop.close()
|
loop.close()
|
||||||
|
|
||||||
|
|||||||
0
lib/__init__.py
Normal file
0
lib/__init__.py
Normal file
@ -2,7 +2,8 @@ The following environment variables are required:
|
|||||||
|
|
||||||
DB_DIRECTORY - path to the database directory (if relative, to `run` script)
|
DB_DIRECTORY - path to the database directory (if relative, to `run` script)
|
||||||
USERNAME - the username the server will run as if using `run` script
|
USERNAME - the username the server will run as if using `run` script
|
||||||
SERVER_MAIN - path to the server_main.py script (if relative, to `run` script)
|
ELECTRUMX - path to the electrumx_server.py script (if relative,
|
||||||
|
to `run` script)
|
||||||
DAEMON_URL - the URL used to connect to the daemon. Should be of the form
|
DAEMON_URL - the URL used to connect to the daemon. Should be of the form
|
||||||
http://username:password@hostname:port/
|
http://username:password@hostname:port/
|
||||||
Alternatively you can specify DAEMON_USERNAME, DAEMON_PASSWORD,
|
Alternatively you can specify DAEMON_USERNAME, DAEMON_PASSWORD,
|
||||||
|
|||||||
1
samples/scripts/env/ELECTRUMX
vendored
Normal file
1
samples/scripts/env/ELECTRUMX
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/path/to/electrumx_server.py
|
||||||
1
samples/scripts/env/SERVER_MAIN
vendored
1
samples/scripts/env/SERVER_MAIN
vendored
@ -1 +0,0 @@
|
|||||||
/path/to/repos/electrumx/server_main.py
|
|
||||||
@ -4,7 +4,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=/etc/electrumx.conf
|
EnvironmentFile=/etc/electrumx.conf
|
||||||
ExecStart=/home/electrumx/electrumx/server_main.py
|
ExecStart=/usr/local/bin/electrumx_server.py
|
||||||
User=electrumx
|
User=electrumx
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
24
setup.py
Normal file
24
setup.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import setuptools
|
||||||
|
from server.version import VERSION
|
||||||
|
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
name='electrumx',
|
||||||
|
version=VERSION.split()[-1],
|
||||||
|
scripts=['electrumx_server.py', 'electrumx_rpc.py'],
|
||||||
|
python_requires='>=3.5',
|
||||||
|
install_requires=['plyvel', 'aiohttp >= 1'],
|
||||||
|
packages=setuptools.find_packages(),
|
||||||
|
description='ElectrumX Server',
|
||||||
|
author='Neil Booth',
|
||||||
|
author_email='kyuupichan@gmail.com',
|
||||||
|
license='MIT Licence',
|
||||||
|
url='https://github.com/kyuupichan/electrumx/',
|
||||||
|
long_description='Server implementation for the Electrum wallet',
|
||||||
|
classifiers=[
|
||||||
|
'Development Status :: 3 - Alpha',
|
||||||
|
'Topic :: Internet',
|
||||||
|
'License :: OSI Approved :: MIT License',
|
||||||
|
'Operating System :: Unix',
|
||||||
|
],
|
||||||
|
)
|
||||||
Loading…
Reference in New Issue
Block a user