maticnetwork / bor

Official repository for the Polygon Blockchain
https://polygon.technology/
GNU Lesser General Public License v3.0
1.01k stars 489 forks source link

How to build an archive node in bor and how to configure and use genesis.json #1122

Closed zyx0355 closed 8 months ago

zyx0355 commented 9 months ago

I modified config.toml as follows: syncmode = "full" gcmode = "archive" But I don’t know how to use the provided genesis.json file to synchronize blocks from 0, and the following problem occurs,Never been able to synchronize from block 0

WARN [01-10|12:22:45.729] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:22:45.729] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:24:25.728] Got new checkpoint from heimdall start=15,622,563 end=15,623,074 rootHash=0xb736137bf6b0afa6d6291cae3572827806f58b160928ef76b51dc51392c7aab6 WARN [01-10|12:24:25.728] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:24:25.728] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:26:05.759] Got new checkpoint from heimdall start=15,623,075 end=15,624,610 rootHash=0x9c612f22c470b624a737022802016300cdba7e820aabd4925cfa9c0d3e7d728c WARN [01-10|12:26:05.759] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:26:05.759] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:27:45.729] Got new checkpoint from heimdall start=15,627,427 end=15,627,682 rootHash=0xf0c969c92f5b651faeccd5bd7d147ab2ceba6c99576de7e7920c31dc27854c66 WARN [01-10|12:27:45.729] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:27:45.729] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:29:25.737] Got new checkpoint from heimdall start=15,627,683 end=15,627,938 rootHash=0x347db4f282af42d53fd1460e70f63163d8dfcab2f4b5acec453c396874041ed0 WARN [01-10|12:29:25.737] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:29:25.737] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:31:05.741] Got new checkpoint from heimdall start=15,630,499 end=15,630,754 rootHash=0xc9f9d8d919dbb3567a7e3f0b6f5024d8e6323813feb0e30690ef9933d6b32eaa WARN [01-10|12:31:05.741] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:31:05.741] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:32:45.729] Got new checkpoint from heimdall start=15,632,035 end=15,632,546 rootHash=0xb81873ed6a6d196e66840d2495f3ca4651d413e6d90891bfbec46a274befe4bd WARN [01-10|12:32:45.729] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:32:45.729] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:34:25.728] Got new checkpoint from heimdall start=15,633,315 end=15,633,826 rootHash=0x61c612b34bb3a5b78d5f82ade9012e843f013d1bfe61bd47b9fb6530959c09ab WARN [01-10|12:34:25.728] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:34:25.728] unable to handle whitelist checkpoint err="missing blocks" INFO [01-10|12:36:05.729] Got new checkpoint from heimdall start=15,635,875 end=15,636,130 rootHash=0x790fcf3ffcda828ad4e09a2c6820b7492e2ad6bb7b9de28a7ae54fb30ee65f00 WARN [01-10|12:36:05.729] Failed to whitelist checkpoint err="missing blocks" WARN [01-10|12:36:05.729] unable to handle whitelist checkpoint err="missing blocks"

zyx0355 commented 9 months ago

Hello, @Vasually I would like to ask you about how to use the genesis.json of the bor client. Can it be placed in the same directory as the config.toml file? Or does the genesis.json file have other special configurations?

zyx0355 commented 9 months ago

hello,@Vasually

Could you please tell me the relevant operation method directly? This channel didn't give me any help

zyx0355 commented 9 months ago

hello @Vasually Do you mean that you can't build a polygon archive node on your local computer now? Will the relevant development departments open up related technologies in the future?

zyx0355 commented 9 months ago

Hello, I would like to ask about whether the bor client can build an archive node. And,do you mean that you can't build a polygon archive node on your local computer now? Will the relevant development departments open up related technologies in the future?

0xsharma commented 9 months ago

Hey @zyx0355 @Vasually ,

You can take reference from here : Docs.

Please let us know if you're still facing this. Thank you 💜

0xsharma commented 9 months ago

@zyx0355 using genesis.json is for custom networks(devnets). For mainnet or mumbai, use chain=mainnet or chain=mumbai.

Let me know how it goes. 💜

zyx0355 commented 9 months ago

