Skip to content

Commit

Permalink
feat(cargo-tangle): key generation (#385)
Browse files Browse the repository at this point in the history
* fix(cli): key generation in cli

* fix(cli): key generation and tests wip

* feat(cli): command-line key generation and tests
  • Loading branch information
Tjemmmic authored Oct 25, 2024
1 parent ea0aadb commit 33e6d27
Show file tree
Hide file tree
Showing 11 changed files with 681 additions and 668 deletions.
568 changes: 275 additions & 293 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions blueprints/incredible-squaring-eigenlayer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ use IncredibleSquaringTaskManager::TaskResponse;
pub mod client;
pub mod constants;
pub mod runner;
#[cfg(test)]
mod tests;

// Codegen from ABI file to interact with the contract.
sol!(
Expand Down
301 changes: 0 additions & 301 deletions blueprints/incredible-squaring-eigenlayer/src/tests.rs

This file was deleted.

7 changes: 6 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "ansi"
color-eyre = { workspace = true }
tangle-subxt = { workspace = true, features = ["std"] }
subxt = { workspace = true, features = ["substrate-compat"] }
gadget-sdk = { workspace = true, features = ["std"] }
gadget-sdk = { workspace = true, features = ["std", "getrandom"] }
gadget-blueprint-proc-macro-core = { workspace = true, features = ["std"] }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["full"] }
Expand All @@ -29,3 +29,8 @@ alloy-provider = { workspace = true }
alloy-network = { workspace = true }
alloy-rpc-types = { workspace = true }
alloy-signer-local = { workspace = true }
hex = { workspace = true }
w3f-bls = { workspace = true }

[dev-dependencies]
tempfile = "3.10.1"
18 changes: 18 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,21 @@ The following environment variables are required for deploying the blueprint:
export SIGNER="//Alice" # Substrate Signer account
export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" # EVM signer account
```

## Generating Keys from the Command Line

The following command will generate a keypair for a given key type:

```shell
cargo tangle blueprint generate-keys -k <KEY_TYPE> -p <PATH> -s <SURI/SEED> --show-secret
```

where it is optional to include the path, seed, or the show-secret flags.


### Flags

- `-k` or `--key-type`: Required flag. The key type to generate (sr25519, ecdsa, bls_bn254, ed25519, bls381).
- `-p` or `--path`: The path to write the generated keypair to. If not provided, the keypair will be written solely to stdout.
- `-s` or `--seed`: The suri/seed to generate the keypair from. If not provided, a random keypair will be generated.
- `--show-secret`: Denotes that the Private Key should also be printed to stdout. If not provided, only the public key will be printed.
Loading

0 comments on commit 33e6d27

Please sign in to comment.