Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
957adb4
add GLEEC
ca333 Aug 27, 2020
d66c916
Merge pull request #1 from ca333/patch-1
cipig Nov 13, 2020
a7a4e9c
add PBC
ca333 Nov 13, 2020
6047437
Merge pull request #2 from ca333/patch-1
cipig Nov 13, 2020
3618a02
Merge remote-tracking branch 'upstream/master'
cipig Nov 13, 2020
ce74dd3
Merge remote-tracking branch 'upstream/master'
cipig Jan 26, 2021
9e5c7d1
merge upstream
cipig Feb 16, 2021
1668a29
Merge remote-tracking branch 'upstream/master'
cipig Feb 17, 2021
4f71e63
Merge remote-tracking branch 'upstream/master'
cipig May 2, 2021
37c00d5
PBC -> SFUSD
cipig May 2, 2021
1e46e29
Merge remote-tracking branch 'upstream/master'
cipig Dec 27, 2021
3abf062
Merge remote-tracking branch 'upstream/master'
cipig Jan 31, 2022
8ef11df
Merge remote-tracking branch 'upstream/master'
cipig Feb 9, 2022
c017176
Merge remote-tracking branch 'upstream/master'
cipig Mar 5, 2022
558965c
Merge remote-tracking branch 'upstream/master'
cipig Mar 10, 2022
308e93d
Merge remote-tracking branch 'upstream/master'
cipig Apr 28, 2022
7f5c47e
ensure no confirmed tx in mempool data
Jun 9, 2022
2b31ada
add LBRY Credits (LBC)
cipig Jun 18, 2022
27119be
Merge pull request #4 from KomodoPlatform/fix_unconfirmed_balance
smk762 Sep 13, 2022
25d2aee
add zcash v5 (nu5) transactions support (draft)
DeckerSU Oct 2, 2022
a9daa35
add zcash v5 transaction txid calculation unit test
DeckerSU Oct 2, 2022
e9c73a1
Merge remote-tracking branch 'upstream/master'
cipig Oct 2, 2022
626dc11
Merge remote-tracking branch 'cipig/master'
cipig Oct 2, 2022
81ca326
Merge remote-tracking branch 'decker/patch-issue-181'
cipig Oct 3, 2022
ebd497b
Merge remote-tracking branch 'upstream/master'
cipig Jun 21, 2023
d5e03f4
add Milevium (MIL)
cipig Jun 21, 2023
69b62e9
feat(DASH): Update DashProRegTx and DashProUpServTx to support extra …
UdjinM6 Jul 9, 2023
db13a3d
test(DASH): add unit tests for DashProRegTx and DashProUpServTx with …
UdjinM6 Jul 9, 2023
d59d6d5
Merge commit 'refs/pull/221/head' of https://github.com/spesmilo/elec…
cipig Jul 9, 2023
95d1831
Support for coinbase tx version 3
sapph1re Oct 12, 2023
6d705a5
Removed old SubTx tests
sapph1re Oct 12, 2023
84e6cf2
Removed SubTx test values
sapph1re Oct 12, 2023
a3d9597
Fixed merkleRootMNList and merkleRootQuorums test values
sapph1re Oct 12, 2023
5dfb9ce
Renamed bestCLHeight to bestCLHeightDiff in tests
sapph1re Oct 12, 2023
bfebffc
Merge remote-tracking branch 'upstream/master'
cipig Dec 14, 2023
e593774
Merge commit 'refs/pull/234/head' of https://github.com/spesmilo/elec…
cipig Dec 14, 2023
8b46f47
Merge remote-tracking branch 'upstream/master'
cipig Feb 27, 2024
e8f357e
add DIAC and RIC
cipig Mar 17, 2024
ff2e9c5
Merge remote-tracking branch 'upstream/master'
cipig Jan 29, 2025
b5f2427
add CLAM
cipig Jan 29, 2025
b11369d
add cheetahcoin support
ShorelineCrypto Mar 15, 2025
7899170
add cheetahcoin dockerfile
ShorelineCrypto Mar 15, 2025
88bf8cd
ssl standard name for cert
ShorelineCrypto Mar 15, 2025
29e820b
fix electrumx server path
ShorelineCrypto Mar 15, 2025
c2de067
switch dockerfile base back to ubuntu20.04
ShorelineCrypto Mar 15, 2025
e86608a
fixed python3.8 ABCMeta error
ShorelineCrypto Mar 15, 2025
5548803
add wss support
ShorelineCrypto Mar 15, 2025
5279173
update cheetahcoin wss readme
ShorelineCrypto Mar 15, 2025
262bc3a
Merge pull request #1 from ShorelineCrypto/cheetahcoin
ShorelineCrypto Mar 15, 2025
82c3588
add maintain scripts
ShorelineCrypto Mar 15, 2025
75ad793
add nengcoin support
ShorelineCrypto Mar 16, 2025
355882e
Merge pull request #2 from ShorelineCrypto/nengcoin
ShorelineCrypto Mar 16, 2025
43fb9ae
add INSTALL guide
ShorelineCrypto Mar 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# How to Set up Electrumx Server with Docker Method

