erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.12k stars 1.11k forks source link

RPC on port 8545 does not respond #8368

Open damianlluch opened 1 year ago

damianlluch commented 1 year ago

Hi, I'm sorry to insist, but I can't get the node to work.

I tried to deploy a contract with Hardhat by connecting to the node and I got a timeout.

I have also tried to connect via Metamask and the same thing.

I am starting it this way:

ubuntu@ip-172-31-47-135:~/erigon$ ./build/bin/erigon --chain=mumbai --bor.heimdall=https://heimdall-api-testnet.polygon.technology --bor.milestone=true --http=true --http.addr=0.0.0.0 --http.port=8545 --http.compression=true --http.vhosts=any --http.corsdomain=*

image

If I run curl, I get this response.

ubuntu@ip-172-31-47-135:~$ curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params":[], "id":1}' http://172.31.47.135:8545 {"jsonrpc":"2.0","id":1,"result":"0x0"}

Can someone tell me how to move forward?

thank you

AskAlexSharov commented 1 year ago

Quote url

damianlluch commented 1 year ago

Quote url

I don't understand what you mean

AskAlexSharov commented 1 year ago
 --bor.heimdall=https://heimdall-api-testnet.polygon.technology
to
 --bor.heimdall='https://heimdall-api-testnet.polygon.technology'
AskAlexSharov commented 1 year ago

also erigon printing in logs at startup which http addr/port it binded to

damianlluch commented 1 year ago

also erigon printing in logs at startup which http addr/port it binded to

I didn't understand what you meant by this

damianlluch commented 1 year ago

I still can't connect from Metamask, can someone explain what's going on?

thanks

