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

[docs] user book: writing program #1039

Merged
merged 10 commits into from
Dec 15, 2024
Merged

[docs] user book: writing program #1039

merged 10 commits into from
Dec 15, 2024

Conversation

luffykai
Copy link
Contributor

@luffykai luffykai commented Dec 13, 2024

partially towards INT-2881

fix: INT-2873 INT-2874

Copy link

linear bot commented Dec 13, 2024

INT-2874 Testing flow

Testing with host target

Testing with guest target

INT-2873 How to write basic guest program

"quick start"

  • explain no_std
  • also can use std

@luffykai luffykai marked this pull request as ready for review December 14, 2024 22:44
@luffykai luffykai changed the title [docs] quickstart for user book WIP [docs] quickstart for user book Dec 14, 2024
@luffykai luffykai changed the title [docs] quickstart for user book [docs] user book: writing program Dec 15, 2024
Copy link

linear bot commented Dec 15, 2024

INT-2881 Install and quickstart

can mostly copy https://docs.succinct.xyz/docs/getting-started/install

but ours is simpler right now:

Install cargo openvm from source:

  1. either clone the repo and cargo install --force --path . from crates/cli or
  2. cargo install --git (I've never tried this and it might only work with public repo)

We don't need to install any special toolchains, just nightly-2024-10-30

For quickstart, add example of writing fibonacci program, starting from cargo init , add openvm = { …, features = ["std"] } and include the guest program code. We don't need the no_main, no_std stuff for quickstart since std works. Copy the rest of fibonacci from the benchmark, in particular use read.

Give the commands on how to run it using cargo openvm run or cargo openvm bench (hopefully that works).

  • we have --input here, will need to figure out how to use it

}
```

## Running on host
Copy link
Contributor

Choose a reason for hiding this comment

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

let's not talk about running on host in quickstart since it'll be confusing. We just want quickstart to get to proving the program as quickly as possible

Copy link
Contributor

Choose a reason for hiding this comment

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

using either cargo openvm bench probably.
also mention setting AXIOM_FAST_TEST=1 for dev.

cc @HrikB for context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I will delete this for now and Hrik can take over


Although it's ususally ok to use std (like in quickstart), not all std functionalities are supported (e.g., randomness). There might be unexpected runtime errors if one uses std, so it is recommended you develop no_std libraries if possible to reduce surprises.

### reading input
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

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

Approving to merge this first

@luffykai
Copy link
Contributor Author

merge this to unblock Hrik, still working on the running section (and IO

@luffykai luffykai merged commit 705abe7 into main Dec 15, 2024
2 checks passed
@luffykai luffykai deleted the lunkai/book1 branch December 15, 2024 08:38
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.

2 participants