Crates.io | cargo-tangle |
lib.rs | cargo-tangle |
version | 0.4.0-alpha.22 |
created_at | 2024-09-30 19:22:38.353197+00 |
updated_at | 2025-08-21 09:49:54.48637+00 |
description | A command-line tool to create and deploy blueprints on Tangle Network |
homepage | https://tangle.tools |
repository | https://github.com/tangle-network/blueprint |
max_upload_size | |
id | 1392088 |
size | 4,246,514 |
Create and Deploy blueprints on Tangle Network.
The Tangle CLI is a command-line tool that allows you to create and deploy blueprints on the Tangle network. It provides a simple and efficient way to manage your blueprints, making it easy to get started with Tangle Blueprints.
To install the Tangle CLI, run the following command:
Supported on Linux, MacOS, and Windows (WSL2)
cargo install cargo-tangle --git https://github.com/tangle-network/blueprint --force
To create a new blueprint using the Tangle CLI, use the following command:
cargo tangle blueprint create --name <blueprint_name>
Replace <blueprint_name>
with the desired name for your blueprint.
cargo tangle blueprint create --name my_blueprint
To build the blueprint, you can simply use cargo as you would with any rust project:
cargo build
To run the unit tests, use the following command:
cargo test
To deploy the blueprint to a local Tangle node, use the following command:
cargo tangle blueprint deploy tangle --devnet --package <package_name>
Replace <package_name>
with the name of the package to deploy, or it can be omitted if the workspace has only one package. Using the devnet flag automatically starts a local Tangle testnet
and creates a keystore for you. The deployment keystore is generated at ./deploy-keystore
with Bob's account keys. Additionally, it generates a second keystore for testing purposes at ./test-keystore
with Alice's account keys.
cargo tangle blueprint deploy tangle --ws-rpc-url ws://localhost:9944 --keystore-path ./my-keystore --package my_blueprint
Expected output:
Blueprint #0 created successfully by 5F3sa2TJAWMqDhXG6jhV4N8ko9rUjC2q7z6z5V5s5V5s5V5s with extrinsic hash: 0x1234567890abcdef
The following environment variables are optional for deploying the blueprint:
SIGNER
: The SURI of the signer account.EVM_SIGNER
: The SURI of the EVM signer account.These environment variables can be specified instead of supplying a keystore when deploying a blueprint. It should be noted that these environment variables are not prioritized over a supplied keystore.
export SIGNER="//Alice" # Substrate Signer account
export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" # EVM signer account
Once the blueprint is deployed, it can now be used on-chain. We have a collection of CLI commands that are useful for interacting with Blueprints, including the ones covered above:
cargo tangle blueprint create
cargo tangle blueprint deploy
cargo tangle blueprint list-requests
cargo tangle blueprint list-blueprints
cargo tangle blueprint register
cargo tangle blueprint request-service
cargo tangle blueprint accept
cargo tangle blueprint reject
cargo tangle blueprint run
cargo tangle blueprint submit
Further details on each command, as well as a full demo, can be found on our Tangle CLI docs page.
The following command will generate a keypair for a given key type:
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.
-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.For all of our features for created and using keys, see the key management section of our CLI docs.