Bitcoin Forum
June 03, 2024, 11:30:40 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: mempool / electrs install, can load transactions but not addresses  (Read 227 times)
szeco (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 07, 2021, 12:47:07 PM
 #1

Hi all,

https://github.com/seth586/guides/blob/master/FreeNAS/bitcoin/README.md

I pretty much followed this excellent FreeNAS guide to get my bitcoin and lnd node up and running. I can load my local mempool install up and view any blocks/transactions without problems. But when I try to navigate/search for a particular address it always ends up with "Error loading address data." Is this a syncing issue? It's been almost a week since I got electrs up and running. Is there any way to know when a full sync has completed? Any specific logs I can inspect?

Thanks
NotATether
Legendary
*
Online Online

Activity: 1624
Merit: 6866


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 07, 2021, 04:07:58 PM
 #2

In the case of the Bitcoin node, you can use getchaintips RPC and it will tell you the current block height the node has processed. It also has a field for flags and at what block height they are activated; chances are if you aren't anywhere close to the Taproot flag block height then your node is not completely verified.

There is also a friendlier getblockchaininfo RPC that gives you the verification process as a decimal between 0 and 1 ( 1=fully verified ).

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
szeco (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 07, 2021, 11:08:31 PM
 #3

In the case of the Bitcoin node, you can use getchaintips RPC and it will tell you the current block height the node has processed. It also has a field for flags and at what block height they are activated; chances are if you aren't anywhere close to the Taproot flag block height then your node is not completely verified.

There is also a friendlier getblockchaininfo RPC that gives you the verification process as a decimal between 0 and 1 ( 1=fully verified ).

getblockchaininfo shows the latest block, and when I send a test transaction I can see it immediately in my mempool view by searching the txid. However if I then click on the associated address that's when I get the "Error loading address data" message.
OddyseyGames
Jr. Member
*
Offline Offline

Activity: 39
Merit: 9


View Profile
December 11, 2021, 10:17:25 AM
 #4

What does the command return?

Code:
bitcoin-cli getmempoolinfo
NeuroticFish
Legendary
*
Offline Offline

Activity: 3696
Merit: 6416


Looking for campaign manager? Contact icopress!


View Profile
December 11, 2021, 10:25:51 AM
 #5

What does the command return?

Code:
bitcoin-cli getmempoolinfo

1. Please don't hijack other's topic. Make your own.
2. You can find your answer in the documentation: https://developer.bitcoin.org/reference/rpc/getmempoolinfo.html

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
OddyseyGames
Jr. Member
*
Offline Offline

Activity: 39
Merit: 9


View Profile
December 11, 2021, 10:42:52 AM
Last edit: December 13, 2021, 08:24:53 PM by Mr. Big
 #6

What does the command return?

Code:
bitcoin-cli getmempoolinfo

1. Please don't hijack other's topic. Make your own.
2. You can find your answer in the documentation: https://developer.bitcoin.org/reference/rpc/getmempoolinfo.html


Sorry, but this is a question for the author to analyze his problem. I think there is a problem with the mempool



We just had a similar problem when the mempool stuck, then we solved the problem of restarting the node with zapwallettxes
OddyseyGames
Jr. Member
*
Offline Offline

Activity: 39
Merit: 9


View Profile
December 11, 2021, 12:22:46 PM
 #7

Any specific logs I can inspect?

I'm not very familiar with FreeNAS (since it's based on FreeBSD), but i would check directory /var/log and check syslog file.

Code:
cd /var/log
cat syslog | grep electrs

Sorry, but this is a question for the author to analyze his problem. I think there is a problem with the mempool

Why do you think the problem is related with Bitcoin Core's mempool?


I do not know about the author, but it happened to me when there are transactions in the mempool that were overwritten or with erroneous waste and the local mempool did not match the network one - I could not get data by addresses.
szeco (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 11, 2021, 10:11:43 PM
 #8

Appreciate the suggestions folks..

getmempoolinfo returns
Quote
{
  "loaded": true,
  "size": 572,
  "bytes": 191953,
  "usage": 1004624,
  "maxmempool": 300000000,
  "mempoolminfee": 0.00001000,
  "minrelaytxfee": 0.00001000,
  "unbroadcastcount": 0
}


nginx logs have some funky http codes, internal server error for the address GET?
Quote
185.220.101.178 - - [12/Dec/2021:09:01:06 +1100] "GET /api/tx/dba3a64c1117fb5c67dfc4546b18968ff6f6d716705427c86c6d7cb6d87afb3f HTTP/1.1" 200 801
185.220.101.178 - - [12/Dec/2021:09:01:07 +1100] "GET /api/tx/dba3a64c1117fb5c67dfc4546b18968ff6f6d716705427c86c6d7cb6d87afb3f/outspends HTTP/1.1" 501 15
185.220.101.178 - - [12/Dec/2021:09:01:51 +1100] "GET /api/address/bc1qn75z0k77ywdc47cu9t68xg67rr3g0sw3pm47jv HTTP/1.1" 500 5

could not find an associate log for electrs.

i can share the clearnet address for the mempool if that might help?

OddyseyGames
Jr. Member
*
Offline Offline

Activity: 39
Merit: 9


View Profile
December 11, 2021, 10:41:10 PM
 #9

Have you followed this instruction?
https://github.com/seth586/guides/blob/master/FreeNAS/bitcoin/freenas_2_bitcoin.md

Did you forget to specify the parameters in the bitcoin conf?

Code:
server=1
txindex=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

Have you tried using the bitcoin-cli getaddressinfo [address] command directly?

Quote
But when I try to navigate/search
As far as I understand, you are using the web page for search? If yes: look what JsonRpc returns. You can do this in the browser in developer mode on the Network tab.
vv181
Legendary
*
Offline Offline

Activity: 1932
Merit: 1273


View Profile
December 12, 2021, 12:02:02 AM
 #10

could not find an associate log for electrs.
It looks like the tutorial you followed did not enable the log for both electrs and mempool. Try to add the below configurations:

Code:
# Electrs
# /usr/local/etc/electrs/config.toml

# add this on the last line
verbose = 4

---

# mempool-config.json
# https://github.com/seth586/guides/blob/master/FreeNAS/bitcoin/freenas_8_mempool.md

# find "SYSLOG" and then change "ENABLED" to true
"SYSLOG": {
    "ENABLED": true,
    "HOST": "127.0.0.1",
    "PORT": 514,
    "MIN_PRIORITY": "info",
    "FACILITY": "local7"
  },

Then restart both applications. After that, run this on terminal $ tail -f /var/log/syslog and then try to open up mempool site again and visit any addresses. Look up at the terminal, it will probably show the loggings.
szeco (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 12, 2021, 02:46:56 AM
 #11

Looks like I might be getting somewhere..

Quote
# bitcoin-cli getaddressinfo 1MDkeWhcTzvnZdqPbJDtPgrLp6QHJeAPNm
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)

Looks like the bitcoin-d install didn't include a wallet and that is required in order to query addresses?? I ran createwallet and it looks OK now.

Quote
# bitcoin-cli createwallet "testwallet"
{
  "name": "testwallet",
  "warning": ""
}

# bitcoin-cli getaddressinfo 1MDkeWhcTzvnZdqPbJDtPgrLp6QHJeAPNm
{
  "address": "1MDkeWhcTzvnZdqPbJDtPgrLp6QHJeAPNm",
  "scriptPubKey": "76a914ddcbf1131395a90e772396e0e5bad51cc2923c7388ac",
  "ismine": false,
  "solvable": false,
  "iswatchonly": false,
  "isscript": false,
  "iswitness": false,
  "ischange": false,
  "labels": [
  ]
}

Inspecting the URL via the Browser dev tools console gets me the same HTTP 500 error
Quote
Request URL: http://mempool.myserver.com/api/address/1MDkeWhcTzvnZdqPbJDtPgrLp6QHJeAPNm
Request Method: GET
Status Code: 500 Internal Server Error
Remote Address: 127.0.0.1:61274
Referrer Policy: strict-origin-when-cross-origin
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 5
Content-Type: text/html; charset=utf-8
Date: Sun, 12 Dec 2021 00:35:02 GMT
ETag: W/"5-fy9qFc+NorJ+Wkr0e1jnrXHAs9k"
Server: nginx
X-Powered-By: Express
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Host: mempool.myserver.com
Referer: http://mempool.myserver.com/address/1MDkeWhcTzvnZdqPbJDtPgrLp6QHJeAPNm
Sec-GPC: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
vv181
Legendary
*
Offline Offline

Activity: 1932
Merit: 1273


View Profile
December 12, 2021, 12:20:15 PM
 #12

I think it is likely the error is not on the Bitcoin side it is rather on the mempool. To be sure, try to add the debug configurations on my post above, I believe it will give clarity why the mempool is returning HTTP 500 since it will log more output on both electrs and mempool.
OddyseyGames
Jr. Member
*
Offline Offline

Activity: 39
Merit: 9


View Profile
December 12, 2021, 12:41:24 PM
 #13

I think it is likely the error is not on the Bitcoin side it is rather on the mempool. To be sure, try to add the debug configurations on my post above, I believe it will give clarity why the mempool is returning HTTP 500 since it will log more output on both electrs and mempool.

You are right.

Quote
Inspecting the URL via the Browser dev tools console gets me the same HTTP 500 error

There may also be an access error.  Start a bitcoin node with the -debug parameter and inspect what the node writes at the time of the request. You can use without -daemon.
szeco (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 13, 2021, 03:47:57 AM
 #14

I think it is likely the error is not on the Bitcoin side it is rather on the mempool. To be sure, try to add the debug configurations on my post above, I believe it will give clarity why the mempool is returning HTTP 500 since it will log more output on both electrs and mempool.

Looks like it's the connection between mempool and electrs as you suspected.

When I use the rpc values in bitcoin.conf as per the original guide I get the occasional error when running mempool, but I can see it syncing
Quote
Dec 13 14:43:40 [75581] DEBUG: Fetched transaction 1 / 6
Dec 13 14:43:40 [75581] DEBUG: Fetched transaction 2 / 6
Dec 13 14:43:40 [75581] DEBUG: Fetched transaction 3 / 6
Dec 13 14:43:40 [75581] DEBUG: Fetched transaction 4 / 6
Dec 13 14:43:40 [75581] DEBUG: Fetched transaction 5 / 6
Dec 13 14:43:40 [75581] DEBUG: Fetched transaction 6 / 6
Dec 13 14:43:40 [75581] DEBUG: Mempool blocks calculated in 0.001 seconds
Dec 13 14:43:40 [75581] DEBUG: New mempool size: 470 Change: 6
Dec 13 14:43:40 [75581] DEBUG: Mempool updated in 0.01 seconds
Dec 13 14:43:41 [75581] DEBUG: Electrum attempting reconnect...
Dec 13 14:43:41 [75581] ERR: Electrum error: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.4.116","port":50001}
Dec 13 14:43:41 [75581] ERR: Electrum error: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.4.116","port":50001}
Dec 13 14:43:41 [75581] INFO: Disconnected from Electrum Server at 192.168.4.116:50001

I tried your suggestion in another thread on here by setting the bind/allowip values
Quote
rpcbind:127.0.0.1
rpcbind:192.168.4.116
rpcallowip:192.168.4.122
rpcport:8332

But that causes mempool to fail immediately on restart (it never connects)
Quote
Dec 13 14:45:53 [75763] DEBUG: updateMempoolInfo: connect ECONNREFUSED 192.168.4.116:8332
Dec 13 14:45:53 [75763] WARN: runMainLoop error: connect ECONNREFUSED 192.168.4.116:8332. Retrying in 10 sec.
Dec 13 14:45:53 [75763] DEBUG: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.4.116","port":8332}
OddyseyGames
Jr. Member
*
Offline Offline

Activity: 39
Merit: 9


View Profile
December 13, 2021, 07:08:16 AM
 #15

I think you might have a firewall. First try using 127.0.0.1 instead of 192.168.4.116

in /electrs/config.toml
Code:
electrum_rpc_addr = "127.0.0.1:50001"

Quote
Make sure that the rcpallowip= coorelates to your local subnet address range.
bitcoin.conf
Code:
rpcbind=127.0.0.1
rpcallowip=192.168.4.0/24
rpcport=8332
szeco (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 13, 2021, 07:17:35 PM
 #16

I think you might have a firewall. First try using 127.0.0.1 instead of 192.168.4.116

in /electrs/config.toml
Code:
electrum_rpc_addr = "127.0.0.1:50001"


hah! my electrum_rpc_addr was already set to 127.0.0.1, changing it back to the local IP 192.168.4.116 has (so far, I think, still indexing) resolved the address lookup issue!

Quote
~$ curl -sSL "http://mempool.myserver/api/address/1KXLMMcwtB9VsbBXboaV6AxUv7mmomWEeR"
{"address":"1KXLMMcwtB9VsbBXboaV6AxUv7mmomWEeR","chain_stats":{"funded_txo_count":0,"funded_txo_sum":979079,"spent_txo_count":0,"spent_txo_sum":0,"tx_count":1},"mempool_stats":{"funded_txo_count":0,"funded_txo_sum":0,"spent_txo_count":0,"spent_txo_sum":0,"tx_count":0},"electrum":true}

However, this does mean that I can no longer connect my desktop electrum to the hosted instance via the onion address which was working before (when I had rpc_addr set to 127.0.0.1) but this is a minor issue, I can probably resolve w opening the port through NAT.
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!