ubuntu@ip-172-31-47-135:~/erigon$ ./build/bin/erigon --chain=mumbai --bor.heimdall='https://heimdall-api-testnet.polygon.technology' --bor.milestone=true --http=true --http.addr=0.0.0.0 --http.port=8545 --http.compression=true --http.vhosts=any --http.corsdomain=*
INFO[10-05|11:52:17.469] logging to file system                   log dir=/home/ubuntu/.local/share/erigon/logs file prefix=erigon log level=info json=false
INFO[10-05|11:52:17.469] Build info                               git_branch=devel git_tag=v2.49.1-1686-g72ba18bd3 git_commit=72ba18bd3679a6d48e8901329e6cc2a5ad7a5c42
INFO[10-05|11:52:17.469] Starting Erigon on Mumbai testnet... 
INFO[10-05|11:52:17.470] Maximum peer count                       ETH=100 total=100
INFO[10-05|11:52:17.470] starting HTTP APIs                       APIs=eth,erigon,engine
INFO[10-05|11:52:17.470] torrent verbosity                        level=WRN
INFO[10-05|11:52:19.573] Set global gas cap                       cap=50000000
INFO[10-05|11:52:19.574] [Downloader] Runnning with               ipv6-enabled=true ipv4-enabled=true download.rate=16mb upload.rate=4mb
INFO[10-05|11:52:19.574] Opening Database                         label=chaindata path=/home/ubuntu/.local/share/erigon/mumbai/chaindata
INFO[10-05|11:52:19.576] Initialised chain configuration          config="{ChainID: 80001, Homestead: 0, DAO: <nil>, Tangerine Whistle: 0, Spurious Dragon: 0, Byzantium: 0, Constantinople: 0, Petersburg: 0, Istanbul: 2722000, Muir Glacier: 2722000, Berlin: 13996000, London: 22640000, Arrow Glacier: <nil>, Gray Glacier: <nil>, Terminal Total Difficulty: <nil>, Merge Netsplit: <nil>, Shanghai: <nil>, Cancun: <nil>, Prague: <nil>, Engine: bor}" genesis=0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7
INFO[10-05|11:52:39.578] [snapshots] Creating .torrent files      progress=385/385 alloc=17.4MB sys=35.6MB
INFO[10-05|11:52:39.867] Initialising Ethereum protocol           network=80001
INFO[10-05|11:52:39.867] Opening Database                         label=bor path=/home/ubuntu/.local/share/erigon/mumbai/bor
INFO[10-05|11:52:39.873] Starting private RPC server              on=127.0.0.1:9090
INFO[10-05|11:52:39.873] new subscription to logs established 
INFO[10-05|11:52:39.873] rpc filters: subscribing to Erigon events 
INFO[10-05|11:52:39.873] new subscription to newHeaders established 
INFO[10-05|11:52:39.873] New txs subscriber joined 
INFO[10-05|11:52:39.874] HTTP endpoint opened                     url=[::]:8545 ws=false ws.compression=true grpc=false
INFO[10-05|11:52:39.874] Reading JWT secret                       path=/home/ubuntu/.local/share/erigon/mumbai/jwt.hex
INFO[10-05|11:52:39.874] HTTP endpoint opened for Engine API      url=127.0.0.1:8551 ws=true ws.compression=true
WARN[10-05|11:52:39.876] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[10-05|11:52:39.878] Started P2P networking                   version=67 self=enode://0a2301ffcc65a5d78c98071dcff06f1378d18068224978717e6126746f7474e0783af5d330ef04d368f6506b2d3222609a659380031891f35583b0f7dc180992@127.0.0.1:0 name=erigon/v2.51.0-dev-72ba18bd/linux-amd64/go1.20.1
WARN[10-05|11:52:39.879] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[10-05|11:52:39.880] Started P2P networking                   version=68 self=enode://0a2301ffcc65a5d78c98071dcff06f1378d18068224978717e6126746f7474e0783af5d330ef04d368f6506b2d3222609a659380031891f35583b0f7dc180992@127.0.0.1:0 name=erigon/v2.51.0-dev-72ba18bd/linux-amd64/go1.20.1
INFO[10-05|11:52:39.883] [txpool] Started 
INFO[10-05|11:52:39.883] [1/15 Snapshots] Fetching torrent files metadata 
INFO[10-05|11:52:40.033] Got new checkpoint from heimdall         start=40861443 end=40862210 rootHash=0x78f6116d066d999d8e9127ea81cba4e774fe21dbcbcc6c4eb507c790536c4049
WARN[10-05|11:52:40.033] Failed to whitelist checkpoint           err="missing blocks"
WARN[10-05|11:52:40.033] unable to start the whitelist checkpoint service - first run err="missing blocks"
INFO[10-05|11:52:40.037] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:52:40.037] unable to start the whitelist milestone service - first run err="missing blocks"
INFO[10-05|11:52:52.092] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:52:52.092] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:52:59.942] [1/15 Snapshots] Waiting for torrents metadata: 264/339 
INFO[10-05|11:53:04.098] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:53:04.099] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:53:16.089] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:53:16.089] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:53:19.942] [1/15 Snapshots] Waiting for torrents metadata: 327/339 
INFO[10-05|11:53:28.094] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:53:28.094] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:53:39.942] [1/15 Snapshots] download finished       time=1m0.00026227s
INFO[10-05|11:53:40.115] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:53:40.115] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:53:42.978] [snapshots] Blocks Stat                  blocks=0k indices=0k alloc=1.5GB sys=1.7GB
INFO[10-05|11:53:52.108] Got new milestone from heimdall          start=40863578 end=40863591 hash=0x5bec202a8f20e2d4ce38a118056db4d78bef6d2e8b2529a42cdef878dfe19c5a
WARN[10-05|11:53:52.109] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:54:02.990] [1/15 Snapshots] Indexing                progress="v1-007500-008000-headers.seg=87%, v1-008000-008500-headers.seg=78%, v1-008500-009000-headers.seg=94%, v1-009000-009500-headers.seg=68%, v1-009500-010000-headers.seg=67%" total-indexing-time=20s alloc=3.6GB sys=4.1GB
INFO[10-05|11:54:04.154] Got new milestone from heimdall          start=40863592 end=40863712 hash=0x20edf0b4ae01ad6257c48c2d042821bf9c9453e7e3e991eecd2cf32ac49e2689
WARN[10-05|11:54:04.155] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:54:16.580] Got new milestone from heimdall          start=40863592 end=40863712 hash=0x20edf0b4ae01ad6257c48c2d042821bf9c9453e7e3e991eecd2cf32ac49e2689
WARN[10-05|11:54:16.581] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:54:20.173] Got new checkpoint from heimdall         start=40862211 end=40862978 rootHash=0x8321e24bc03bb50923336ca2cfdeaade4163c4861549855b8fef3536ddc93cd3
WARN[10-05|11:54:20.173] Failed to whitelist checkpoint           err="missing blocks"
WARN[10-05|11:54:20.173] unable to handle whitelist checkpoint    err="missing blocks"
INFO[10-05|11:54:22.985] [1/15 Snapshots] Indexing                progress="v1-015500-016000-headers.seg=100%, v1-016000-016500-headers.seg=100%, v1-016500-017000-headers.seg=100%, v1-017000-017500-headers.seg=100%, v1-017500-018000-headers.seg=3%" total-indexing-time=40s alloc=3.4GB sys=4.4GB
INFO[10-05|11:54:28.094] Got new milestone from heimdall          start=40863592 end=40863712 hash=0x20edf0b4ae01ad6257c48c2d042821bf9c9453e7e3e991eecd2cf32ac49e2689
WARN[10-05|11:54:28.095] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:54:40.262] Got new milestone from heimdall          start=40863713 end=40863726 hash=0x6332e2cfea7caa7819a58f3d744b76fb97118bf54f11febb44bebc04ff0b5bf6
WARN[10-05|11:54:40.263] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:54:42.982] [1/15 Snapshots] Indexing                progress="v1-023000-023500-headers.seg=100%, v1-023500-024000-headers.seg=100%, v1-024000-024500-headers.seg=100%, v1-024500-025000-headers.seg=100%, v1-025000-025500-headers.seg=36%" total-indexing-time=1m0s alloc=3.2GB sys=4.4GB
INFO[10-05|11:54:52.113] Got new milestone from heimdall          start=40863713 end=40863726 hash=0x6332e2cfea7caa7819a58f3d744b76fb97118bf54f11febb44bebc04ff0b5bf6
WARN[10-05|11:54:52.113] unable to handle whitelist milestone     err="missing blocks"
INFO[10-05|11:55:02.982] [1/15 Snapshots] Indexing                progress="v1-030500-031000-headers.seg=100%, v1-031000-031500-headers.seg=100%, v1-031500-032000-headers.seg=90%, v1-032000-032500-headers.seg=79%, v1-032500-033000-headers.seg=20%" total-indexing-time=1m20s alloc=3.0GB sys=4.4GB
INFO[10-05|11:55:04.177] Got new milestone from heimdall          start=40863713 end=40863726 hash=0x6332e2cfea7caa7819a58f3d744b76fb97118bf54f11febb44bebc04ff0b5bf6
WARN[10-05|11:55:04.178] unable to handle whitelist milestone     err="missing blocks"
image image
AskAlexSharov commented 1 year ago

