Skip to content

Conversation

@AlexD10S
Copy link
Collaborator

@AlexD10S AlexD10S commented Jun 24, 2024

If the user specifies the parachain_id when building the parachain, the process will include the generation of a chain spec file (Closes #28). Additionally, export the WebAssembly runtime for the parachain, and generate a parachain genesis state (Closes #29).

pop build parachain -p ../my-parachain --para_id 2000

The process for generating the files follows the steps described in the Substrate Tutorial. More explanation in the referenced issues above.

The functions to generate the files are independent of the building process in the pop_parachain crate, making it easy to create a separate command for file generation if desired, as discussed in #28.

This PR also addresses #188 by displaying the location and name of the built binary.

@codecov
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 77.61194% with 90 lines in your changes missing coverage. Please review.

Project coverage is 70.81%. Comparing base (5c5527a) to head (1307dd5).

@@            Coverage Diff             @@
##             main     #219      +/-   ##
==========================================
+ Coverage   70.40%   70.81%   +0.41%     
==========================================
  Files          46       47       +1     
  Lines        7045     7436     +391     
  Branches     7045     7436     +391     
==========================================
+ Hits         4960     5266     +306     
- Misses       1258     1283      +25     
- Partials      827      887      +60     
Files Coverage Δ
crates/pop-common/src/build.rs 100.00% <100.00%> (ø)
crates/pop-common/src/errors.rs 0.00% <ø> (ø)
crates/pop-common/src/helpers.rs 72.00% <ø> (ø)
crates/pop-common/src/manifest.rs 72.00% <ø> (+2.76%) ⬆️
crates/pop-contracts/src/errors.rs 0.00% <ø> (ø)
crates/pop-parachains/src/errors.rs 0.00% <ø> (ø)
crates/pop-cli/src/commands/build/mod.rs 50.70% <50.00%> (-0.03%) ⬇️
crates/pop-cli/src/commands/build/parachain.rs 55.45% <41.93%> (-15.70%) ⬇️
crates/pop-parachains/src/build.rs 82.63% <83.59%> (+7.63%) ⬆️

... and 2 files with indirect coverage changes

@AlexD10S AlexD10S marked this pull request as ready for review June 26, 2024 08:06
@evilrobot-01
Copy link
Contributor

Copy link
Contributor

@evilrobot-01 evilrobot-01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some improvements suggested. I think the use of paths needs special attention,

Copy link
Contributor

@evilrobot-01 evilrobot-01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner!

I think the only thing to address to conclude this is to remove the need for the toml_edit dependency in common, as the common::manifest module provides a much cleaner way of achieving the same result: resolving the package name. You can probably eliminate the function entirely using the Manifest type which is exported from common.

Also think the build profile should be moved to common.

@AlexD10S AlexD10S requested a review from evilrobot-01 July 5, 2024 11:58
Copy link
Contributor

@evilrobot-01 evilrobot-01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a few issues sadly. Should be the last one.

@AlexD10S AlexD10S requested a review from evilrobot-01 July 5, 2024 12:42
Copy link
Contributor

@evilrobot-01 evilrobot-01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for yout patience and persistence in getting this completed. 💪

@AlexD10S AlexD10S merged commit 5664f6d into main Jul 5, 2024
@AlexD10S AlexD10S deleted the alex/build-generate-files branch July 5, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pop build parachain: Export WASM and Genesis files pop build parachain: Generate a chain specification file

4 participants