Could not open genesis config file

1.5k Views Asked by At

I am just following the instruction: https://github.com/near/nearcore/blob/master/chain/indexer/README.md to setup testnet indexer. The command cargo run --release --home-dir ~/.near/testnet init --chain-id testnet --download that was suggested to run in the instruction doesn't work, it seems that we should replace it -> cargo run --release -- --home-dir ~/.near/testnet init --chain-id testnet --download Then, as it was described in the instruction I modified config file to adjust shards. Then run the command: cargo run --release -- --home-dir ~/.near/testnet/ run and receive:

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

I have checked /.near/testnet/ folder and can't find any genesis files there. What I did wrong? Where I can find this genesis file?

OS: Mac OS

2

There are 2 best solutions below

1
On

Try downloading manually (wget or curl, or whichever tool you prefer) the genesis file:

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

and put it into the home folder (~/.near/testnet)

0
On

Codeowner of NEAR Indexer is here.

Thanks for pointing of missing -- in README. I'm fixing it.

As for your problem you can download genesis.json from the link https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/testnet/genesis.json (it was posted in Discord https://discord.com/channels/490367152054992913/708278589031710761/762954092703907850)

init command should have downloaded genesis.json. It might fail downloading if you already have the directory you've provided to --home-dir and there is something placed.

(I have checked init before writing this answer cargo run -- --home-dir ~/.near/test_init/ init --chain-id testnet --download and it has downloaded genesis.json along with other necessary files)

Also using run command try to remove trailing slash from --home-dir like so

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

You can try to start over by removing your ~/.near/testnet and running init command again.