Open iamnamananand996 opened 1 month ago
Hi @crypto-vincent,
for World PDA
, I have just add the initialization
from program template
, do we need expand it more and make it workable or just boilerplate like this is enough.
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(),
),
)]
}
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 https://github.com/magicblock-labs/bolt/blob/main/tests/bolt.ts#L111
from Rust
Hi @GabrielePicco, thank you for your valuable suggestion, and guided to correct path, will update the PR with correct changes
Problem
So that the frontend/clients don't need to worry about a world/registry being created, we could have CLI that allows developer to pre-deploy a registry/world in its cluster of choice
Solution
bolt world "seed"
command could return an usable world PDA that is initialized on the current clustercc - @crypto-vincent