bsc icon indicating copy to clipboard operation
bsc copied to clipboard

Full Node Synced, But Can't Call RPC?

Open apotheosis721 opened this issue 5 years ago • 25 comments

Hi there,

After days of sync'ing, I was finally able to sync up to the most recent block, but is there something additional that needs to be done before I can call the full node from metamask on a different computer? I tried to put in the server IP address and it doesn't work. Looked through Binance's help docs but it doesn't have any additional info on what to do after sync finishes. Any help would be greatly appreciated!

apotheosis721 avatar Mar 11 '21 19:03 apotheosis721

No extra setup is needed to visit the RPC endpoints. Can you test the network connection from your desktop to the VM?

unclezoro avatar Mar 13 '21 13:03 unclezoro

Yeah I tried to set the server IP address as the URL in metamask under New RPC URL (i.e. http://244.244.244.1 and also without the http) and it kept throwing an error when trying to save.

I'm starting geth with:

nohup geth --config ./config.toml --datadir ./node --pprofaddr {server_IP_address} --metrics --pprof &

in bsc.log, it keeps importing new chain segment where block height finally caught up to the current block. Not sure what else to do.

apotheosis721 avatar Mar 13 '21 18:03 apotheosis721

Yes, I got the same problem. I followed the tutorial: https://docs.binance.org/smart-chain/developer/fullnode.html and waited till it synchronizes all blocks. When I connect to the RPC, it detects chainId correct, but blockNumber is zero, and all transactions that I try to call revert (I call only view methods). When I try to hardcode blockNumber in method calls, it laments about missing trie nodes, although trie nodes not missing was the whole point of running a full node myself.

jazzandrock avatar Mar 22 '21 12:03 jazzandrock

@jazzandrock you should wait until states are fully synced

sai-voiddev avatar Mar 22 '21 14:03 sai-voiddev

@sai-voiddev Thanks for reply. Indeed, it synced all the blocks but I see a lot of Imported new state entries in the logs. I'll leave it syncing for a couple of days or longer, and if it will work, I'll write here how long did I have to wait.

jazzandrock avatar Mar 22 '21 15:03 jazzandrock

Oh my god, it stopped logging Imported new state entries, now just Imported new block headers with latest block number. But still when connecting to rpc, it gives blockNumber 0. What did I do wrong

jazzandrock avatar Mar 26 '21 13:03 jazzandrock

What does it say when you attach through the IPC socket? ./geth attach --datadir node Is the response on eth.syncing false?

dsbaars avatar Mar 28 '21 00:03 dsbaars

@dsbaars no, it says:

> eth.syncing
{
  currentBlock: 6101653,
  highestBlock: 6101743,
  knownStates: 66144870,
  pulledStates: 66144457,
  startingBlock: 6091067
}

I'm launching it with

geth --config ./config.toml --datadir ./node -unlock $ADDRESS --password password.txt  --mine --gcmode archive --allow-insecure-unlock  --pprofaddr 0.0.0.0 --metrics --pprof

My config.toml:

[Eth.Miner]
GasFloor = 30000000
GasCeil = 40000000
GasPrice = 1000000000
Recommit = 10000000000
Noverify = false

[Eth.TxPool]
Locals = []
NoLocals = true
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1000000000
PriceBump = 10
AccountSlots = 512
GlobalSlots = 10000
AccountQueue = 256
GlobalQueue = 5000
Lifetime = 10800000000000


[Node]
IPCPath = "geth.ipc"
HTTPHost = "localhost"
NoUSB = true
InsecureUnlockAllowed = false
HTTPPort = 8545
HTTPVirtualHosts = ["localhost"]
HTTPModules = ["eth", "net", "web3", "txpool", "parlia"]
WSPort = 8546
WSModules = ["net", "web3", "eth"]
GraphQLPort = 8557
GraphQLVirtualHosts = ["*"]

[Node.P2P]
MaxPeers = 10
NoDiscovery = false
StaticNodes = ["enode://f3cfd69f2808ef64838abd8786342c0b22fdd28268703c8d6812e26e109f9a7cb2b37bd49724ebb46c233289f22da82991c87345eb9a2dadeddb8f37eeb259ac@18.180.28.21:30311","enode://f420209bac5324326c116d38d83edfa2256c4101a27cd3e7f9b8287dc8526900f4137e915df6806986b28bc79b1e66679b544a1c515a95ede86f4d809bd65dab@54.178.62.117:30311","enode://4924583cfb262b6e333969c86eab8da009b3f7d165cc9ad326914f576c575741e71dc6e64a830e833c25e8c45b906364e58e70cdf043651fd583082ea7db5e3b@18.180.17.171:30311","enode://f329176b187cec87b327f82e78b6ece3102a0f7c89b92a5312e1674062c6e89f785f55fb1b167e369d71c66b0548994c6035c6d85849eccb434d4d9e0c489cdd@34.253.94.130:30311","enode://cbfd1219940d4e312ad94108e7fa3bc34c4c22081d6f334a2e7b36bb28928b56879924cf0353ad85fa5b2f3d5033bbe8ad5371feae9c2088214184be301ed658@54.75.11.3:30311","enode://352a361a9240d4d23bb6fab19cc6dc5a5fc6921abf19de65afe13f1802780aecd67c8c09d8c89043ff86947f171d98ab06906ef616d58e718067e02abea0dda9@79.125.105.65:30311","enode://21530e423b42aed17d7eef67882ebb23357db4f8b10c94d4c71191f52955d97dc13eec03cfeff0fe3a1c89c955e81a6970c09689d21ecbec2142b26b7e759c45@54.216.119.18:30311","enode://786acbdf5a3cf91b99047a0fd8305e11e54d96ea3a72b1527050d3d6f8c9fc0278ff9ef56f3e56b3b70a283d97c309065506ea2fc3eb9b62477fd014a3ec1a96@107.23.90.162:30311","enode://99b07e9dc5f204263b87243146743399b2bd60c98f68d1239a3461d09087e6c417e40f1106fa606ccf54159feabdddb4e7f367559b349a6511e66e525de4906e@54.81.225.170:30311","enode://1479af5ea7bda822e8747d0b967309bced22cad5083b93bc6f4e1d7da7be067cd8495dc4c5a71579f2da8d9068f0c43ad6933d2b335a545b4ae49a846122b261@52.7.247.132:30311"]
ListenAddr = ":30311"
EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000

jazzandrock avatar Mar 29 '21 11:03 jazzandrock

+1 on this. Two nodes, with currentBlock's about 100 blocks behind no matter what. Been syncing for over a week. Block 0 makes sense because it's not caught it, but it's 'never' caught up.

edmundhillary avatar Mar 29 '21 16:03 edmundhillary

Like for the Ethereum blockchain, it seems you really need a SSD. A traditional Hard Disk is not able to keep with the amount of blocks. The only two systems I got in sync got a NVMe SSD (SAMSUNG 970 EVO PLUS 1TB) and sometimes it still gets 2 blocks behind.

dsbaars avatar Mar 29 '21 17:03 dsbaars

+1 +1 we are using AWS EC2 instance with SSD.

eth.syncing; { currentBlock: 6356486, highestBlock: 6356560, knownStates: 189236799, pulledStates: 189229713, startingBlock: 6356200 }

Current block showing 100 block difference in highestBlock. Kindly advice us how to resolve this issue.

osizadmin avatar Apr 07 '21 10:04 osizadmin

Can someone tell how many states we currently have? Mine is on 310474586

erickcrus avatar Apr 08 '21 17:04 erickcrus

Also seeing this issue. I was able to catch up to within 100 blocks of the current within a few hours, but then stuck there for just as long.

AlexWD avatar Apr 24 '21 02:04 AlexWD

Can someone tell how many states we currently have? Mine is on 310474586

@erickcrus did you get synced after all? If yes, how many state entries was the upper bound for you?

maxilang11 avatar May 05 '21 23:05 maxilang11

I had a synced node but I wanted to restart from a fresh node with the 1.10 beta version and it's been syncing for 3 days and it's not able to get fully synced. It's running on a cloud provider VPS with 8vCore 16GB of RAM and 640GB SSD NVMe.

It gets close to highest block but never manages to reach it and it seems it never reaches full sync state.

> eth.syncing
{
  currentBlock: 7341749,
  highestBlock: 7341843,
  knownStates: 349269732,
  pulledStates: 349159109,
  startingBlock: 7327391
}
> eth.blockNumber
0

We use the geth configuration provided in the documentation here: https://docs.binance.org/smart-chain/developer/fullnode.html

I tested the disk performance and it can do 20k IOPS and 80 MB/s. Network bandwidth is at 2GB/s.

Does anyone know how many states there are and if I'm far from it? What could be the bottleneck in my setup?

francoispqt avatar May 12 '21 08:05 francoispqt

Same issue here with an EBS gp2 SSD volume, can only get to about 100 blocks of highestBlock

felipecsl avatar May 17 '21 21:05 felipecsl

@felipecsl - From experience (of mine, and others in various threads), this usually means you don't have enough IOPS. A normal SSD doesn't do it anymore, you need speed equivalent to NVMe.

Would be nice to get a specific "minimum IOPS" metric, but I am not sure if anyone has been able to run a fullnode on AWS.

DefiDebauchery avatar May 18 '21 01:05 DefiDebauchery

@DefiDebauchery thanks, yeah that's super helpful. Was kinda my suspicion. I tried initially with a c1.2xlarge and failed. Trying now with a m6g.2xlarge but I suspect I might run into the same problem.

felipecsl avatar May 18 '21 03:05 felipecsl

@felipecsl

Trying now with a m6g.2xlarge but I suspect I might run into the same problem.

Correct. The issue likely isn't the EC2 specs (though I'm not sure what a c1.x2xlarge has), but rather the performance of the EBS. When I was looking at calculators, it seemed prohibitively expensive to match the IOPS of genuine NVMe. You'd be better off owning the hardware at that point.

DefiDebauchery avatar May 18 '21 03:05 DefiDebauchery

Yup, the on demand price for a storage optimized i3.2xlarge (8 cores, NVMe SSD) is $0.624/hr (~$450/month) which is basically prohibitive, as you pointed out. Maybe I should give up on the idea of running this on AWS altogether 😅

felipecsl avatar May 18 '21 03:05 felipecsl