0

I tried running cargo run -- --dev after building. However i get this error 0: Invalid input: Error opening spec file dev: No such file or directory (os error 2).

I don't know rust and substrate however after slight debugging i found it to breaking at line https://github.com/paritytech/polkadot-sdk/blob/e38998801e433ecc569ff6d58d1d0aa80eaff771/polkadot/cli/src/command.rs#L149.

Variable named path is coming as dev. If i directly pass spec json path (polkadot/node/service/chain-specs/polkadot.json) in the above line then it is able to fetch the spec but gives error unable to find binary in paths /users/$NAME/blockchain/polkadot-sdk/target/debug and /usr/lib/polkadot.

Error 0: Worker binaries could not be found, make sure polkadot was built/installed correctly. If you ran with `cargo run`, please run `cargo build` first. Searched given workers path (None), polkadot binary path ("/Users/$NAME/blockchain/polkadot-sdk/target/debug"), and lib path (/usr/lib/polkadot), workers names: None.

However the binary is present in the first path atleast. I cannot directly run a binary after downloading as i need to make some code changes and plug it to polkadot js apps.

target folder screenshot

2
  • Which binary do you want to run? (parachain-)node-template/polkadot? Sep 18, 2023 at 10:23
  • @DaanvanderPlas Polkadot Sep 18, 2023 at 11:25

2 Answers 2

1

You can also run the binary directly from the path if you have built the code using --release then the binary would be in /target/release/"bianry_name" and you can run it via the command ./target/release/"bianry_name" --dev .

And if you didn't built the code in --release than you binary will be in /target/debug/"bianry_name" and you can run it through command ./target/debug/"bianry_name" --dev

1
  • 1
    I have also tried that and it gives me this error Error: 0: Worker binaries could not be found, make sure polkadot was built/installed correctly. If you ran with `cargo run`, please run `cargo build` first. Searched given workers path (None), polkadot binary path ("/Users/rajdeepsingh/blockchain/polkadot-sdk/target/debug"), and lib path (/usr/lib/polkadot), workers names: None Have updated the original question with a screenshot of target folder and the binary exists Sep 19, 2023 at 5:20
1

This was an ongoing issue raised in polkadot-sdk repo. Answered there, linking here

https://github.com/paritytech/polkadot-sdk/issues/1372#issuecomment-1725114216

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.