r0gue-io / pop-cli

An all-in-one tool for Polkadot development.
GNU General Public License v3.0
57 stars 17 forks source link

feat(up parachain): faster binary sourcing #199

Closed evilrobot-01 closed 1 week ago

evilrobot-01 commented 3 weeks ago

Introduces the sourcing of prebuilt binaries for supported platforms (aarch64, x64, linux, macos) to avoid the need to compile locally, effectively improving the UX of pop up for launching a local network. Also makes use of downloading GitHub source code archives for building rather than cloning as we do not need commit history.

Polkadot binaries are provided at https://github.com/r0gue-io/polkadot/releases and are built via a workflow using the release tag used at https://github.com/paritytech/polkadot-sdk/releases.

Also adds Pop Network as a known chain, so users no longer need to specify the -p flag but just use pop-node within network config files, as with system parachains. This can be improved in the future to support other chains directly via the same approach as the Templates enum for pop new parachain, but retaining the -p option ensures flexibility.

Testing

Can be tested on a Apple silicon as follows:

All the above should also be tested with --verbose as well.

Remaining tasks:

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 81.05304% with 493 lines in your changes missing coverage. Please review.

Project coverage is 65.20%. Comparing base (130e1b2) to head (3fda663).

@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   57.25%   65.20%   +7.94%     
==========================================
  Files          34       37       +3     
  Lines        3701     5069    +1368     
  Branches     3701     5069    +1368     
==========================================
+ Hits         2119     3305    +1186     
- Misses       1243     1248       +5     
- Partials      339      516     +177     
Files Coverage Δ
crates/pop-parachains/src/errors.rs 0.00% <ø> (-100.00%) :arrow_down:
crates/pop-parachains/src/templates.rs 91.11% <ø> (ø)
crates/pop-cli/src/commands/install/mod.rs 0.00% <0.00%> (ø)
crates/pop-cli/src/commands/new/parachain.rs 46.10% <0.00%> (+0.70%) :arrow_up:
crates/pop-parachains/src/up/relay.rs 85.86% <85.86%> (ø)
crates/pop-parachains/src/utils/git.rs 67.70% <50.00%> (+5.51%) :arrow_up:
crates/pop-parachains/src/up/parachains.rs 85.49% <85.49%> (ø)
crates/pop-parachains/src/up/sourcing.rs 86.51% <86.51%> (ø)
crates/pop-cli/src/commands/up/parachain.rs 8.85% <0.00%> (-3.21%) :arrow_down:
crates/pop-parachains/src/up/mod.rs 87.19% <87.19%> (ø)
evilrobot-01 commented 1 week ago

Only a comment why are we keeping all the .toml files?

No real reason apart from manual testing and examples. I can remove if you want?

AlexD10S commented 1 week ago

Only a comment why are we keeping all the .toml files?

No real reason apart from manual testing and examples. I can remove if you want?

I like to have examples if can help users. My suggestion then will be to add a line in the README or in the docs explaining how to use the examples. Additionally, I recommend renaming all.toml to something more descriptive.

evilrobot-01 commented 1 week ago

I like to have examples if can help users. My suggestion then will be to add a line in the README or in the docs explaining how to use the examples. Additionally, I recommend renaming all.toml to something more descriptive.

Done in latest commit