Installation with docker method in linux server is the recommended method. This installation method requires your linux server either on x64 or arm64 hardware to have
docker enabled. Below installation guide is based off runing electrumx server using Nengcoin and Cheetahcoin as example. The docker setup is quite general and would
work for other coins supported by electrumx.

Below electrumx server setup for 2 coins (nengcoin and cheetahcoin) are tested for ubuntu20.04 or ubuntu22.04 on x86_64 or arm64 hardware.


## Run NENG or CHTA Full Node

In the same linux server, you will need to run nengcoin and/or cheetahcoin full node. Download latest version of NENG or CHTA core wallet, set up proper
rpc username/password and rpc port in the "nengcoin.conf" and/or "cheetahcoin.conf" in their proper wallet folder, make sure the conf file has one line below to insure your full node contain all transactions:

```
txindex=1
```

Run full node and sync the full node to latest block height.

Copy down the rpcuser/rpcpassword/rpcport information, they will be used in below electrumx server configuration.

## Prepare electrumx folders

We run electrumx folder at "/opt/electrumx" in host for mouting db and ssl folder from host to container. You can pick another path as your choice and
change your container launch scripts volume mount point accordingly.

Ran below:
```
sudo mkdir -p /opt/electrumx/db-NENG
sudo mkdir -p /opt/electrumx/db-CHTA
sudo mkdir -p /opt/electrumx/ssl
```
The above commands created proper folders that will be used in docker run jobs

## Obtain SSL certificate through Certbot/NGINX

SSL or WSS URL connection method is recommended for current Komodo Wallet/Cheetahdex Wallet version and will be required for future versions while self created certificate files do not work for Komodo Wallet/Cheetahdex Wallet. Here we obtain free letsencrypt certificate through certbot/NGINX.
The below setup steps are largely based off komodo guide on this issue: https://komodoplatform.com/en/docs/komodo/setup-electrumx-server/

- Dependency - firewall/ port / certbot / nginx

First of all, make sure to open up port 80 if your server is behind firewall because certbot ssl validation requires port 80 through nginx. You may also open up more ports
on 10001, 10002, 10003 used by Nengcoin TCP/SSL/WSS and ports 10007/10008/10009 used by Cheetahcoin TCP/SSL/WSS electrumx services.

Perform installation of certbot uses snap and installation of nginx uses apt-get in ubuntu 20.04 or ubuntu 22.04:
```
sudo apt install snapd
sudo apt install nginx-core
```


Ran below to obtain SSL certificate needed for electrum ssl/wss connection.
```
sudo snap install core; sudo snap refresh core
sudo apt-get remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx
```

certbot/nginx above command will prompt you for desired subdomain or domain for certificates and will install live copy when process succeed.
```commandline
cp /etc/letsencrypt/live/electrum2.mooo.com/fullchain.pem /opt/electrumx/ssl/
cp /etc/letsencrypt/live/electrum2.mooo.com/privkey.pem /opt/electrumx/ssl/
```

The free letsencrypt certificate is valid for 3 months and you can renew once it expires.


## Install docker

In ubuntu or debian, you can run below to install docker in your linux machine:

```
sudo apt-get update
sudo apt-get install -y docker.io
```

