-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
dffecf0
commit 91176a1
Showing
6 changed files
with
170 additions
and
46 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"installation": "Installation", | ||
"quickstart": "Quickstart", | ||
"reference": "Reference" | ||
} |
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,33 @@ | ||
--- | ||
title: Installation | ||
--- | ||
|
||
# Tangle CLI Installation | ||
|
||
There are multiple sources to install the CLI from: | ||
|
||
1. Using the installation script (stable) | ||
|
||
> The script supports Linux, MacOS, and Windows (WSL2) | ||
```shell | ||
$ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/tangle-network/gadget/releases/download/cargo-tangle/v0.1.1-beta.7/cargo-tangle-installer.sh | sh | ||
``` | ||
|
||
2. From [crates.io](https://crates.io) (stable) | ||
|
||
```shell | ||
$ cargo install cargo-tangle --force | ||
``` | ||
|
||
3. From source (nightly) | ||
|
||
```shell | ||
$ cargo install cargo-tangle --git https://github.com/tangle-network/gadget --force | ||
``` | ||
|
||
You can verify your installation with: | ||
|
||
```shell | ||
$ cargo tangle --version | ||
``` |
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,48 @@ | ||
--- | ||
title: Quickstart | ||
--- | ||
|
||
# Tangle CLI Quickstart | ||
|
||
## Pre-requisites | ||
|
||
* [git](https://git-scm.org) | ||
* Tangle CLI, see [installation](./installation) | ||
|
||
## Creating a New Project | ||
|
||
1. Open your terminal and run: | ||
|
||
```shell | ||
$ cargo tangle blueprint create --name <blueprint-name> | ||
``` | ||
|
||
2. Follow the prompts to set up your project. | ||
|
||
{/* TODO: Add a GIF */} | ||
|
||
### Project Structure | ||
|
||
After creation, your project will have the following structure: | ||
|
||
``` | ||
<blueprint-name>/ | ||
├── src/ | ||
│ ├── lib.rs | ||
│ └── main.rs | ||
├── Cargo.toml | ||
├── README.md | ||
└── ... | ||
``` | ||
|
||
## Deploying your Blueprint | ||
|
||
Once you're ready to deploy your blueprint, simply: | ||
|
||
```shell | ||
export SIGNER="//Alice" | ||
export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" | ||
cargo tangle blueprint deploy | ||
``` | ||
|
||
See [deploy command reference](./reference#deploy) for all options. |
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,75 @@ | ||
--- | ||
title: Reference | ||
--- | ||
|
||
# Tangle CLI Reference | ||
|
||
## Blueprint | ||
|
||
The primary subcommand, used for building, testing, and deploying blueprints. | ||
|
||
- Aliases: `bp` | ||
|
||
Usage: | ||
```shell | ||
$ cargo tangle blueprint <subcommand> | ||
``` | ||
|
||
### Subcommands | ||
|
||
Note that unless specified, all arguments are optional. | ||
|
||
#### Create | ||
|
||
Creates a new blueprint | ||
|
||
- Name: `create` | ||
- Aliases: `c` | ||
- Options: | ||
- `--name` (**required**): The name of the blueprint | ||
- `--repo`: The repo to pull the template from, by default this uses the hello world [blueprint template](https://github.com/tangle-network/blueprint-template) | ||
- `--path`: The path to copy a template from, no default value | ||
|
||
Usage: | ||
|
||
Create a blueprint using the default template | ||
```shell | ||
$ cargo tangle blueprint create --name <name> | ||
``` | ||
|
||
Create a blueprint using another template from git | ||
```shell | ||
$ cargo tangle blueprint create --name <name> --repo <git-repo-url> | ||
``` | ||
|
||
#### Deploy | ||
|
||
Deploy a blueprint to Tangle | ||
|
||
- Name: `deploy` | ||
- Aliases: `d` | ||
- Options: | ||
- `rpc-url`: The tangle RPC URL to use (default: `wss://rpc.tangle.tools`) | ||
- `package`: The package to deploy, useful when using workspaces | ||
- Environment Variables: | ||
- `SIGNER` (**required**): The SURI of the Subtrate signer account | ||
- `EVM_SIGNER` (**required**): The SURI of the EVM signer account | ||
|
||
Usage: | ||
|
||
Deploy a blueprint to a local Tangle node: | ||
```bash | ||
export SIGNER="//Alice" | ||
export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" | ||
cargo tangle blueprint deploy --rpc-url <rpc-url> | ||
``` | ||
Where `<rpc-url>` will likely be `ws://localhost:9944`. | ||
|
||
#### Generate Keys | ||
|
||
- Name: `generate-keys` | ||
- Options: | ||
- `key-type` (alias: `k`) (**required**): The key type to generate (sr25519, ecdsa, bls_bn254, ed25519, bls381) | ||
- `path` (alias: `p`): The path to write the generated keypair to. If not provided, the keypair will be written solely to stdout | ||
- `seed` (alias: `s`): 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 |
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