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

cargo-risczero new: add --guest-name option #1032

Merged
merged 5 commits into from
Oct 25, 2023
Merged

Conversation

SchmErik
Copy link
Contributor

@SchmErik SchmErik commented Oct 24, 2023

The guest name parameter is used as the name of the guest package
as well as method ID and ELF constants in the guest code. Therefore, this
parameter is required to be a valid rust identifier. If this is not set, the
cargo risczero new command will prompt the user to enter a guest name.
If no value is supplied by the command line parameter or the prompt, the
default value for this parameter will be "method".

closes: https://github.com/risc0/scratch/issues/102
closes: #470

If this is not set, `cargo risczero new` command will prompt the user to enter
a guest name. The guest name parameter is used as the name of the guest package
as well as method ID and ELF constants in the guest code. Therefore, this
parameter is required to be a valid rust identifier. If no value is supplied by
the command line parameter or the prompt, the default value for this parameter
will be "method".
@vercel
Copy link

vercel bot commented Oct 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 4:09pm

@SchmErik SchmErik self-assigned this Oct 24, 2023
@it09
Copy link
Contributor

it09 commented Oct 25, 2023

Do users need to rename name = methods to name = project-name-methods in the methods/Cargo.toml and in host/Cargo.toml, rename methods = { path = "../methods" } to project-name-methods = { path = "../methods" }

@it09
Copy link
Contributor

it09 commented Oct 25, 2023

Do we need to add serde::{from_slice, to_vec} into host/scr/main.rs?

@SchmErik
Copy link
Contributor Author

Do users need to rename name = methods to name = project-name-methods in the methods/Cargo.toml and in host/Cargo.toml, rename methods = { path = "../methods" } to project-name-methods = { path = "../methods" }

So there's a guest crate within the methods crate and this renames the guest so there's no need to change the methods

@SchmErik
Copy link
Contributor Author

Do we need to add serde::{from_slice, to_vec} into host/scr/main.rs?

no, the ExecutorEnvBuilder::write()calls to_vec so that should be taken care of... I think we need from_slice but the example doesn't use it at this time.. we expect the user to add code like this to deserialize the journal

@SchmErik SchmErik merged commit 46f0d27 into main Oct 25, 2023
22 checks passed
@SchmErik SchmErik deleted the erik/template-method-name branch October 25, 2023 17:33
@flaub
Copy link
Member

flaub commented Oct 25, 2023

I'm working on a PR to remove the need for from_slice.

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.

Make METHOD_NAME parameter of rust-starter template configurable
3 participants