Check out online guide if your linux is openSUSE, fedora or arch based.


## Install coin docker images, run docker job

For Nengcoin, checkout 'contrib/nengcoin' of this repos README guide, follow the guide step by step to install docker image, run a docker-run job, and trouble shoot
job log information or other maintanence tasks if needed.

For Cheetahcoin, checkout 'contrib/cheetahcoin' of this repos README guide, follow the guide step by step to install docker image, run a docker-run job, and trouble shoot
job log information or other maintanence tasks if needed.

Your can run 2 coins with docker jobs together in the same linux server.

The electrumx server should be running now allow Komodo Wallet/Cheetahdex Wallet, electrum-NENG or electrum-CHTA to connect to your server.
39 changes: 39 additions & 0 deletions contrib/cheetahcoin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:22.04

WORKDIR /

RUN apt-get update && \
apt-get -y install python3-setuptools python3-multidict python3.10 python3.10-dev libleveldb-dev python3-setuptools python3-multidict gcc g++ libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev build-essential python3-pip git

RUN python3.10 -m pip install --upgrade pip
RUN python3.10 -m pip install aiohttp pylru Cython uvloop quark_hash
RUN python3.10 -m pip install plyvel
RUN git clone https://github.com/ShorelineCrypto/electrumx-1 /opt/electrumx

ENV COIN=Cheetahcoin
ENV DB_DIRECTORY=/db
ENV DAEMON_URL="http://RPCUSER:RPCPASSWORD@IP:RPCPORT/"
ENV SERVICES="tcp://:10007,rpc://0.0.0.0:8007,ssl://:10008,wss://:10009"
ENV EVENT_LOOP_POLICY=uvloop
ENV PEER_DISCOVERY=self
ENV INITIAL_CONCURRENT=50
ENV COST_SOFT_LIMIT=10000
ENV COST_HARD_LIMIT=100000
ENV BANDWIDTH_UNIT_COST=10000
ENV SSL_CERTFILE=/ssl/fullchain.pem
ENV SSL_KEYFILE=/ssl/privkey.pem
ENV ALLOW_ROOT=true
ENV MAX_SEND=10000000
ENV CACHE_MB=2000

VOLUME /db
VOLUME /ssl

RUN mkdir -p "$DB_DIRECTORY" && ulimit -n 1048576
RUN mkdir -p /ssl

WORKDIR /opt/electrumx

RUN python3.10 setup.py install
CMD ["/usr/bin/python3.10", "/opt/electrumx/electrumx_server"]

104 changes: 104 additions & 0 deletions contrib/cheetahcoin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
## Install electrumx docker image for Cheetahcoin on x86_64 (amd64) or arm64 (aarch64) GNU/linux:

Pull down a working docker image from docker hub:

x64
```
docker pull shorelinecrypto/electrumx-chta:amd64
docker tag shorelinecrypto/electrumx-chta:amd64 electrumx-chta:latest
```
arm64
```
docker pull shorelinecrypto/electrumx-chta:arm64
docker tag shorelinecrypto/electrumx-chta:arm64 electrumx-chta:latest
```
Alternatively, build docker image from source:

```
docker build -t electrumx-chta .
```

### Run electrumx Cheetahcoin server with docker

Replace with your CHTA full node rpcuser/rpcpassword and your server hostname with below command, assuming the CHTA full node runs at rpcport=8546 :

```
docker run -d --net=host -v /opt/electrumx/db-CHTA/:/db -v /opt/electrumx/ssl:/ssl -e DAEMON_URL="http://youruser:yourpass@127.0.0.1:8546" -e REPORT_SERVICES=tcp://yourhost:10007,ssl://yourhost:10008,wss://yourhost:10009 electrumx-chta
```

### Trouble shoot or check docker container status

Your docker run electrumx server job should be running, run below to obtain image / container ID

```
docker ps
docker container ls -la
docker images -a
```

In order to trouble shoot issues or check log information of electrumx job, run blow to get real time log information

```
docker logs CONTAINER_ID
```

## Shut down electrum Cheetahcoin docker server
for a proper clean shutdown, send TERM signal to the running container eg.:

```
docker kill --signal="TERM" CONTAINER_ID

```

## clean up and remove residual containers

Stopped containers take up disk and memory resources, you may want to clean up and remove those dead containers to free up resources

```
docker rm CONTAINER_ID
```

## electrumx server crash maintenance

Electrumx server tend to crash from time to time after running smoothly for several weeks. Using docker logs CONTAINER_ID method can find
crash error like this assuming your CONTAINER_ID is 'c39a7d4a07d7':
```
docker ps -a
docker logs c39a7d4a07d7

--- skipped logs informations ---
struct.error: 'H' format requires 0 <= number <= 65535
```

The ROOT CAUSE of the crash is due to database overflow and can be fixed with below steps :

#### (1) delete the exited docker container
```
docker ps -a
docker rm c39a7d4a07d7
```

#### (2) setup "test" container to do maintenance job
```
docker run -it --name test -v /opt/electrumx/db-CHTA/:/db electrumx-chta /bin/bash
```

This above command will enter docker container with root account.
#### (3) do maintenance in "test" container

Run below commands inside container root account in electrumx folder /opt/electrumx

```
python3.10 electrumx_compact_history
exit
```

The above python3.10 command should take a few minutes to complete and then exit container


#### (4) Delete the containers and re-start electrumx-chta container job
```
docker rm test
```
go back to command step above under "Run electrumx Cheetahcoin server with docker"

33 changes: 33 additions & 0 deletions contrib/cheetahcoin/electrumx_maintain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/bash

if (test $# != 1)
then
echo "electrum_maintain.sh <electrumx-neng|electrumx-chta>"
exit
fi


image_name=$1


##obtain exited images

container_id=`docker ps --filter "status=exited" | grep ${image_name} | cut -f1 -d' '`

if ( test -z ${container_id} )
then
echo "electrumx server running" > /dev/null
elif [[ $image_name == "electrumx-neng" ]]
then
docker rm $container_id
docker run --rm -v /opt/electrumx/db-NENG/:/db ${image_name} python3.10 electrumx_compact_history
bash /root/docker_run_${image_name}.sh
elif [[ $image_name == "electrumx-chta" ]]
then
docker rm $container_id
docker run --rm -v /opt/electrumx/db-CHTA/:/db ${image_name} python3.10 electrumx_compact_history
bash /root/docker_run_${image_name}.sh
else
echo "wrong argument"
fi

39 changes: 39 additions & 0 deletions contrib/nengcoin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:22.04

WORKDIR /

RUN apt-get update && \
apt-get -y install python3-setuptools python3-multidict python3.10 python3.10-dev libleveldb-dev python3-setuptools python3-multidict gcc g++ libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev build-essential python3-pip git

RUN python3.10 -m pip install --upgrade pip
RUN python3.10 -m pip install aiohttp pylru Cython uvloop quark_hash
RUN python3.10 -m pip install plyvel
RUN git clone https://github.com/ShorelineCrypto/electrumx-1 /opt/electrumx

ENV COIN=Nengcoin
ENV DB_DIRECTORY=/db
ENV DAEMON_URL="http://RPCUSER:RPCPASSWORD@IP:RPCPORT/"
ENV SERVICES="tcp://:10001,rpc://0.0.0.0:8001,ssl://:10002,wss://:10003"
ENV EVENT_LOOP_POLICY=uvloop
ENV PEER_DISCOVERY=self
ENV INITIAL_CONCURRENT=50
ENV COST_SOFT_LIMIT=10000
ENV COST_HARD_LIMIT=100000
ENV BANDWIDTH_UNIT_COST=10000
ENV SSL_CERTFILE=/ssl/fullchain.pem
ENV SSL_KEYFILE=/ssl/privkey.pem
ENV ALLOW_ROOT=true
ENV MAX_SEND=10000000
ENV CACHE_MB=2000

VOLUME /db
VOLUME /ssl

RUN mkdir -p "$DB_DIRECTORY" && ulimit -n 1048576
RUN mkdir -p /ssl

WORKDIR /opt/electrumx

RUN python3.10 setup.py install
CMD ["/usr/bin/python3.10", "/opt/electrumx/electrumx_server"]

Loading