cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

Load private keys into `--suri` from a file

Open ltfschoen opened this issue 2 years ago • 3 comments

In one of the YouTube videos by Andrew Jones, he mentioned that instead of uploading a contract with cargo contract upload --suri //Alice for example, it was preferable to use the contracts-ui to avoid exposing private key (if it wasn't one of the build-in accounts).

Are we able to populate the private keys into a text file and interpret its contents via the ``suri` option of the cargo contract command similar to like i did here

ltfschoen avatar May 10 '23 12:05 ltfschoen

Yes please Luke. I don't have time to do this in the near future but would love to see it if anyone wants to pick it up!

rel. https://github.com/paritytech/cargo-contract/issues/674

ascjones avatar May 10 '23 16:05 ascjones

Yes please Luke. I don't have time to do this in the near future but would love to see it if anyone wants to pick it up!

rel. #674

@ascjones I've tried to do it in this PR https://github.com/paritytech/cargo-contract/pull/1134 and it seems to be working fine, just needs some feedback and more cleaning up after that, is that what you were after?

ltfschoen avatar May 28 '23 14:05 ltfschoen

@ascjones FYI, i don't think this is a necessary feature since you can just load the secrets from an environment variable using a bash script or similar like this https://github.com/ltfschoen/validator-scripts?tab=readme-ov-file#rotate-validator-session-keys-with-via-cli-with-polkadotjs-tools-instead-of-via-ui-with-polkadotjs-apps, which saved having to add this feature https://github.com/polkadot-js/tools/issues/82

ltfschoen avatar May 10 '24 07:05 ltfschoen