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

[x/programs] Add VM simulator #537

Merged
merged 33 commits into from
Oct 24, 2023
Merged

[x/programs] Add VM simulator #537

merged 33 commits into from
Oct 24, 2023

Conversation

hexfusion
Copy link
Contributor

@hexfusion hexfusion commented Oct 11, 2023

This PR adds a VM simulator for testing and interacting with HyperSDK Wasm programs. It currently has support for testing using Plan files or directly via Rust using the Rusk SDK simulator feature. Under the hook the simulator interacts with a real HyperSDK VM! Lots more coming in the next weeks checkout the README and give it try!

example usage.

$ ./simulator run ./cmd/testdata/basic_token.yaml 

{"id":0,"result":{"msg":"created key bob_key","timestamp":1697829978}}
{"id":1,"result":{"msg":"created key alice_key","timestamp":1697829978}}
{"id":2,"result":{"id":"noJT1njKtp6nhJEgzVPpD84j3kJZeBwiowPHpCALUzfFXfUn4","timestamp":1697829978}}
{"id":3,"result":{"id":"PTVjxNp8XwRknTZr7cbkgck49x1adqUHZGE8grZJRk2NPDXy7","timestamp":1697829978}}
{"id":4,"result":{"id":"2WGgdkj6Hkxvt9MnHhxrrUFPryd52ATxWGsVX5cKtzTANbA25p","timestamp":1697829978}}
{"id":5,"result":{"response":[10000],"timestamp":1697829978}}

TODO

  • Rust example

Closes #535, #462

@hexfusion hexfusion self-assigned this Oct 12, 2023
@hexfusion hexfusion added the enhancement New feature or request label Oct 12, 2023
@hexfusion hexfusion marked this pull request as ready for review October 12, 2023 21:16
@hexfusion hexfusion requested a review from samliok as a code owner October 12, 2023 21:16
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
Signed-off-by: Sam Batschelet <[email protected]>
@patrick-ogrady patrick-ogrady merged commit f6588c5 into main Oct 24, 2023
21 of 22 checks passed
@patrick-ogrady patrick-ogrady deleted the simulator branch October 24, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Questions] How do one run the rust program example ?
4 participants