Skip to content

Document Clarinet mainnet execution simulation #985

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

Open
hugocaillard opened this issue Apr 18, 2025 · 0 comments
Open

Document Clarinet mainnet execution simulation #985

hugocaillard opened this issue Apr 18, 2025 · 0 comments

Comments

@hugocaillard
Copy link
Collaborator

hugocaillard commented Apr 18, 2025

I would like to request some help from the documentation team to document the new MXS feature in clarinet.
The output would be a guide in the Clarinet SDK Guides sections, similar to the "Unit testing" one.

Here are some of the keys points to highlight (not necessarily in this order, I let the assignee define the exact structure of this doc)

  • What is Mainnet execution simulation and why it's useful:
    • test smart contracts with real world data
    • (re)simulate any transaction to see its output or evualute its costs
  • How to use it in unit tests (main use case)
    • enable it up in the Clarinet.toml
    • explain that the initial_height is optional (defaults to latest stacks block height if omitted) but is recommended to get consistent results
    • this project can be showned as an example https://github.com/hirosystems/clarinet-pyth-example

If you think it's relevant, we cna also specify that it is available in the playground to be quickly tested. Go to https://play.hiro.so/?remote_data=true and in the command input, call a mainnet contract, such as pox-4 (contract-call? 'SP000000000000000000002Q6VF78.pox-4 get-total-ustx-stacked u117)

At the end, specificy that there are some limitations. Currently, the following features are not implemented in MXS:

(get-burn-block-info? pox-addrs <burn-block-height>)

(get-tenure-info? block-reward <stacks-block-height>)
(get-tenure-info? miner-spend-total <stacks-block-height>)
(get-tenure-info? miner-spend-winner <stacks-block-height>

In the future, we'll likely add a section on how to use it programmatically using the js sdk directly (not in the context of unit tests) - but the exact api will soon change, so no need to cover this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant