diff --git a/contrib/daemontools/env/ELECTRUMX b/contrib/daemontools/env/ELECTRUMX index 3de0637..da5e774 100644 --- a/contrib/daemontools/env/ELECTRUMX +++ b/contrib/daemontools/env/ELECTRUMX @@ -1 +1 @@ -/path/to/electrumx_server.py +/path/to/electrumx_server diff --git a/contrib/raspberrypi3/run_electrumx.sh b/contrib/raspberrypi3/run_electrumx.sh index fc28af0..db23f0d 100644 --- a/contrib/raspberrypi3/run_electrumx.sh +++ b/contrib/raspberrypi3/run_electrumx.sh @@ -25,7 +25,7 @@ export RPC_PORT=8000 # run electrumx ulimit -n 10000 -/usr/local/bin/electrumx_server.py 2>> /home/username/.electrumx/electrumx.log >> /home/username/.electrumx/electrumx.log & +/usr/local/bin/electrumx_server 2>> /home/username/.electrumx/electrumx.log >> /home/username/.electrumx/electrumx.log & ###################### # auto-start electrumx diff --git a/contrib/systemd/electrumx.service b/contrib/systemd/electrumx.service index 808ff7b..c2a819d 100644 --- a/contrib/systemd/electrumx.service +++ b/contrib/systemd/electrumx.service @@ -4,7 +4,7 @@ After=network.target [Service] EnvironmentFile=/etc/electrumx.conf -ExecStart=/usr/local/bin/electrumx_server.py +ExecStart=/usr/local/bin/electrumx_server User=electrumx LimitNOFILE=8192 TimeoutStopSec=30min diff --git a/docs/environment.rst b/docs/environment.rst index 1342e57..5c1de25 100644 --- a/docs/environment.rst +++ b/docs/environment.rst @@ -53,7 +53,7 @@ The following are required if you use the ``run`` script: .. envvar:: ELECTRUMX - The path to the electrumx_server.py script. Relative paths should + The path to the electrumx_server script. Relative paths should be relative to the directory of the ``run`` script. .. envvar:: USERNAME diff --git a/docs/rpc-interface.rst b/docs/rpc-interface.rst index 3b21adc..7f18354 100644 --- a/docs/rpc-interface.rst +++ b/docs/rpc-interface.rst @@ -3,12 +3,12 @@ RPC Interface You can query the status of a running server, and affect its behaviour by sending **JSON RPC** commands to the LocalRPC port it is listening -on. This is best done using the :file:`electrumx_rpc.py` script +on. This is best done using the :file:`electrumx_rpc` script provided. The general form of invocation is:: - electrumx_rpc.py [-p PORT] [arg1 [arg2...]] + electrumx_rpc [-p PORT] [arg1 [arg2...]] The port to send the commands to can be specified on the command line, otherwise the environment variable :envvar:`RPC_PORT` is used, and if @@ -23,7 +23,7 @@ Add a peer to the peers list. ElectrumX will schdule an immediate connection attempt. This command takes a single argument: the peer's "real name" as it used to advertise itself on IRC:: - $ ./electrumx_rpc.py add_peer "ecdsa.net v1.0 s110 t" + $ ./electrumx_rpc add_peer "ecdsa.net v1.0 s110 t" "peer 'ecdsa.net v1.0 s110 t' added" daemon_url @@ -48,7 +48,7 @@ disconnect Disconnect the given session IDs. Session IDs can be seen in the logs or with the `sessions`_ RPC command:: - $ ./electrumx_rpc.py disconnect 2 3 + $ ./electrumx_rpc disconnect 2 3 [ "disconnected 2", "disconnected 3" @@ -64,7 +64,7 @@ getinfo Return a summary of server state. This command takes no arguments. A typical result is as follows (with annotated comments):: - $ electrumx_rpc.py getinfo + $ electrumx_rpc getinfo { "closing": 1, # The number of sessions being closed down "daemon": "192.168.0.2:8332/", # The daemon URL without auth info @@ -128,7 +128,7 @@ Toggle logging of the given session IDs. All incoming requests for a logged session are written to the server log. Session IDs can be seen in the logs or with the `sessions`_ RPC command:: - $ electrumx_rpc.py log 0 1 2 3 4 5 + $ electrumx_rpc log 0 1 2 3 4 5 [ "log 0: False", "log 1: False", @@ -153,7 +153,7 @@ This command takes no arguments. Peer data is obtained via a peer discovery protocol documented :ref:`here `:: - $ electrumx_rpc.py peers + $ electrumx_rpc peers Host Status TCP SSL Server Min Max Pruning Last Good Last Try Tries Source IP Address bch.tedy.pw good 50001 50002 ElectrumX 1.2.1 0.9 1.2 07h 29m 23s 07h 30m 40s 0 peer 185.215.224.26 shsmithgoggryfbx.onion good 60001 60002 ElectrumX 1.2.1 0.9 1.2 07h 30m 34s 07h 30m 38s 0 peer diff --git a/electrumx_rpc.py b/electrumx_rpc similarity index 100% rename from electrumx_rpc.py rename to electrumx_rpc diff --git a/electrumx_server.py b/electrumx_server similarity index 100% rename from electrumx_server.py rename to electrumx_server diff --git a/setup.py b/setup.py index 470b8cb..6ad2917 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from electrumx.server.version import VERSION setuptools.setup( name='electrumx', version=VERSION, - scripts=['electrumx_server.py', 'electrumx_rpc.py'], + scripts=['electrumx_server', 'electrumx_rpc'], python_requires='>=3.6', # via environment variables, in which case I've tested with 15.0.4 # "x11_hash" package (1.4) is required to sync DASH network.