-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add docs for the CLI #81
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.mdx) | ||
|
||
## 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.mdx#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,80 @@ | ||
--- | ||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this not be added yet?