Before using from browser - test it from same server where erigon running. Can you curl from inside seever?

damianlluch commented 1 year ago

image

From curl, it responds correctly if I try to connect. Now from Metamask it keeps giving me timeout. The id of the chain is still 80001 right? I am raising the node in Mumbai.

AskAlexSharov commented 1 year ago

if can connect from inside the machine - it means erigon does bind to this port. Maybe you have firewall/proxy/etc... Maybe you need set --nat mumbai chain id 80001

damianlluch commented 1 year ago

I can connect from inside and outside the machine with curl. Now with web3 and Metamask, impossible, timeout all the time.

Any suggestions?

wmitsuda commented 1 year ago

try to quote cors param?

i.e.: --http.corsdomain='*'

instead of --http.corsdomain=*

damianlluch commented 12 months ago

I have finally been able after 3 weeks (where I have been on and off with this node) to try to launch my node with Mumbai. I finally connected to it through Metamask. Now, How can I get it running in the background? What is the best way?

I currently run it like this:

./build/bin/erigon --chain=mumbai --bor.heimdall=https://heimdall-api-testnet.polygon.technology --bor.milestone=true --http=true --http.addr=0.0.0.0.0 --http.port=8545 --http. compression=true --http.vhosts='*' --http.corsdomain='*' --ws=true --ws.compression=true --http.api=eth,net,trace,web3,erigon --torrent.download.rate=512mb --torrent.upload.rate=512mb

Adding the inverted commas, it seems that was the solution, it really made me spend many hours with it, and today thanks to a comment I saw in the issues, I tried that way and I was able to connect.

Thank you very much for your help.

AskAlexSharov commented 12 months ago

erigon is a shell command (binary) - as any other shell command. All shell rules about special symbols, strings, background run, … are same for all programs.

Can run by: 1>&2 2>> ~/erigon.log < /dev/null &! Can run under systemd/screen/docker/kubernates/…

damianlluch commented 12 months ago

The joy was short-lived, now I have this error. Does it mean that I have run out of disk space when synchronising?

[INFO] [10-20|15:33:40.499] Got new checkpoint from heimdall         start=41430531 end=41431298 rootHash=0x5dac97ccddf57f25d4c831e7191029c42ca7708a373f424ca4a735a99ea083cf
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x16dd606]