无法打开创世配置文件

Mal*_*dan 3 indexer rust 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
Run Code Online (Sandbox Code Playgroud)

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

操作系统:Mac 操作系统

小智 5

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

感谢您指出--自述文件中的缺失。我正在修理它。

至于你的问题,你可以genesis.json从链接下载https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/testnet/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
Run Code Online (Sandbox Code Playgroud)

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