@0xsharma hello ,Here are my config.toml settings: identity = "docker.example" chain = "/bor-home/genesis.json" datadir = "/bor-home" syncmode = "full" gcmode = "archive" The situation that occurs now is as follows, the data cannot be synchronized from block 0.

WARN [01-26|05:36:41.282] Error reading unclean shutdown markers error="leveldb: not found" INFO [01-26|05:36:41.282] Enabling metrics collection INFO [01-26|05:36:41.282] Enabling metrics export to prometheus path=http://127.0.0.1:7071/debug/metrics/prometheus INFO [01-26|05:36:41.282] Starting peer-to-peer node instance=bor/v1.1.0/linux-amd64/go1.20.5 INFO [01-26|05:36:41.495] New local node record seq=1,706,247,401,493 id=9b51abccc1f64486 ip=127.0.0.1 udp=30303 tcp=30303 INFO [01-26|05:36:41.495] Started P2P networking self=enode://6e0ab2cc31d46fa87518cf377b4f6b8f4cf5ee3b865cf6b80714b99fea5b25c2d5a9f54f2c4dd26c1b6e74b550649567a6a5ac9e562e48dab1ca4a7379d6db84@127.0.0.1:30303 INFO [01-26|05:36:41.499] IPC endpoint opened url=/bor-home/bor.ipc WARN [01-26|05:36:41.500] Sanitizing invalid HTTP read header timeout provided=0s updated=30s INFO [01-26|05:36:41.500] HTTP server started endpoint=[::]:8545 auth=false prefix= cors=localhost vhosts=localhost INFO [01-26|05:36:41.501] TxFetcher txArrivalWait=500ms INFO [01-26|05:36:41.540] Got new checkpoint from heimdall start=35,295,654 end=35,296,677 rootHash=0x01cd1cc251136df052e8c2709abaabbab57db87a566f4fb5cacf50161f2eb911 WARN [01-26|05:36:41.540] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|05:36:41.540] unable to start the whitelist checkpoint service - first run err="missing blocks" INFO [01-26|05:36:52.015] Looking for peers peercount=0 tried=3 static=0 INFO [01-26|05:37:02.534] Looking for peers peercount=0 tried=1 static=0 INFO [01-26|05:37:16.496] Looking for peers peercount=0 tried=0 static=0 INFO [01-26|05:38:21.545] Got new checkpoint from heimdall start=35,297,702 end=35,298,213 rootHash=0xfff3dab8ee3ef621b04816e99ac9634946b7235d36d00243846c175b36b62ec0 WARN [01-26|05:38:21.545] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|05:38:21.545] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|05:40:01.546] Got new checkpoint from heimdall start=35,299,238 end=35,299,749 rootHash=0x5034fbbc86f416d7e6ef21ef8d624114730d2ac0ef788e9e782a86a317cc92bc WARN [01-26|05:40:01.546] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|05:40:01.546] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|05:41:41.544] Got new checkpoint from heimdall start=35,299,238 end=35,299,749 rootHash=0x5034fbbc86f416d7e6ef21ef8d624114730d2ac0ef788e9e782a86a317cc92bc WARN [01-26|05:41:41.544] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|05:41:41.544] unable to handle whitelist checkpoint err="missing blocks"

image

0xsharma commented 9 months ago

@zyx0355 the node has started and it's unable to find peers. You can ignore unable to whitelist WARN logs.

For peering, you can use bootnodes from here.

Then, wait for 10 mins and your node should have started syncing ✅

zyx0355 commented 9 months ago

