无法打开创世纪配置文件

时间:2020-10-15 06:26:07

标签: rust indexer nearprotocol

我正在遵循以下说明:https://github.com/near/nearcore/blob/master/chain/indexer/README.md 设置测试网索引器。建议在指令中运行的命令cargo run --release --home-dir ~/.near/testnet init --chain-id testnet --download不起作用,看来我们应该替换它-> cargo run --release -- --home-dir ~/.near/testnet init --chain-id testnet --download 然后,如指令中所述,我修改了配置文件以调整分片。 然后运行命令:cargo run --release -- --home-dir ~/.near/testnet/ run并接收:

Finished release [optimized] target(s) in 0.51s
     Running `/Users/bohdan_malkevych/Documents/me/git/near-protocol/nearcore/target/release/indexer-example --home-dir /Users/bohdan_malkevych/.near/testnet/ run`
thread 'main' panicked at 'Could not open genesis config file.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/bohdan_malkevych/Documents/me/git/near-protocol/nearcore/core/chain-configs/src/genesis_config.rs:216:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

我已经检查了/.near/testnet/文件夹,但在该文件夹中找不到任何创世纪文件。 我做错了什么?在哪里可以找到这个创世纪文件?

操作系统:Mac OS

2 个答案:

答案 0 :(得分:4)

NEAR Indexer的代码所有者在这里。

感谢您指出自述文件中缺少的--。我正在解决它。

对于您的问题,您可以从链接https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/testnet/genesis.json下载genesis.json(已发布在Discord https://discord.com/channels/490367152054992913/708278589031710761/762954092703907850中)

init命令应该已经下载了genesis.json。如果您已经拥有提供给--home-dir的目录并且放置了某些内容,则下载可能会失败。

(我在写此答案init之前已经检查过cargo run -- --home-dir ~/.near/test_init/ init --chain-id testnet --download,它已经下载了genesis.json和其他必要的文件)

还使用run命令尝试从--home-dir删除尾部斜杠

cargo run --release -- --home-dir ~/.near/testnet run

您可以尝试通过删除~/.near/testnet并再次运行init命令来重新开始。

答案 1 :(得分:2)

尝试手动下载创世文件(wget或curl或任何您喜欢的工具):

https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/testnet/genesis.json

并将其放入主文件夹(〜/ .near / testnet)