generated from tangle-network/blueprint-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
134 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
fn main() { | ||
println!("cargo:rerun-if-changed=src/main.rs"); | ||
println!("cargo:rerun-if-changed=src/lib.rs"); | ||
blueprint_metadata::generate_json(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
function required_tool() { | ||
if ! command -v $1 &> /dev/null | ||
then | ||
echo "$1 could not be found" | ||
echo "hint: install $1 using $2" | ||
exit 1 | ||
fi | ||
} | ||
|
||
required_tool subkey "cargo install -f subkey" | ||
required_tool cargo-tangle "cargo install -f cargo-tangle" | ||
required_tool jq "https://jqlang.github.io/jq/download/" | ||
|
||
function insert_key() { | ||
if [ "$#" -ne 3 ]; then | ||
echo "Usage: insert_key <key> <scheme> <path>" | ||
exit 1 | ||
fi | ||
echo "Inserting key $1 (Scheme: $2) into $3" | ||
# remove 0x prefix from seed | ||
seed=$(subkey inspect "$1" --scheme $2 --output-type json | jq -r '.secretSeed' | sed 's/^0x//') | ||
cargo tangle blueprint keygen -k $2 -s $seed -p $3 | ||
} | ||
|
||
# Alice | ||
insert_key "//Alice" "sr25519" "target/keystore/alice" | ||
insert_key "//Alice" "ed25519" "target/keystore/alice" | ||
insert_key "//Alice" "ecdsa" "target/keystore/alice" | ||
# Bob | ||
insert_key "//Bob" "sr25519" "target/keystore/bob" | ||
insert_key "//Bob" "ed25519" "target/keystore/bob" | ||
insert_key "//Bob" "ecdsa" "target/keystore/bob" | ||
# Charlie | ||
insert_key "//Charlie" "sr25519" "target/keystore/charlie" | ||
insert_key "//Charlie" "ed25519" "target/keystore/charlie" | ||
insert_key "//Charlie" "ecdsa" "target/keystore/charlie" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters