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: generate deployment artifacts with forc-deploy #4913

Merged
merged 13 commits into from
Aug 16, 2023
Merged

Conversation

kayagokalp
Copy link
Member

@kayagokalp kayagokalp commented Aug 4, 2023

Description

closes #4744.

This PR adds deployment artifact serialization to forc-deploy. Basically each deployment info is saved as a json file in the out folder. So that users wont lose precious deployment information after closing their terminal.

An example deployment artifact can be seen below:

{
  "transaction_id": "0xec27bb7a4c8a3b8af98070666cf4e6ea22ca4b9950a0862334a1830520012f5d",
  "salt": "0x9e35d1d5ef5724f29e649a3465033f5397d3ebb973c40a1d76bb35c253f0dec7",
  "network_endpoint": "http://127.0.0.1:4000",
  "chain_id": 0,
  "contract_id": "0x767eeaa7af2621e637f9785552620e175d4422b17d4cf0d76335c38808608a7b",
  "deployment_size": 68,
  "deployed_block_id": "0x915c6f372252be6bc54bd70df6362dae9bf750ba652bf5582d9b31c7023ca6cf"
}                                                                                                                                                                                                                     

Since serde serialization for ContarctId and other deployment related client/vm primitives do not emit 0x at the beginning i had to convert them to Strings 0x prefixed. I feel like we can change human readable serialization to include 0x to all hex fields.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@kayagokalp kayagokalp added enhancement New feature or request forc forc-client Everything related to the `forc-client` crate. forc-deploy Everything to do with forc-deploy labels Aug 4, 2023
@kayagokalp kayagokalp self-assigned this Aug 4, 2023
@kayagokalp
Copy link
Member Author

After merging this and #4771, we will be closing #4723 and #4745

@kayagokalp kayagokalp marked this pull request as ready for review August 5, 2023 13:06
@kayagokalp kayagokalp requested a review from a team August 5, 2023 13:06
@JoshuaBatty JoshuaBatty requested a review from a team August 6, 2023 23:35
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
@kayagokalp kayagokalp requested a review from JoshuaBatty August 7, 2023 10:19
@kayagokalp kayagokalp enabled auto-merge (squash) August 7, 2023 21:00
sdankel
sdankel previously approved these changes Aug 8, 2023
@kayagokalp kayagokalp requested a review from a team August 9, 2023 10:04
@JoshuaBatty
Copy link
Member

Nice work, this will be super handy for users. The code looks good. Would you mind also adding this to the docs, maybe showing the example of an generated artifacts and some information about where the json is saved etc..?

@kayagokalp
Copy link
Member Author

Added docs with example artifact, should be good to go!

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
@kayagokalp kayagokalp requested a review from JoshuaBatty August 16, 2023 09:41
Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

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

:shipit:

@JoshuaBatty JoshuaBatty requested a review from a team August 16, 2023 12:11
Copy link
Contributor

@eureka-cpu eureka-cpu left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc forc-client Everything related to the `forc-client` crate. forc-deploy Everything to do with forc-deploy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forc-deploy should generate deployment artifacts
4 participants