I have started it for more than an hour, but the log is still like this: WARN [01-26|06:08:21.545] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:08:21.545] unable to handle whitelist checkpoint err="missing blocks" +INFO [01-26|06:10:01.545] Got new checkpoint from heimdall start=35,324,582 end=35,325,093 rootHash=0x4229a077df319fd5442241979d2d60570a0e8d6fcb14da9b71a0422abeb06123 WARN [01-26|06:10:01.546] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:10:01.546] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:11:41.544] Got new checkpoint from heimdall start=35,325,606 end=35,326,373 rootHash=0x996dbe6ad2a17cbc98ef719a7e6f788b31a455e6a5e451eca508e1364bb5b24c WARN [01-26|06:11:41.544] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:11:41.544] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:13:21.545] Got new checkpoint from heimdall start=35,326,374 end=35,327,397 rootHash=0xf92e9a3d09003aee012b7d7f5dc3e12deea5545bfa4c1171312665dc77a9a093 WARN [01-26|06:13:21.546] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:13:21.546] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:15:01.550] Got new checkpoint from heimdall start=35,328,166 end=35,328,677 rootHash=0xb2bfe2bcf1f0bd4a9d21bea86311c34c4c8dc027a9dad23df855b7df79639a9d WARN [01-26|06:15:01.551] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:15:01.551] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:16:41.544] Got new checkpoint from heimdall start=35,329,190 end=35,329,701 rootHash=0x652aaa7e1284c96579c99aa8bca26bfb5e4dc071d7046631553baf68466586df WARN [01-26|06:16:41.544] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:16:41.544] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:18:21.545] Got new checkpoint from heimdall start=35,330,470 end=35,331,237 rootHash=0xe2951ddff5bd40424e6828e47aa36bc7e486291a169381a40a2f5ef4b485cadf WARN [01-26|06:18:21.545] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:18:21.545] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:20:01.545] Got new checkpoint from heimdall start=35,332,774 end=35,333,285 rootHash=0x73222c5a3e8f0be921d2700de5364209aaba82a731b722893f53c87ad816c08d WARN [01-26|06:20:01.546] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:20:01.546] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:21:41.545] Got new checkpoint from heimdall start=35,333,286 end=35,333,797 rootHash=0x149df57126bb3f04e96cc3c8f40dd8816e3c9f882cd79fb7cd010f272a57d525 WARN [01-26|06:21:41.545] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:21:41.545] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:23:21.545] Got new checkpoint from heimdall start=35,335,590 end=35,336,613 rootHash=0xab3736eae67408ee1baabba1612a0e7d95a3f2cab651378530d60883ace7d8c5 WARN [01-26|06:23:21.545] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:23:21.545] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:25:01.546] Got new checkpoint from heimdall start=35,337,638 end=35,337,893 rootHash=0x67cde2561b2978ff7121275a149a83085cd5c201ea67f1687511aa279191721a WARN [01-26|06:25:01.546] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:25:01.546] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:26:41.544] Got new checkpoint from heimdall start=35,338,406 end=35,339,173 rootHash=0x94a8f536de9a4c0bb0f738521039e1846601e3ae85c79db4160225c32b8855bb WARN [01-26|06:26:41.544] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:26:41.544] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:28:21.568] Got new checkpoint from heimdall start=35,338,406 end=35,339,173 rootHash=0x94a8f536de9a4c0bb0f738521039e1846601e3ae85c79db4160225c32b8855bb WARN [01-26|06:28:21.568] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:28:21.568] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:30:01.546] Got new checkpoint from heimdall start=35,340,966 end=35,341,477 rootHash=0x57764d1f0246736510297992fe5c94e517b07cdbc10269795d67902972b4ff1b WARN [01-26|06:30:01.546] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:30:01.546] unable to handle whitelist checkpoint err="missing blocks" INFO [01-26|06:31:41.544] Got new checkpoint from heimdall start=35,340,966 end=35,341,477 rootHash=0x57764d1f0246736510297992fe5c94e517b07cdbc10269795d67902972b4ff1b WARN [01-26|06:31:41.544] Failed to whitelist checkpoint err="missing blocks" WARN [01-26|06:31:41.544] unable to handle whitelist checkpoint err="missing blocks" image

zyx0355 commented 9 months ago

@0xsharma hello, Could you please take a look at the above log information?

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

Raneet10 commented 8 months ago

Hey @zyx0355 , are you still facing this issue ? The logs you see are normal since bor is trying to whitelist checkpoint blocks that it doesn't have locally, which means it is syncing and importing blocks. Can you check whether your node is connected to enough peers ? Did you configure the bootnodes as @0xsharma mentioned above ?

anshalshukla commented 8 months ago

hey @zyx0355, we are closing this issue feel free to reopen it if you are still facing it.