-
Notifications
You must be signed in to change notification settings - Fork 10
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: ✨ Add CLI commands to create registry/world #79
feat: ✨ Add CLI commands to create registry/world #79
Conversation
Hi @crypto-vincent, for fn create_world_template_simple(name: &str, program_path: &Path) -> Files {
vec![(
program_path.join("src").join("lib.rs"),
format!(
r#"use anchor_lang::prelude::*;
declare_id!("{}");
#[program]
pub mod {} {{
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {{
Ok(())
}}
}}
#[derive(Accounts)]
pub struct Initialize {{}}
"#,
get_or_create_program_id(name),
name.to_snake_case(),
),
)]
} |
f2ff9ed
to
dde4639
Compare
dde4639
to
21c09e2
Compare
Hi @GabrielePicco, this PR is sitting here from very long time, if you can have look and see what is the actual expectations and add some suggestions. That will be very helpful for me to proceed further. |
Hey @iamnamananand996, the commands to create registry/world don't create a new component/system or template, but rather they should execute transction. Namely it would be the equivalent of running |
Hi @GabrielePicco, thank you for your valuable suggestion, and guided to correct path, will update the PR with correct changes |
Thanks @iamnamananand996 . authorize is an example of a command that runs a transaction |
5dd52b6
to
c113fa8
Compare
Hi @GabrielePicco, this comment had really helped. Now the changes has been updated with the requested solution. Please have a look, and let me know if you think it will require any further change. Happy to contribute more |
Hey @iamnamananand996, |
Hi @GabrielePicco, thanks for asking, I had an assumption that, from If I have understood the flow wrong, please help me to understand the correct flow, I will make the changes accordingly. |
Thanks for clarifying, @iamnamananand996. The idea is that there is currently a single registry (and I would keep it that way) so that everyone can discover all the existing world instances. Infinite world instances can already be created, so I don't think we need an extra registry in either of the two cases. |
Hi @GabrielePicco, thanks for answering and make me understand the flow, I will make the changes accordingly. |
c537893
to
a1474f0
Compare
Hi @GabrielePicco, I have update the PR with the flow required and updated the example command. Examples using the Bolt CLICreate registry on current cluster
Create world on current cluster
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @iamnamananand996, LGTM!
Problem
See #64 for a full description
Solution
Examples using the Bolt CLI
Create registry on current cluster
Create world on current cluster
Closes #64