Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why curl eth_blockNumber result 0x0 #96

Closed
lk479o000 opened this issue May 22, 2023 · 4 comments
Closed

why curl eth_blockNumber result 0x0 #96

lk479o000 opened this issue May 22, 2023 · 4 comments
Assignees

Comments

@lk479o000
Copy link

lk479o000 commented May 22, 2023

nohup ./build/bin/erigon --chain=bsc --datadir=/erigon_chain --http=true --http.addr=0.0.0.0 --http.port=9001 --http.api=eth,erigon,web3,net,debug,trace,txpool --ws --torrent.port=42069 --torrent.download.rate=32mb --authrpc.port=8551 --private.api.addr=127.0.0.1:9090 --db.pagesize=16kb --snapshots=true --rpc.batch.limit=10000 --prune=htc --prune.h.older=90000 --prune.t.older=90000 --prune.c.older=90000 &

curl -s -H "Content-Type:application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 0.0.0.0:9001

{"jsonrpc":"2.0","id":1,"result":"0x0"}

Synchronized to the latest block:
[INFO] [05-22|02:57:18.958] [2/15 Headers] Wrote block headers number=28421656 blk/second=9.600 alloc=2.6GB sys=3.3GB
[INFO] [05-22|02:57:38.958] [2/15 Headers] No block headers to write in this log period block number=28421656
[INFO] [05-22|02:57:58.496] [p2p] GoodPeers eth66=31 eth68=1
[INFO] [05-22|02:57:58.905] [txpool] stat pending=1 baseFee=0 queued=14 alloc=2.7GB sys=3.3GB
[INFO] [05-22|02:57:58.958] [2/15 Headers] No block headers to write in this log period block number=28421656
[INFO] [05-22|02:58:18.958] [2/15 Headers] No block headers to write in this log period block number=28421656
[INFO] [05-22|02:58:38.958] [2/15 Headers] No block headers to write in this log period block number=28421656
[INFO] [05-22|02:58:58.905] [txpool] stat pending=1 baseFee=0 queued=14 alloc=2.5GB sys=3.3GB
[INFO] [05-22|02:58:58.958] [2/15 Headers] No block headers to write in this log period block number=28421656
[INFO] [05-22|02:59:18.958] [2/15 Headers] No block headers to write in this log period block number=28421656

@calmbeing
Copy link

Because you specified prune flag which will prune the data before latest 90000 block, prune=htc --prune.h.older=90000 --prune.t.older=90000 --prune.c.older=90000

@lk479o000
Copy link
Author

lk479o000 commented May 22, 2023

Because you specified prune flag which will prune the data before latest 90000 block, prune=htc --prune.h.older=90000 --prune.t.older=90000 --prune.c.older=90000

I don't quite understand.
I just want the latest 90000 block data, and I don't care about historical blocks

curl -s -H "Content-Type:application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 0.0.0.0:9001

Isn't this method used to query the latest block number?

@calmbeing
Copy link

By default, the rpcdaemon serves data from localhost:8545. Try below command
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id":1}' localhost:8545

@setunapo
Copy link
Collaborator

setunapo commented Jun 1, 2023

can not reproduce, close

@setunapo setunapo closed this as completed Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants