diff --git a/samples/daemontools/env/COIN b/contrib/daemontools/env/COIN similarity index 100% rename from samples/daemontools/env/COIN rename to contrib/daemontools/env/COIN diff --git a/samples/daemontools/env/DAEMON_URL b/contrib/daemontools/env/DAEMON_URL similarity index 100% rename from samples/daemontools/env/DAEMON_URL rename to contrib/daemontools/env/DAEMON_URL diff --git a/samples/daemontools/env/DB_DIRECTORY b/contrib/daemontools/env/DB_DIRECTORY similarity index 100% rename from samples/daemontools/env/DB_DIRECTORY rename to contrib/daemontools/env/DB_DIRECTORY diff --git a/samples/daemontools/env/ELECTRUMX b/contrib/daemontools/env/ELECTRUMX similarity index 100% rename from samples/daemontools/env/ELECTRUMX rename to contrib/daemontools/env/ELECTRUMX diff --git a/samples/daemontools/env/NETWORK b/contrib/daemontools/env/NETWORK similarity index 100% rename from samples/daemontools/env/NETWORK rename to contrib/daemontools/env/NETWORK diff --git a/samples/daemontools/env/USERNAME b/contrib/daemontools/env/USERNAME similarity index 100% rename from samples/daemontools/env/USERNAME rename to contrib/daemontools/env/USERNAME diff --git a/samples/daemontools/log/run b/contrib/daemontools/log/run old mode 100755 new mode 100644 similarity index 100% rename from samples/daemontools/log/run rename to contrib/daemontools/log/run diff --git a/samples/daemontools/run b/contrib/daemontools/run old mode 100755 new mode 100644 similarity index 100% rename from samples/daemontools/run rename to contrib/daemontools/run diff --git a/contrib/python3.6/python-3.6.sh b/contrib/python3.6/python-3.6.sh new file mode 100644 index 0000000..d83839d --- /dev/null +++ b/contrib/python3.6/python-3.6.sh @@ -0,0 +1,11 @@ +Installation of Python 3.6 +-------------------------- + +sudo add-apt-repository ppa:jonathonf/python-3.6 +sudo apt-get update && sudo apt-get install python3.6 python3.6-dev + +cd /home/username +git clone https://github.com/kyuupichan/electrumx.git +cd electrumx +sudo python3.6 setup.py install + diff --git a/contrib/raspberrypi3/install_electrumx.sh b/contrib/raspberrypi3/install_electrumx.sh new file mode 100644 index 0000000..11b7ab9 --- /dev/null +++ b/contrib/raspberrypi3/install_electrumx.sh @@ -0,0 +1,24 @@ +################### +# install electrumx +################### + +# upgrade raspbian to 'stretch' distribution for python 3.5 support +sudo echo 'deb http://mirrordirector.raspbian.org/raspbian/ testing main contrib non-free rpi' > /etc/apt/sources.list.d/stretch.list +sudo apt-get update +sudo apt-get dist-upgrade +sudo apt-get autoremove + +# install electrumx dependencies +sudo apt-get install python3-pip +sudo apt-get install build-essential libc6-dev +sudo apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev +sudo apt-get install libleveldb-dev +sudo apt-get install git +sudo pip3 install plyvel +sudo pip3 install irc + +# install electrumx +git clone https://github.com/kyuupichan/electrumx.git +cd electrumx +sudo python3 setup.py install + diff --git a/contrib/raspberrypi3/run_electrumx.sh b/contrib/raspberrypi3/run_electrumx.sh new file mode 100644 index 0000000..f97b9f8 --- /dev/null +++ b/contrib/raspberrypi3/run_electrumx.sh @@ -0,0 +1,38 @@ +############### +# run_electrumx +############### + +# configure electrumx +export COIN=Bitcoin +export DAEMON_URL=http://rpcuser:rpcpassword@127.0.0.1 +export NETWORK=mainnet +export CACHE_MB=400 +export DB_DIRECTORY=/home/username/.electrumx/db +export SSL_CERTFILE=/home/username/.electrumx/certfile.crt +export SSL_KEYFILE=/home/username/.electrumx/keyfile.key +export BANNER_FILE=/home/username/.electrumx/banner +export DONATION_ADDRESS=your-donation-address + +# connectivity +export HOST= +export TCP_PORT=50001 +export SSL_PORT=50002 + +# visibility +export IRC= +export IRC_NICK=hostname +export REPORT_HOST=hostname.com +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 & + +###################### +# auto-start electrumx +###################### + +# add this line to crontab -e +# @reboot /path/to/run_electrumx.sh + + diff --git a/samples/systemd/electrumx.conf b/contrib/systemd/electrumx.conf similarity index 100% rename from samples/systemd/electrumx.conf rename to contrib/systemd/electrumx.conf diff --git a/samples/systemd/electrumx.service b/contrib/systemd/electrumx.service similarity index 100% rename from samples/systemd/electrumx.service rename to contrib/systemd/electrumx.service diff --git a/docs/HOWTO.rst b/docs/HOWTO.rst index e409859..dde2f81 100644 --- a/docs/HOWTO.rst +++ b/docs/HOWTO.rst @@ -108,7 +108,7 @@ to at least 2,500. Note that setting the limit in your shell does *NOT* affect ElectrumX unless you are invoking ElectrumX directly from your shell. If you are using `systemd`, you need to set it in the `.service` file (see -`samples/systemd/electrumx.service`_). +`contrib/systemd/electrumx.service`_). Using daemontools @@ -136,7 +136,7 @@ you might do:: Then copy the all sample scripts from the ElectrumX source tree there:: - cp -R /path/to/repo/electrumx/samples/daemontools ~/scripts/electrumx + cp -R /path/to/repo/electrumx/contrib/daemontools ~/scripts/electrumx This copies 3 things: the top level server run script, a log/ directory with the logger run script, an env/ directory. @@ -172,7 +172,7 @@ Using systemd This repository contains a sample systemd unit file that you can use to setup ElectrumX with systemd. Simply copy it to :code:`/etc/systemd/system`:: - cp samples/systemd/electrumx.service /etc/systemd/system/ + cp contrib/systemd/electrumx.service /etc/systemd/system/ The sample unit file assumes that the repository is located at :code:`/home/electrumx/electrumx`. If that differs on your system, you need to @@ -199,6 +199,24 @@ minutes to flush cached data to disk during initial sync. You should set TimeoutStopSec to *at least* 10 mins in your `.service` file. +Installing Python 3.6 under Ubuntu +---------------------------------- + +Many Ubuntu distributions have an incompatible Python version baked in. +Because of this, it is easier to install Python 3.6 rather than attempting +to update Python 3.5.2 to 3.5.3. See `contrib/python3.6/python-3.6.sh`_. + + +Installing on Raspberry Pi 3 +---------------------------- + +To install on the Raspberry Pi 3 you will need to update to the "stretch" distribution. +See the full procedure in `contrib/raspberrypi3/install_electrumx.sh`_. + +See also `contrib/raspberrypi3/run_electrumx.sh`_ for an easy way to configure and +launch electrumx. + + Sync Progress ============= @@ -377,10 +395,14 @@ copy of your certificate and key in case you need to restore them. .. _`ENVIRONMENT.rst`: https://github.com/kyuupichan/electrumx/blob/master/docs/ENVIRONMENT.rst -.. _`samples/systemd/electrumx.service`: https://github.com/kyuupichan/electrumx/blob/master/samples/systemd/electrumx.service +.. _`contrib/systemd/electrumx.service`: https://github.com/kyuupichan/electrumx/blob/master/contrib/systemd/electrumx.service .. _`daemontools`: http://cr.yp.to/daemontools.html .. _`runit`: http://smarden.org/runit/index.html .. _`aiohttp`: https://pypi.python.org/pypi/aiohttp .. _`pylru`: https://pypi.python.org/pypi/pylru .. _`IRC`: https://pypi.python.org/pypi/irc .. _`x11_hash`: https://pypi.python.org/pypi/x11_hash +.. _`contrib/python3.6/python-3.6.sh`: https://github.com/kyuupichan/electrumx/blob/master/contrib/contrib/python3.6/python-3.6.sh +.. _`contrib/raspberrypi3/install_electrumx.sh`: https://github.com/kyuupichan/electrumx/blob/master/contrib/contrib/raspberrypi3/install_electrumx.sh +.. _`contrib/raspberrypi3/run_electrumx.sh`: https://github.com/kyuupichan/electrumx/blob/master/contrib/contrib/raspberrypi3/run_electrumx.sh +