#deployment #tangle #blueprint #create #signer #gadget #tool

bin+lib cargo-tangle

A command-line tool to create and deploy blueprints on Tangle Network

1 unstable release

new 0.1.2 Sep 30, 2024

#26 in #tangle

MIT/Apache and GPL-3.0-or-later…

375KB
7K SLoC

Tangle CLI

Create and Deploy blueprints on Tangle Network.

Table of Contents

  1. Overview
  2. Installation
  3. Creating a New Blueprint/Gadget
  4. Deploying the Blueprint to a Local Tangle Node
  5. Required Environment Variables for Deployment
  6. Examples

Overview

The Tangle CLI is a command-line tool that allows you to create and deploy blueprints/gadgets on the Tangle network. It provides a simple and efficient way to manage your blueprints and gadgets, making it easy to get started with Tangle Blueprints.

Installation

To install the Tangle CLI, run the following command:

Supported on Linux, MacOS, and Windows (WSL2)

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/webb-tools/gadget/releases/download/cargo-tangle/v0.1.1-beta.7/cargo-tangle-installer.sh | sh

Or, if you prefer to install the CLI from source:

cargo install cargo-tangle --git https://github.com/webb-tools/gadget --force

Creating a New Blueprint/Gadget

To create a new blueprint/gadget using the Tangle CLI, use the following command:

cargo tangle gadget create --name <blueprint_name>

Replace <blueprint_name> with the desired name for your blueprint.

Example

cargo tangle gadget create --name my_blueprint

Build The Blueprint and the Gadget

To build the blueprint and the gadget, you can simply use cargo as you would with any rust project:

cargo build

Unit Testing

To run the unit tests, use the following command:

cargo test

Deploying the Blueprint to a Local Tangle Node

To deploy the blueprint to a local Tangle node, use the following command:

export SIGNER="//Alice" # Substrate Signer account
export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" # EVM signer account
cargo tangle gadget deploy --rpc-url <rpc_url> --package <package_name>

Replace <rpc_url> with the RPC URL of your local Tangle node and <package_name> with the name of the package to deploy.

Example

cargo tangle gadget deploy --rpc-url ws://localhost:9944 --package my_blueprint

Expected output:

Blueprint #0 created successfully by 5F3sa2TJAWMqDhXG6jhV4N8ko9rUjC2q7z6z5V5s5V5s5V5s with extrinsic hash: 0x1234567890abcdef

Required Environment Variables for Deployment

The following environment variables are required for deploying the blueprint:

  • SIGNER: The SURI of the signer account.
  • EVM_SIGNER: The SURI of the EVM signer account.

Example of ENV Variables

export SIGNER="//Alice" # Substrate Signer account
export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" # EVM signer account

Dependencies

~125–165MB
~3M SLoC