Author

Topic: Help with mempool.space local install (Read 265 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
September 29, 2021, 04:31:02 AM
#9
The funny thing is it didn't update NodeJS, just Node.js.

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

To prevent the older version from being used I removed it using apt, then created a simlink to the new package.

Consider using manager such as https://github.com/nvm-sh/nvm.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
September 29, 2021, 07:46:35 AM
#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.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
September 29, 2021, 03: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.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
September 28, 2021, 06: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:
rpcallowip:
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
legendary
Activity: 1932
Merit: 1273
September 28, 2021, 11:56:42 AM
#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:
rpcallowip:
rpcport:8332
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
September 28, 2021, 09:26:57 AM
#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:
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
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
September 28, 2021, 03:51:11 AM
#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.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
September 27, 2021, 11:21:18 AM
#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.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
September 26, 2021, 07:29:12 PM
#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

> [email protected] 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! [email protected] start: `node --max-old-space-size=2048 dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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": "",
    "PORT": 8332,
    "USERNAME": "mempool",
    "PASSWORD": ""
  },
  "ELECTRUM": {
    "HOST": "",
    "PORT": 50002,
    "TLS_ENABLED": true
  },
  "ESPLORA": {
    "REST_API_URL": "http://127.0.0.1:3000"
  },
  "CORE_RPC_MINFEE": {
    "ENABLED": false,
    "HOST": "",
    "PORT": 8332,
    "USERNAME": "mempool",
    "PASSWORD": ""
  },
  "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.
Jump to: