启动 prb 监控,出现这样的错误Module not found: Can't resolve './proto.generated' 改怎么处理

./message/proto.js:1:0
Module not found: Can’t resolve ‘./proto.generated’

1 | import pbRoot, { google, prb } from ‘./proto.generated’
2 |
3 | export const Message = prb.Message
4 | export const MessageType = prb.MessageType

Import trace for requested module:
./pages/api/query_fetcher.js


启动搞定了,但是怎么开始同步呢

到这步了,出错了

{“name”:“prb”,“hostname”:“fetch”,“pid”:29,“level”:30,“chain”:“Kusama”,“msg”:“Connected to chain Kusama using Khala Node v0.1.4-1-8cb47b9-x86_64-linux-gnu”,“time”:“2021-09-25T12:57:11.980Z”,“v”:0}
{“name”:“prb”,“hostname”:“fetch”,“pid”:29,“level”:30,“chain”:“Khala”,“msg”:“Connected to chain Khala using Khala Node v0.1.4-1-8cb47b9-x86_64-linux-gnu”,“time”:“2021-09-25T12:57:11.988Z”,“v”:0}
{“name”:“prb”,“hostname”:“fetch”,“pid”:29,“level”:30,“msg”:“Fetching genesis…”,“time”:“2021-09-25T12:57:11.994Z”,“v”:0}
2021-09-25 12:57:16 RPC-CORE: getBlock(hash?: BlockHash): SignedBlock:: Unable to retrieve header and parent from supplied hash
{“name”:“prb”,“hostname”:“fetch”,“pid”:29,“level”:50,“err”:{“message”:“Unable to retrieve header and parent from supplied hash”,“name”:“Error”,“stack”:“Error: Unable to retrieve header and parent from supplied hash\n at assert (file:///opt/app/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/util/assert.js:24:11)\n at ApiPromise.getBlockRegistry (file:///opt/app/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/api/base/Init.js:192:5)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async callWithRegistry (file:///opt/app/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-core/bundle.js:213:122)”},“msg”:“Unable to retrieve header and parent from supplied hash”,“time”:“2021-09-25T12:57:16.518Z”,“v”:0}
{“name”:“sync_block”,“hostname”:“fetch”,“pid”:18,“level”:30,“moduleName”:“fetch/sync_block”,“code”:255,“msg”:“Subprocess exited.”,“time”:“2021-09-25T12:57:16.671Z”,“v”:0}
ELIFECYCLE Command failed with exit code 255.

我猜这个是需要先 submodule update --init

是不是你的节点没开 --pruning Archive?

如果用的是官方的docker镜像,需要指定环境变量 NODE_ROLE=MINER

如果确实是没开的话,开之前你得先删掉现在的数据库,archive和pruned模式不兼容

搞定了,我用了快照就好,之前是从头开始同步的。