Bitcoin Forum
May 09, 2024, 01:27:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help with mempool.space local install  (Read 241 times)
DireWolfM14 (OP)
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
September 27, 2021, 12:29:12 AM
Merited by LoyceV (4), o_e_l_e_o (4), pooya87 (3), ABCbits (3), Pmalek (2), hosseinimr93 (1), NotATether (1)
 #1

I need some help installing a local instance of mempool.space, hoping some of you with experience can chime in.

I've installed all the dependencies using apt, so they should all be stable LTS versions.  I also installed npm.  

I am trying to run this on separate hardware than my bitcoind and electrumx services.  On the mempool machine I set up the config file with the node server's local IP, and an rpc password generated using rpcauth.py.  On the node server I added the user authorization to the bitcoin.conf file, opened the applicable ports in ufw, and set port routing in my router.  I double checked all that over and over, so I'm sure that's not presenting any issues.

I installed nodejs and mariadb only on the machine that'll be running mempool, not on the machine running bitcoind/electrumx.

Here's the error I get when trying to run the backend:

Code:
direwolf@mempoolserver:/usr/local/bin/mempool/backend$ sudo npm run start

> mempool-backend@2.2.2 start /usr/local/bin/mempool/backend
> node --max-old-space-size=2048 dist/index.js

/usr/local/bin/mempool/backend/dist/index.js:24
    wss;
       ^

SyntaxError: Unexpected token ;
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mempool-backend@2.2.2 start: `node --max-old-space-size=2048 dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mempool-backend@2.2.2 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-26T23_59_21_850Z-debug.log

Here's my mempool-config.json file.  I only changed the rpc password in two places, and the IP address in thee places (as shown below.)

Code:
{
  "MEMPOOL": {
    "NETWORK": "mainnet",
    "BACKEND": "electrum",
    "HTTP_PORT": 8999,
    "SPAWN_CLUSTER_PROCS": 0,
    "API_URL_PREFIX": "/api/v1/",
    "POLL_RATE_MS": 2000,
    "CACHE_DIR": "./cache",
    "CLEAR_PROTECTION_MINUTES": 20,
    "RECOMMENDED_FEE_PERCENTILE": 50,
    "BLOCK_WEIGHT_UNITS": 4000000,
    "INITIAL_BLOCKS_AMOUNT": 8,
    "MEMPOOL_BLOCKS_AMOUNT": 8,
    "PRICE_FEED_UPDATE_INTERVAL": 3600
  },
  "CORE_RPC": {
    "HOST": "<local node server ip>",
    "PORT": 8332,
    "USERNAME": "mempool",
    "PASSWORD": "<rpcpassword generated by rpcauth.py>"
  },
  "ELECTRUM": {
    "HOST": "<local node server ip>",
    "PORT": 50002,
    "TLS_ENABLED": true
  },
  "ESPLORA": {
    "REST_API_URL": "http://127.0.0.1:3000"
  },
  "CORE_RPC_MINFEE": {
    "ENABLED": false,
    "HOST": "<local node server ip>",
    "PORT": 8332,
    "USERNAME": "mempool",
    "PASSWORD": "<rpcpassword generated by rpcauth.py>"
  },
  "DATABASE": {
    "ENABLED": true,
    "HOST": "127.0.0.1",
    "PORT": 3306,
    "DATABASE": "mempool",
    "USERNAME": "mempool",
    "PASSWORD": "mempool"
  },
  "SYSLOG": {
    "ENABLED": true,
    "HOST": "127.0.0.1",
    "PORT": 514,
    "MIN_PRIORITY": "info",
    "FACILITY": "local7"
  },
  "STATISTICS": {
    "ENABLED": true,
    "TX_PER_SECOND_SAMPLE_PERIOD": 150
  },
  "BISQ": {
    "ENABLED": false,
    "DATA_PATH": "/bisq/statsnode-data/btc_mainnet/db"
  }
}

Thanks in advance.

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
The trust scores you see are subjective; they will change depending on who you have in your trust list.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715218031
Hero Member
*
Offline Offline

Posts: 1715218031

View Profile Personal Message (Offline)

Ignore
1715218031
Reply with quote  #2

1715218031
Report to moderator
1715218031
Hero Member
*
Offline Offline

Posts: 1715218031

View Profile Personal Message (Offline)

Ignore
1715218031
Reply with quote  #2

1715218031
Report to moderator
1715218031
Hero Member
*
Offline Offline

Posts: 1715218031

View Profile Personal Message (Offline)

Ignore
1715218031
Reply with quote  #2

1715218031
Report to moderator
DireWolfM14 (OP)
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
September 27, 2021, 04:21:18 PM
 #2

Code:
/usr/local/bin/mempool/backend/dist/index.js:24
    wss;
       ^

SyntaxError: Unexpected token ;

I'm beginner at JS/TS, but looks like it's syntax error rather than mistake on file configuration. Did you grab the source code from release page (https://github.com/mempool/mempool/releases) or clone the master branch?

I followed the instructions in the README.md file, so first I cloned the master:

Code:
git clone https://github.com/mempool/mempool

Then I checked out latest release:

Code:
latestrelease=$(curl -s https://api.github.com/repos/mempool/mempool/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
git checkout $latestrelease

I've installed all the dependencies using apt, so they should all be stable LTS versions.  I also installed npm. 

It might be helpful to mention linux distro you use and version of your NodeJS.

Good point:

Both servers are running Ubuntu Server version 20.04.3 LTS.   I only installed NodeJS onto the machine I want to run mempool, the version installed by the app manager is 10.19.0.  I just looked up the NodeJS site, and noticed their latest LTS version is 14.17.16.  The version I have was originally released in February of 2020.  That may have something to do with it, odd that such an old package is the one installed by apt.

I'll try installing the newer LTS version of NodeJS, hope it helps.

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7490


Crypto Swap Exchange


View Profile
September 28, 2021, 08:51:11 AM
Merited by DireWolfM14 (2)
 #3

I followed the instructions in the README.md file, so first I cloned the master:

Code:
git clone https://github.com/mempool/mempool

Then I checked out latest release:

Code:
latestrelease=$(curl -s https://api.github.com/repos/mempool/mempool/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
git checkout $latestrelease

You checked out the latest stable version, so i think it's not the problem.

Both servers are running Ubuntu Server version 20.04.3 LTS.   I only installed NodeJS onto the machine I want to run mempool, the version installed by the app manager is 10.19.0.  I just looked up the NodeJS site, and noticed their latest LTS version is 14.17.16.  The version I have was originally released in February of 2020.  That may have something to do with it, odd that such an old package is the one installed by apt.

I'll try installing the newer LTS version of NodeJS, hope it helps.

IMO it's the problem. According to https://nodejs.org/en/about/releases/ and https://en.wikipedia.org/wiki/Node.js#Releases, v10 was released on 2018 & no longer updated. Meanwhile v14 is released on 2020, but still actively supported until few years later. On a side note, you should use rolling-release linux distro if you really want up-to-date package.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
DireWolfM14 (OP)
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
September 28, 2021, 02:26:57 PM
 #4

IMO it's the problem. According to https://nodejs.org/en/about/releases/ and https://en.wikipedia.org/wiki/Node.js#Releases, v10 was released on 2018 & no longer updated. Meanwhile v14 is released on 2020, but still actively supported until few years later. On a side note, you should use rolling-release linux distro if you really want up-to-date package.

I installed the npm package "n" and used that to update to the latest LTS version of Node.js.  The funny thing is it didn't update NodeJS, just Node.js.  To prevent the older version from being used I removed it using apt, then created a simlink to the new package.

That resolved the errors I was getting while trying to run the backend, but I got another error that I'm now trying to work out: ECONNREFUSED port 8332.  Once again I checked all my settings, but was unable to find from where the error is stemming.  Mempool connects to my Electrum server just fine, but Bitcoin Core is refusing the connection for some unknown reason.

I have the following lines in my bitcoin.conf file:

Code:
rpcbind:127.0.0.1
rpcallowip:<local mempool server ip>
rpcport:8332

I tried disabling all those one at a time, and also all three together but nothing helped.

@DaveF, please go easy on me.  Cheesy

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
vv181
Legendary
*
Offline Offline

Activity: 1932
Merit: 1273


View Profile
September 28, 2021, 04:56:42 PM
Merited by LoyceV (4), ABCbits (2), Pmalek (2), Husna QA (2), DireWolfM14 (2)
 #5

~
Try to add this on your bitcoin.conf, let's see if that solve the issue since I have a similar problem back then when I tried to set up mempool on my PC and node on my RasPi.

Code:
rpcbind:127.0.0.1
rpcbind:<local node server IP>
rpcallowip:<local mempool server ip>
rpcport:8332
DireWolfM14 (OP)
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
September 28, 2021, 11:19:07 PM
 #6

~
Try to add this on your bitcoin.conf, let's see if that solve the issue since I have a similar problem back then when I tried to set up mempool on my PC and node on my RasPi.

Code:
rpcbind:127.0.0.1
rpcbind:<local node server IP>
rpcallowip:<local mempool server ip>
rpcport:8332

That did it, thanks for the suggestion!  My mempool backend is running!  Thank you for your help, gentlemen.  I'll see you when I have trouble with the frontend.  Grin

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6730


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 29, 2021, 08:07:15 AM
 #7

A side note: "Latest" or "Rolling" releases of node break a lot of packages that would otherwise build fine on older node versions, so you're probably better off with sticking to v14 LTS for now.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DireWolfM14 (OP)
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
September 29, 2021, 12:46:35 PM
Last edit: September 29, 2021, 02:11:12 PM by DireWolfM14
Merited by ABCbits (1)
 #8

A side note: "Latest" or "Rolling" releases of node break a lot of packages that would otherwise build fine on older node versions, so you're probably better off with sticking to v14 LTS for now.

Yeah, to update I used the npm tool "n" with this command: sudo n lts, which installed the current LTS version, 14.17.6.


The funny thing is it didn't update NodeJS, just Node.js.

Those two are different? I thought it's just different name.

I believe they are interchangeable.  After updating, when I checked the version I got two different versions.  For example, when I checked the version of Node.js I got this:
Code:
~: node -v
v14.17.6

When I checked the version of NodeJS, I got the old version:
Code:
~: nodejs -v
v10.19.0

When I updated, a comment in the update log mentioned that the new package was installed in a new directory, the file location is /usr/local/bin/node.   NodeJS, however was installed at /usr/bin/nodejs.

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!