From 0e7b8e4e0523c81c51303667b13cb3cd3a42ca18 Mon Sep 17 00:00:00 2001 From: koh-gt <101822992+koh-gt@users.noreply.github.com> Date: Thu, 13 Jul 2023 05:24:57 +0800 Subject: [PATCH 1/5] Update coins.py --- electrumx/lib/coins.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/electrumx/lib/coins.py b/electrumx/lib/coins.py index ce49f4c6f..d52ed6b2c 100644 --- a/electrumx/lib/coins.py +++ b/electrumx/lib/coins.py @@ -4180,7 +4180,7 @@ class Ferrite(Coin): WIF_BYTE = bytes.fromhex("a3") GENESIS_HASH = ('46ca17415c18e43f5292034ebf9bbd10' 'de80a61fc6dc17180e6609f33d3b48f3') - DESERIALIZER = lib_tx.DeserializerSegWit + DESERIALIZER = lib_tx.DeserializerLitecoin TX_COUNT = 164010 TX_COUNT_HEIGHT = 150251 TX_PER_BLOCK = 2 @@ -4189,9 +4189,9 @@ class Ferrite(Coin): ESTIMATE_FEE = 0.00001 RELAY_FEE = 0.00001 PEERS = [ - 'enode1.ferritecoin.org s t', - 'enode2.ferritecoin.org s t', - 'enode3.ferritecoin.org s t', + 'enode1.ferritecoin.org t', + 'enode2.ferritecoin.org t', + 'enode3.ferritecoin.org t', ] @@ -4213,7 +4213,7 @@ class FerriteTestnet(Ferrite): ESTIMATE_FEE = 0.00001 RELAY_FEE = 0.00001 PEERS = [ - 'enode1.ferritecoin.org s t', - 'enode2.ferritecoin.org s t', - 'enode3.ferritecoin.org s t', + 'enode1.ferritecoin.org t', + 'enode2.ferritecoin.org t', + 'enode3.ferritecoin.org t', ] From a33c6c70112342addbc700cd06c5c0150bd279d3 Mon Sep 17 00:00:00 2001 From: koh-gt <101822992+koh-gt@users.noreply.github.com> Date: Thu, 13 Jul 2023 05:26:37 +0800 Subject: [PATCH 2/5] Create README.md --- README.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..d4377831c --- /dev/null +++ b/README.md @@ -0,0 +1,103 @@ +# Quick installation guide - Ferrite ElectrumX server +Ubuntu 22.04 LTS - username: *ubuntu* + +## Setup +### In *Home* folder, clone the repository. +ubuntu@ubuntu-virtual-machine:\~$ `git clone https://github.com/koh-gt/electrumx.git` + +### Enter the *electrumx* directory and use pip to install. +ubuntu@ubuntu-virtual-machine:\~$ `cd electrumx` +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `pip3 install .` + +### Create a database directory *db* and `chown` the folder. Note the username is *ubuntu*. +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `mkdir db` +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `chown ubuntu db` + +## electrumx.service +### Copy the sample *electrumx.service* file to `/etc/systemd/system/` +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo cp contrib/systemd/electrumx.service /etc/systemd/system/` + +### Use `nano` to edit and configure the *electrumx.service* file. +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo nano /etc/systemd/system/electrumx.service` +Change `ExecStart` line to your `ExecStart=/home/ubuntu/electrumx/electrumx_server` folder directory +Change `ExecStop` line to your `ExecStop=/home/ubuntu/electrumx/electrumx_rpc` folder directory +Change `User` to your username `User=ubuntu`. + +### The file should look as follows: +``` +[Unit] +Description=Electrumx +After=network.target + +[Service] +EnvironmentFile=/etc/electrumx.conf +ExecStart=/home/ubuntu/electrumx/electrumx_server +ExecStop=/home/ubuntu/electrumx/electrumx_rpc -p 8000 stop +User=ubuntu +LimitNOFILE=8192 +TimeoutStopSec=30min + +[Install] +WantedBy=multi-user.target +``` +Press `Ctrl+X` to Exit and `Y` to save the modified buffer. +Press `Enter` to confirm writing to the file. + +## electrumx.conf +### Enter the */electrumx/contrib/systemd/* directory and copy the *electrumx.conf* file to the */etc/* folder. +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `cd contrib/systemd` +ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib/systemd$ `sudo cp electrumx.conf /etc/` + +### Use `nano` to edit and configure the *electrumx.conf* file. +ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib/systemd$ `sudo nano /etc/electrumx.conf` +Change `DB_DIRECTORY` to your databae directory *db* `DB_DIRECTORY = /home/ubuntu/electrumx/db` +Change `DAEMON_URL` to `user:password@localhost:9573` where `user` is your Ferrite Core rpc username, `password` is your Ferrite Core rpc password. +> You may change the `localhost` to another IP address if your Ferrite Core rpc node is not locally hosted. `9573` is the RPC port of Ferrite. + +Add a line `SERVICES = tcp://0.0.0.0:50001,rpc://` +> This will broadcast the ElectrumX server on port `50001` via TCP. The IP address `0.0.0.0` means all IP addresses are included. +Remove the `#` to uncomment the `COIN` line. +Change `COIN` to `COIN = Ferrite` to host a Ferrite ElectrumX server. + +### The file should look as follows: +``` +# default /etc/electrumx.conf for systemd + +# REQUIRED +DB_DIRECTORY = /home/ubuntu/electrumx/db +# Bitcoin Node RPC Credentials +DAEMON_URL = user:password@localhost:9573 + +SERVICES = tcp://0.0.0.0:50001,rpc:// +COIN = Ferrite + +# See https://electrumx-spesmilo.readthedocs.io/en/latest/environment.html for +# information about other configuration settings you probably want to consider. +``` +Press `Ctrl+X` to Exit and `Y` to save the modified buffer. +Press `Enter` to confirm writing to the file. + +## Starting the ElectrumX server. +### Return to the *electrumx* directory and create a symlink to the ElectrumX service +ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib/systemd$ `cd ..` +ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib$ ```cd ..``` +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo systemctl enable electrumx.service` + +### Start the ElectrumX service and check its status. (ensure ferrited is running) +ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo systemctl start electrumx.service` +> Optional: ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo systemctl status electrumx.service` +Open another terminal and run `journalctl -fu electrumx.service` to monitor ElectrumX. + +Synchronising +``` +Jul 13 04:31:06 ubuntu-virtual-machine electrumx_server[41863]: INFO:DB:flush #14 took 0.0s. Height 10,435 txs: 10,812 (+1,053) +Jul 13 04:31:06 ubuntu-virtual-machine electrumx_server[41863]: INFO:BlockProcessor:processed 1,000 blocks size 0.46 MB in 0.0s +Jul 13 04:31:07 ubuntu-virtual-machine electrumx_server[41863]: INFO:DB:flush #15 took 0.0s. Height 11,435 txs: 11,851 (+1,039) +Jul 13 04:31:07 ubuntu-virtual-machine electrumx_server[41863]: INFO:BlockProcessor:processed 1,000 blocks size 0.35 MB in 0.0s +``` + + + + + + From 6dd967c68c7015f0c2c4bc94fb019c9c33b0cb3f Mon Sep 17 00:00:00 2001 From: koh-gt <101822992+koh-gt@users.noreply.github.com> Date: Thu, 13 Jul 2023 05:27:23 +0800 Subject: [PATCH 3/5] Delete README.md --- README.md | 103 ------------------------------------------------------ 1 file changed, 103 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index d4377831c..000000000 --- a/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# Quick installation guide - Ferrite ElectrumX server -Ubuntu 22.04 LTS - username: *ubuntu* - -## Setup -### In *Home* folder, clone the repository. -ubuntu@ubuntu-virtual-machine:\~$ `git clone https://github.com/koh-gt/electrumx.git` - -### Enter the *electrumx* directory and use pip to install. -ubuntu@ubuntu-virtual-machine:\~$ `cd electrumx` -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `pip3 install .` - -### Create a database directory *db* and `chown` the folder. Note the username is *ubuntu*. -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `mkdir db` -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `chown ubuntu db` - -## electrumx.service -### Copy the sample *electrumx.service* file to `/etc/systemd/system/` -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo cp contrib/systemd/electrumx.service /etc/systemd/system/` - -### Use `nano` to edit and configure the *electrumx.service* file. -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo nano /etc/systemd/system/electrumx.service` -Change `ExecStart` line to your `ExecStart=/home/ubuntu/electrumx/electrumx_server` folder directory -Change `ExecStop` line to your `ExecStop=/home/ubuntu/electrumx/electrumx_rpc` folder directory -Change `User` to your username `User=ubuntu`. - -### The file should look as follows: -``` -[Unit] -Description=Electrumx -After=network.target - -[Service] -EnvironmentFile=/etc/electrumx.conf -ExecStart=/home/ubuntu/electrumx/electrumx_server -ExecStop=/home/ubuntu/electrumx/electrumx_rpc -p 8000 stop -User=ubuntu -LimitNOFILE=8192 -TimeoutStopSec=30min - -[Install] -WantedBy=multi-user.target -``` -Press `Ctrl+X` to Exit and `Y` to save the modified buffer. -Press `Enter` to confirm writing to the file. - -## electrumx.conf -### Enter the */electrumx/contrib/systemd/* directory and copy the *electrumx.conf* file to the */etc/* folder. -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `cd contrib/systemd` -ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib/systemd$ `sudo cp electrumx.conf /etc/` - -### Use `nano` to edit and configure the *electrumx.conf* file. -ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib/systemd$ `sudo nano /etc/electrumx.conf` -Change `DB_DIRECTORY` to your databae directory *db* `DB_DIRECTORY = /home/ubuntu/electrumx/db` -Change `DAEMON_URL` to `user:password@localhost:9573` where `user` is your Ferrite Core rpc username, `password` is your Ferrite Core rpc password. -> You may change the `localhost` to another IP address if your Ferrite Core rpc node is not locally hosted. `9573` is the RPC port of Ferrite. - -Add a line `SERVICES = tcp://0.0.0.0:50001,rpc://` -> This will broadcast the ElectrumX server on port `50001` via TCP. The IP address `0.0.0.0` means all IP addresses are included. -Remove the `#` to uncomment the `COIN` line. -Change `COIN` to `COIN = Ferrite` to host a Ferrite ElectrumX server. - -### The file should look as follows: -``` -# default /etc/electrumx.conf for systemd - -# REQUIRED -DB_DIRECTORY = /home/ubuntu/electrumx/db -# Bitcoin Node RPC Credentials -DAEMON_URL = user:password@localhost:9573 - -SERVICES = tcp://0.0.0.0:50001,rpc:// -COIN = Ferrite - -# See https://electrumx-spesmilo.readthedocs.io/en/latest/environment.html for -# information about other configuration settings you probably want to consider. -``` -Press `Ctrl+X` to Exit and `Y` to save the modified buffer. -Press `Enter` to confirm writing to the file. - -## Starting the ElectrumX server. -### Return to the *electrumx* directory and create a symlink to the ElectrumX service -ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib/systemd$ `cd ..` -ubuntu@ubuntu-virtual-machine:\~/electrumx/contrib$ ```cd ..``` -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo systemctl enable electrumx.service` - -### Start the ElectrumX service and check its status. (ensure ferrited is running) -ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo systemctl start electrumx.service` -> Optional: ubuntu@ubuntu-virtual-machine:\~/electrumx$ `sudo systemctl status electrumx.service` -Open another terminal and run `journalctl -fu electrumx.service` to monitor ElectrumX. - -Synchronising -``` -Jul 13 04:31:06 ubuntu-virtual-machine electrumx_server[41863]: INFO:DB:flush #14 took 0.0s. Height 10,435 txs: 10,812 (+1,053) -Jul 13 04:31:06 ubuntu-virtual-machine electrumx_server[41863]: INFO:BlockProcessor:processed 1,000 blocks size 0.46 MB in 0.0s -Jul 13 04:31:07 ubuntu-virtual-machine electrumx_server[41863]: INFO:DB:flush #15 took 0.0s. Height 11,435 txs: 11,851 (+1,039) -Jul 13 04:31:07 ubuntu-virtual-machine electrumx_server[41863]: INFO:BlockProcessor:processed 1,000 blocks size 0.35 MB in 0.0s -``` - - - - - - From fadb4502d88f5ee2d22d9f552a7f55d7affb98e3 Mon Sep 17 00:00:00 2001 From: koh-gt <101822992+koh-gt@users.noreply.github.com> Date: Thu, 13 Jul 2023 05:31:20 +0800 Subject: [PATCH 4/5] Update coins.py --- electrumx/lib/coins.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/electrumx/lib/coins.py b/electrumx/lib/coins.py index d52ed6b2c..98fabf4c0 100644 --- a/electrumx/lib/coins.py +++ b/electrumx/lib/coins.py @@ -4189,9 +4189,9 @@ class Ferrite(Coin): ESTIMATE_FEE = 0.00001 RELAY_FEE = 0.00001 PEERS = [ - 'enode1.ferritecoin.org t', - 'enode2.ferritecoin.org t', - 'enode3.ferritecoin.org t', + 'enode1.ferritecoin.org s t', + 'enode2.ferritecoin.org s t', + 'enode3.ferritecoin.org s t', ] @@ -4213,7 +4213,7 @@ class FerriteTestnet(Ferrite): ESTIMATE_FEE = 0.00001 RELAY_FEE = 0.00001 PEERS = [ - 'enode1.ferritecoin.org t', - 'enode2.ferritecoin.org t', - 'enode3.ferritecoin.org t', + 'enode1.ferritecoin.org s t', + 'enode2.ferritecoin.org s t', + 'enode3.ferritecoin.org s t', ] From 7b2512f3066ef462f8f057636402a1d01eaeabe7 Mon Sep 17 00:00:00 2001 From: koh-gt <101822992+koh-gt@users.noreply.github.com> Date: Sat, 15 Jul 2023 04:10:42 +0800 Subject: [PATCH 5/5] nodes - Update coins.py --- electrumx/lib/coins.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/electrumx/lib/coins.py b/electrumx/lib/coins.py index 98fabf4c0..5196a7420 100644 --- a/electrumx/lib/coins.py +++ b/electrumx/lib/coins.py @@ -4189,9 +4189,12 @@ class Ferrite(Coin): ESTIMATE_FEE = 0.00001 RELAY_FEE = 0.00001 PEERS = [ - 'enode1.ferritecoin.org s t', - 'enode2.ferritecoin.org s t', - 'enode3.ferritecoin.org s t', + '118.189.201.104 t50001', + '118.189.201.104 t50002', + '118.189.201.104 t50003', + 'enode1.ferritecoin.org t80', + 'enode2.ferritecoin.org t80', + 'enode3.ferritecoin.org t80' ] @@ -4213,7 +4216,10 @@ class FerriteTestnet(Ferrite): ESTIMATE_FEE = 0.00001 RELAY_FEE = 0.00001 PEERS = [ - 'enode1.ferritecoin.org s t', - 'enode2.ferritecoin.org s t', - 'enode3.ferritecoin.org s t', + '118.189.201.104 t50001', + '118.189.201.104 t50002', + '118.189.201.104 t50003', + 'enode1.ferritecoin.org t80', + 'enode2.ferritecoin.org t80', + 'enode3.ferritecoin.org t80' ]