Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwht committed Dec 17, 2024
2 parents b2a6dcb + e1bfbc8 commit 8d14f8c
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 97 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ edition = "2021"
documentation = "https://learn.onpop.io/"
license = "GPL-3.0"
repository = "https://github.com/r0gue-io/pop-cli"
rust-version = "1.81.0"
version = "0.5.0"

[workspace.dependencies]
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="https://learn.onpop.io/~gitbook/image?url=https%3A%2F%2F574321477-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUqTUVzYjmRwzCWTsfd1O%252Fuploads%252FxALe5uzVAiXnQFZOjxmw%252Fplay-on-polkadot.png%3Falt%3Dmedia%26token%3Dd8ce69f9-39fc-4568-9404-381032d923d4&width=400&dpr=2&quality=100&sign=19e161&sv=1"></img>

<div align="center">

[![Twitter URL](https://img.shields.io/twitter/follow/Pop?style=social)](https://x.com/onpopio/)
[![Twitter URL](https://img.shields.io/twitter/follow/R0GUE?style=social)](https://twitter.com/gor0gue)
[![Telegram](https://img.shields.io/badge/Telegram-gray?logo=telegram)](https://t.me/onpopio)
Expand All @@ -14,9 +14,6 @@
</div>




## Installation

You can install Pop CLI from [crates.io](https://crates.io/crates/pop-cli):
Expand All @@ -25,6 +22,8 @@ You can install Pop CLI from [crates.io](https://crates.io/crates/pop-cli):
cargo install --force --locked pop-cli
```

> :information_source: Pop CLI requires Rust 1.81 or later.
You can also install Pop CLI using the [Pop CLI GitHub repo](https://github.com/r0gue-io/pop-cli):

```shell
Expand All @@ -44,6 +43,7 @@ our [telemetry](crates/pop-telemetry/README.md) documentation.
## Documentation

On the [Pop Docs website](https://learn.onpop.io) you will find:

* 👉 [Get Started with Pop CLI](https://learn.onpop.io/v/cli)

## Building Pop CLI locally
Expand Down
4 changes: 2 additions & 2 deletions crates/pop-cli/src/commands/build/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ pub struct BuildParachainCommand {
#[arg(long)]
pub(crate) path: Option<PathBuf>,
/// The package to be built.
#[arg(short = 'p', long)]
#[arg(short, long)]
pub(crate) package: Option<String>,
/// Build profile [default: debug].
#[clap(long, value_enum)]
pub(crate) profile: Option<Profile>,
/// Parachain ID to be used when generating the chain spec files.
#[arg(short = 'i', long = "id")]
#[arg(short, long)]
pub(crate) id: Option<u32>,
// Deprecation flag, used to specify whether the deprecation warning is shown.
#[clap(skip)]
Expand Down
18 changes: 9 additions & 9 deletions crates/pop-cli/src/commands/build/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,38 +136,38 @@ pub(crate) enum RelayChain {
pub struct BuildSpecCommand {
/// File name for the resulting spec. If a path is given,
/// the necessary directories will be created
#[arg(short = 'o', long = "output")]
#[arg(short, long = "output")]
pub(crate) output_file: Option<PathBuf>,
/// [DEPRECATED] and will be removed in v0.7.0, use `profile`.
#[arg(short = 'r', long, conflicts_with = "profile")]
#[arg(short = 'R', long, conflicts_with = "profile")]
pub(crate) release: bool,
/// Build profile for the binary to generate the chain specification.
#[arg(long, value_enum)]
pub(crate) profile: Option<Profile>,
/// Parachain ID to be used when generating the chain spec files.
#[arg(short = 'i', long)]
#[arg(short, long)]
pub(crate) id: Option<u32>,
/// Whether to keep localhost as a bootnode.
#[arg(long)]
#[arg(short = 'b', long)]
pub(crate) default_bootnode: bool,
/// Type of the chain.
#[arg(short = 't', long = "type", value_enum)]
pub(crate) chain_type: Option<ChainType>,
/// Provide the chain specification to use (e.g. dev, local, custom or a path to an existing
/// file).
#[arg(short = 'c', long = "chain")]
#[arg(short, long)]
pub(crate) chain: Option<String>,
/// Relay chain this parachain will connect to.
#[arg(long, value_enum)]
#[arg(short = 'r', long, value_enum)]
pub(crate) relay: Option<RelayChain>,
/// Protocol-id to use in the specification.
#[arg(long = "protocol-id")]
#[arg(short = 'P', long = "protocol-id")]
pub(crate) protocol_id: Option<String>,
/// Whether the genesis state file should be generated.
#[arg(long = "genesis-state")]
#[arg(short = 'S', long = "genesis-state")]
pub(crate) genesis_state: bool,
/// Whether the genesis code file should be generated.
#[arg(long = "genesis-code")]
#[arg(short = 'C', long = "genesis-code")]
pub(crate) genesis_code: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/pop-cli/src/commands/call/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct CallChainCommand {
#[arg(short = 'S', long)]
sudo: bool,
/// Automatically signs and submits the extrinsic without prompting for confirmation.
#[arg(short('y'), long)]
#[arg(short = 'y', long)]
skip_confirm: bool,
}

Expand Down
14 changes: 7 additions & 7 deletions crates/pop-cli/src/commands/call/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ pub struct CallContractCommand {
#[arg(short, long)]
path: Option<PathBuf>,
/// The address of the contract to call.
#[arg(name = "contract", short, long, env = "CONTRACT")]
#[arg(short, long, env = "CONTRACT")]
contract: Option<String>,
/// The name of the contract message to call.
#[arg(long, short)]
#[arg(short, long)]
message: Option<String>,
/// The message arguments, encoded as strings.
#[arg(short, long, num_args = 0..,)]
args: Vec<String>,
/// The value to be transferred as part of the call.
#[arg(name = "value", short, long, default_value = DEFAULT_PAYABLE_VALUE)]
#[arg(short, long, default_value = DEFAULT_PAYABLE_VALUE)]
value: String,
/// Maximum amount of gas to be used for this command.
/// If not specified it will perform a dry-run to estimate the gas consumed for the
Expand All @@ -50,27 +50,27 @@ pub struct CallContractCommand {
#[arg(short = 'P', long)]
proof_size: Option<u64>,
/// Websocket endpoint of a node.
#[arg(name = "url", short, long, value_parser, default_value = DEFAULT_URL)]
#[arg(short, long, value_parser, default_value = DEFAULT_URL)]
url: url::Url,
/// Secret key URI for the account calling the contract.
///
/// e.g.
/// - for a dev account "//Alice"
/// - with a password "//Alice///SECRET_PASSWORD"
#[arg(name = "suri", long, short, default_value = DEFAULT_URI)]
#[arg(short, long, default_value = DEFAULT_URI)]
suri: String,
/// Use a browser extension wallet to sign the extrinsic.
#[arg(name = "use-wallet", long, short('w'), default_value = "false", conflicts_with = "suri")]
use_wallet: bool,
/// Submit an extrinsic for on-chain execution.
#[arg(short('x'), long)]
#[arg(short = 'x', long)]
execute: bool,
/// Perform a dry-run via RPC to estimate the gas usage. This does not submit a transaction.
#[arg(short = 'D', long, conflicts_with = "execute")]
dry_run: bool,
/// Enables developer mode, bypassing certain user prompts for faster testing.
/// Recommended for testing and local development only.
#[arg(name = "dev", long, short, default_value = "false")]
#[arg(name = "dev", short, long, default_value = "false")]
dev_mode: bool,
}
impl CallContractCommand {
Expand Down
2 changes: 1 addition & 1 deletion crates/pop-cli/src/commands/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) enum Command {
#[derive(Args)]
pub struct CleanCommandArgs {
/// Pass flag to remove all artifacts
#[arg(short = 'a', long)]
#[arg(short, long)]
pub(crate) all: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/pop-cli/src/commands/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum Dependencies {
#[command(args_conflicts_with_subcommands = true)]
pub(crate) struct InstallArgs {
/// Automatically install all dependencies required without prompting for confirmation.
#[clap(short('y'), long)]
#[clap(short = 'y', long)]
skip_confirm: bool,
}

Expand Down
8 changes: 2 additions & 6 deletions crates/pop-cli/src/commands/new/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,13 @@ pub struct NewContractCommand {
/// The type of contract.
#[arg(
default_value = ContractType::Examples.as_ref(),
short = 'c',
short,
long,
value_parser = enum_variants!(ContractType)
)]
pub(crate) contract_type: Option<ContractType>,
/// The template to use.
#[arg(
short = 't',
long,
value_parser = enum_variants!(Contract)
)]
#[arg(short, long, value_parser = enum_variants!(Contract))]
pub(crate) template: Option<Contract>,
}

Expand Down
14 changes: 5 additions & 9 deletions crates/pop-cli/src/commands/test/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,18 @@ use {std::time::Duration, tokio::time::sleep};

#[derive(Args)]
pub(crate) struct TestContractCommand {
#[arg(short = 'p', long, help = "Path for the contract project [default: current directory]")]
#[arg(short, long, help = "Path for the contract project [default: current directory]")]
path: Option<PathBuf>,
/// [DEPRECATED] Run e2e tests
#[arg(short = 'f', long = "features", value_parser=["e2e-tests"])]
#[arg(short, long, value_parser=["e2e-tests"])]
features: Option<String>,
/// Run end-to-end tests
#[arg(short = 'e', long = "e2e")]
#[arg(short, long)]
e2e: bool,
#[arg(
short = 'n',
long = "node",
help = "Path to the contracts node to run e2e tests [default: none]"
)]
#[arg(short, long, help = "Path to the contracts node to run e2e tests [default: none]")]
node: Option<PathBuf>,
/// Automatically source the needed binary required without prompting for confirmation.
#[clap(short('y'), long)]
#[clap(short = 'y', long)]
skip_confirm: bool,
}

Expand Down
24 changes: 12 additions & 12 deletions crates/pop-cli/src/commands/up/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,39 @@ const FAILED: &str = "🚫 Deployment failed.";
#[derive(Args, Clone)]
pub struct UpContractCommand {
/// Path to the contract build directory.
#[arg(short = 'p', long)]
#[arg(short, long)]
path: Option<PathBuf>,
/// The name of the contract constructor to call.
#[clap(name = "constructor", long, default_value = "new")]
#[clap(short, long, default_value = "new")]
constructor: String,
/// The constructor arguments, encoded as strings.
#[clap(long, num_args = 0..,)]
#[clap(short, long, num_args = 0..,)]
args: Vec<String>,
/// Transfers an initial balance to the instantiated contract.
#[clap(name = "value", long, default_value = "0")]
#[clap(short, long, default_value = "0")]
value: String,
/// Maximum amount of gas to be used for this command.
/// If not specified it will perform a dry-run to estimate the gas consumed for the
/// instantiation.
#[clap(name = "gas", long)]
#[clap(name = "gas", short, long)]
gas_limit: Option<u64>,
/// Maximum proof size for the instantiation.
/// If not specified it will perform a dry-run to estimate the proof size required.
#[clap(long)]
#[clap(short = 'P', long)]
proof_size: Option<u64>,
/// A salt used in the address derivation of the new contract. Use to create multiple
/// instances of the same contract code from the same account.
#[clap(long, value_parser = parse_hex_bytes)]
#[clap(short = 'S', long, value_parser = parse_hex_bytes)]
salt: Option<Bytes>,
/// Websocket endpoint of a chain.
#[clap(name = "url", long, value_parser, default_value = DEFAULT_URL)]
#[clap(short, long, value_parser, default_value = DEFAULT_URL)]
url: Url,
/// Secret key URI for the account deploying the contract.
///
/// e.g.
/// - for a dev account "//Alice"
/// - with a password "//Alice///SECRET_PASSWORD"
#[clap(name = "suri", long, short, default_value = "//Alice")]
#[clap(short, long, default_value = "//Alice")]
suri: String,
/// Use your browser wallet to sign a transaction.
#[clap(
Expand All @@ -76,14 +76,14 @@ pub struct UpContractCommand {
)]
use_wallet: bool,
/// Perform a dry-run via RPC to estimate the gas usage. This does not submit a transaction.
#[clap(long)]
#[clap(short = 'D', long)]
dry_run: bool,
/// Uploads the contract only, without instantiation.
#[clap(short('u'), long)]
#[clap(short = 'U', long)]
upload_only: bool,
/// Automatically source or update the needed binary required without prompting for
/// confirmation.
#[clap(short('y'), long)]
#[clap(short = 'y', long)]
skip_confirm: bool,
}

Expand Down
4 changes: 2 additions & 2 deletions crates/pop-cli/src/commands/up/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ pub(crate) struct ZombienetCommand {
#[arg(short, long)]
parachain: Option<Vec<String>>,
/// The command to run after the network has been launched.
#[clap(name = "cmd", short = 'c', long)]
#[clap(name = "cmd", short, long)]
command: Option<String>,
/// Whether the output should be verbose.
#[arg(short, long, action)]
verbose: bool,
/// Automatically source all needed binaries required without prompting for confirmation.
#[clap(short('y'), long)]
#[clap(short = 'y', long)]
skip_confirm: bool,
}

Expand Down
Loading

0 comments on commit 8d14f8c

Please sign in to comment.