diff --git a/README.md b/README.md index dbb103d2..33a9f154 100644 --- a/README.md +++ b/README.md @@ -137,13 +137,14 @@ The data are separated to different column families: | dash | 9033 | 9133 | 8033 | 38333 | | ltc | 9034 | 9134 | 8034 | 38334 | | btg | 9035 | 9135 | 8035 | 38335 | -| eth | 9036 | 9136 | 8036 | | +| eth | 9036 | 9136 | 8036 | 38336* | | etc | 9037 | 9137 | 8037 | | | xem | 9038 | 9138 | 8038 | 38336 | | btc-testnet | 19030 | 19130 | 18030 | 48330 | | bch-testnet | 19031 | 19131 | 18031 | 48331 | | zec-testnet | 19032 | 19132 | 18032 | 48332 | -| eth-testnet | 19036 | 19136 | 18036 | | +| eth-ropsten | 19036 | 19136 | 18036 | 48333* | +\* geth listens on this port, however not as zmq service ## Todo diff --git a/contrib/backends/Makefile b/contrib/backends/Makefile index 8331a7bf..f59747d2 100644 --- a/contrib/backends/Makefile +++ b/contrib/backends/Makefile @@ -1,4 +1,4 @@ -TARGETS = bitcoin zcash bcash +TARGETS = bitcoin zcash bcash ethereum IMAGE = blockbook-backend-build-deb NO_CACHE = false diff --git a/contrib/backends/ethereum/Makefile b/contrib/backends/ethereum/Makefile new file mode 100644 index 00000000..a7a73b56 --- /dev/null +++ b/contrib/backends/ethereum/Makefile @@ -0,0 +1,10 @@ +GETH_VERSION := 1.8.10-eae63c51 + +all: + wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-${GETH_VERSION}.tar.gz + tar -xf geth-linux-amd64-${GETH_VERSION}.tar.gz + mv geth-linux-amd64-${GETH_VERSION} ethereum + +clean: + rm -rf ethereum + rm -f geth-linux-amd64-${GETH_VERSION}.tar.gz* diff --git a/contrib/backends/ethereum/debian/changelog b/contrib/backends/ethereum/debian/changelog new file mode 100644 index 00000000..d0c0c269 --- /dev/null +++ b/contrib/backends/ethereum/debian/changelog @@ -0,0 +1,5 @@ +ethereum (1.8.10-satoshilabs1) unstable; urgency=medium + + * Initial build + + -- Martin Bohm Thu, 31 May 2018 11:12:13 +0200 diff --git a/contrib/backends/ethereum/debian/compat b/contrib/backends/ethereum/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/contrib/backends/ethereum/debian/compat @@ -0,0 +1 @@ +9 diff --git a/contrib/backends/ethereum/debian/control b/contrib/backends/ethereum/debian/control new file mode 100644 index 00000000..1d1f743e --- /dev/null +++ b/contrib/backends/ethereum/debian/control @@ -0,0 +1,16 @@ +Source: ethereum +Section: satoshilabs +Priority: optional +Maintainer: martin.bohm@satoshilabs.com +Build-Depends: debhelper, wget, tar, gzip, make, dh-systemd, dh-exec +Standards-Version: 3.9.5 + +Package: ethereum-eth +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate +Description: Satoshilabs packaged ethereum geth server + +Package: ethereum-ropsten +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate +Description: Satoshilabs packaged ethereum geth server diff --git a/contrib/backends/ethereum/debian/ethereum-eth.conffiles b/contrib/backends/ethereum/debian/ethereum-eth.conffiles new file mode 100644 index 00000000..e69de29b diff --git a/contrib/backends/ethereum/debian/ethereum-eth.dirs b/contrib/backends/ethereum/debian/ethereum-eth.dirs new file mode 100644 index 00000000..abf53edc --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-eth.dirs @@ -0,0 +1 @@ +/opt/coins/data/eth/eth \ No newline at end of file diff --git a/contrib/backends/ethereum/debian/ethereum-eth.install b/contrib/backends/ethereum/debian/ethereum-eth.install new file mode 100644 index 00000000..fb75665c --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-eth.install @@ -0,0 +1 @@ +ethereum/* /opt/coins/nodes/ethereum/eth diff --git a/contrib/backends/ethereum/debian/ethereum-eth.logrotate b/contrib/backends/ethereum/debian/ethereum-eth.logrotate new file mode 100644 index 00000000..4ecb953d --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-eth.logrotate @@ -0,0 +1,9 @@ +/opt/coins/data/eth/eth/eth.log +{ + rotate 7 + daily + compress + missingok + notifempty + copytruncate +} diff --git a/contrib/backends/ethereum/debian/ethereum-eth.postinst b/contrib/backends/ethereum/debian/ethereum-eth.postinst new file mode 100644 index 00000000..acbcc05e --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-eth.postinst @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +case "$1" in + + configure) + if ! id -u ethereum &> /dev/null + then + useradd --system -M -U ethereum -s /bin/false + fi + + if [ "$(stat -c '%U' /opt/coins/data/eth/eth)" != "ethereum" ] + then + chown -R ethereum:ethereum /opt/coins/data/eth/eth + fi + ;; + +esac + +#DEBHELPER# diff --git a/contrib/backends/ethereum/debian/ethereum-eth.service b/contrib/backends/ethereum/debian/ethereum-eth.service new file mode 100644 index 00000000..9c13f0a1 --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-eth.service @@ -0,0 +1,42 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit ethereum-eth.service +# See "man systemd.service" for details. + +[Unit] +Description=Ethereum daemon (mainnet) +After=network.target + +[Service] +ExecStart=/bin/sh -c '/opt/coins/nodes/ethereum/eth/geth --ipcdisable --syncmode full --cache 1024 --datadir /opt/coins/data/eth/eth --port 38336 --ws --wsaddr 0.0.0.0 --wsport 8036 --wsorigins * 2>>/opt/coins/data/eth/eth/eth.log' +User=ethereum +Type=simple +Restart=on-failure +WorkingDirectory=/opt/coins/nodes/ethereum/eth + +# Resource limits +LimitNOFILE=500000 + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/contrib/backends/ethereum/debian/ethereum-ropsten.conffiles b/contrib/backends/ethereum/debian/ethereum-ropsten.conffiles new file mode 100644 index 00000000..e69de29b diff --git a/contrib/backends/ethereum/debian/ethereum-ropsten.dirs b/contrib/backends/ethereum/debian/ethereum-ropsten.dirs new file mode 100644 index 00000000..fdac20f2 --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-ropsten.dirs @@ -0,0 +1 @@ +/opt/coins/data/eth-ropsten/eth \ No newline at end of file diff --git a/contrib/backends/ethereum/debian/ethereum-ropsten.install b/contrib/backends/ethereum/debian/ethereum-ropsten.install new file mode 100644 index 00000000..ced5fdba --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-ropsten.install @@ -0,0 +1 @@ +ethereum/* /opt/coins/nodes/ethereum/eth-ropsten diff --git a/contrib/backends/ethereum/debian/ethereum-ropsten.logrotate b/contrib/backends/ethereum/debian/ethereum-ropsten.logrotate new file mode 100644 index 00000000..f253afec --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-ropsten.logrotate @@ -0,0 +1,9 @@ +/opt/coins/data/eth/eth-ropsten/eth.log +{ + rotate 7 + daily + compress + missingok + notifempty + copytruncate +} diff --git a/contrib/backends/ethereum/debian/ethereum-ropsten.postinst b/contrib/backends/ethereum/debian/ethereum-ropsten.postinst new file mode 100644 index 00000000..0b509afa --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-ropsten.postinst @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +case "$1" in + + configure) + if ! id -u ethereum &> /dev/null + then + useradd --system -M -U ethereum -s /bin/false + fi + + if [ "$(stat -c '%U' /opt/coins/data/eth-ropsten/eth)" != "ethereum" ] + then + chown -R ethereum:ethereum /opt/coins/data/eth-ropsten/eth + fi + ;; + +esac + +#DEBHELPER# diff --git a/contrib/backends/ethereum/debian/ethereum-ropsten.service b/contrib/backends/ethereum/debian/ethereum-ropsten.service new file mode 100644 index 00000000..7eb55cf7 --- /dev/null +++ b/contrib/backends/ethereum/debian/ethereum-ropsten.service @@ -0,0 +1,42 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit ethereum-ropsten.service +# See "man systemd.service" for details. + +[Unit] +Description=Ethereum daemon (ropsten testnet) +After=network.target + +[Service] +ExecStart=/bin/sh -c '/opt/coins/nodes/ethereum/eth-ropsten/geth --ipcdisable --testnet --cache 1024 --datadir /opt/coins/data/eth-ropsten/eth --port 48333 --ws --wsaddr 0.0.0.0 --wsport 18036 --wsorigins * 2>>/opt/coins/data/eth-ropsten/eth/eth.log' +User=ethereum +Type=simple +Restart=on-failure +WorkingDirectory=/opt/coins/nodes/ethereum/eth-ropsten/ + +# Resource limits +LimitNOFILE=500000 + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/contrib/backends/ethereum/debian/rules b/contrib/backends/ethereum/debian/rules new file mode 100755 index 00000000..12271a0c --- /dev/null +++ b/contrib/backends/ethereum/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f + +DH_VERBOSE = 1 + +%: + dh $@ --with=systemd + +override_dh_strip: + +override_dh_systemd_start: + dh_systemd_start --no-start + +override_dh_installinit: