Skip to content
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(up parachain): faster binary sourcing #199

Merged
merged 20 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ repository = "https://github.com/r0gue-io/pop-cli"
[workspace.dependencies]
anyhow = "1.0"
assert_cmd = "2.0.14"
predicates = "3.1.0"
dirs = "5.0"
duct = "0.13"
env_logger = "0.11.1"
flate2 = "1.0.30"
duct = "0.13"
git2 = { version = "0.18", features = ["vendored-openssl"] }
glob = "0.3.1"
log = "0.4.20"
mockito = "1.4.0"
predicates = "3.1.0"
tar = "0.4.40"
tempfile = "3.10"
thiserror = "1.0.58"
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,20 @@ pop build parachain --release
You can spawn a local network using [zombienet](https://github.com/paritytech/zombienet-sdk) as follows:

```shell
pop up parachain -f ./tests/zombienet.toml -p https://github.com/r0gue-io/pop-node
evilrobot-01 marked this conversation as resolved.
Show resolved Hide resolved
pop up parachain -f ./tests/networks/pop.toml -p https://github.com/r0gue-io/pop-node
```

> :information_source: Pop CLI will automatically source the necessary polkadot binaries. Currently, these will be built
> if on a non-linux system.
> :information_source: Pop CLI will automatically source the necessary `polkadot` binaries.

Various examples of network configuration files are available [here](./tests/networks).

### Run a command after the network has been spun up

The following will spin up the network locally according the the zombienet file and once the network is up, it will run the command specified in `--cmd`:
The following will spin up the network locally according the the zombienet file and once the network is up, it will run
the command specified in `--cmd`:

```shell
pop up parachain -f ./tests/zombienet.toml -p https://github.com/r0gue-io/pop-node --cmd ./path/to/my/script
pop up parachain -f ./tests/networks/pop.toml --cmd ./path/to/my/script
```

### Contracts
Expand All @@ -144,11 +146,13 @@ Build the Smart Contract:
# Build an existing Smart Contract
pop build contract -p ./my_contract
```
By default the contract is compiled with `debug` functionality included.

By default the contract is compiled with `debug` functionality included.

This enables the contract to output debug messages, but increases the contract size and the amount of gas used.

For production builds, use the --release flag: `--release`:

```sh
pop build contract -p ./my_contract --release
```
Expand All @@ -159,7 +163,8 @@ Deploy and instantiate the Smart Contract:
pop up contract -p ./my_contract --constructor new --args "false" --suri //Alice
```

> :information_source: If you don't specify a live chain, `pop` will automatically spawn a local node for testing purposes.
> :information_source: If you don't specify a live chain, `pop` will automatically spawn a local node for testing
> purposes.

Some of the options available are:

Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ async fn run_external_script(script_url: &str) -> anyhow::Result<()> {
.send()
.await
.context("Network Error: Failed to fetch script from Github")?
.error_for_status()?
.text()
.await?;
fs::write(scripts_path.as_path(), script).await?;
Expand Down
9 changes: 2 additions & 7 deletions crates/pop-cli/src/commands/new/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,8 @@ async fn choose_release(template: &Template) -> Result<Option<String>> {
}

async fn get_latest_3_releases(repo: &GitHub) -> Result<Vec<Release>> {
let mut latest_3_releases: Vec<Release> = repo
.get_latest_releases()
.await?
.into_iter()
.filter(|r| !r.prerelease)
.take(3)
.collect();
let mut latest_3_releases: Vec<Release> =
repo.releases().await?.into_iter().filter(|r| !r.prerelease).take(3).collect();
repo.get_repo_license().await?;
// Get the commit sha for the releases
for release in latest_3_releases.iter_mut() {
Expand Down
Loading
Loading