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

Switch Substrate module with Polkadot SDK repository #241

Closed
Kirqkas opened this issue Oct 13, 2023 · 1 comment · Fixed by #313
Closed

Switch Substrate module with Polkadot SDK repository #241

Kirqkas opened this issue Oct 13, 2023 · 1 comment · Fixed by #313
Assignees

Comments

@Kirqkas
Copy link
Collaborator

Kirqkas commented Oct 13, 2023

No description provided.

@Kirqkas Kirqkas moved this from 🆕 New to 📋 Backlog in Gosemble - Polkadot Runtimes Oct 27, 2023
@radkomih radkomih self-assigned this Nov 8, 2023
@radkomih radkomih moved this from 📋 Backlog to 🏗 In progress in Gosemble - Polkadot Runtimes Nov 8, 2023
@radkomih
Copy link
Collaborator

radkomih commented Nov 9, 2023

With the latest updates to the polkadot-sdk, running a Gosemble-based runtime with a substrate-based host now requires the runtime to implement two additional exported functions:

  • GenesisBuilder_create_default_config
  • GenesisBuilder_build_config
/// API to interact with GenesisConfig for the runtime
	pub trait GenesisBuilder {
		/// Creates the default `GenesisConfig` and returns it as a JSON blob.
		///
		/// This function instantiates the default `GenesisConfig` struct for the runtime and serializes it into a JSON
		/// blob. It returns a `Vec<u8>` containing the JSON representation of the default `GenesisConfig`.
		fn create_default_config() -> sp_std::vec::Vec<u8>;

		/// Build `GenesisConfig` from a JSON blob not using any defaults and store it in the storage.
		///
		/// This function deserializes the full `GenesisConfig` from the given JSON blob and puts it into the storage.
		/// If the provided JSON blob is incorrect or incomplete or the deserialization fails, an error is returned.
		/// It is recommended to log any errors encountered during the process.
		///
		/// Please note that provided json blob must contain all `GenesisConfig` fields, no defaults will be used.
		fn build_config(json: sp_std::vec::Vec<u8>) -> Result;
	}

These are invoked in the polkadot-sdk/substrate/client/client-spec/src/genesis_config_builder.rs file

More info:
paritytech/polkadot-sdk#1256
paritytech/polkadot-sdk#1492

@radkomih radkomih assigned tgntr and unassigned radkomih Nov 10, 2023
@radkomih radkomih moved this from 🏗 In progress to 📋 Backlog in Gosemble - Polkadot Runtimes Nov 10, 2023
@tgntr tgntr moved this from 📋 Backlog to 🏗 In progress in Gosemble - Polkadot Runtimes Nov 21, 2023
@failfmi failfmi moved this from 🏗 In progress to 👀 In review in Gosemble - Polkadot Runtimes Dec 13, 2023
@tgntr tgntr moved this from 👀 In review to ✅ Done in Gosemble - Polkadot Runtimes Dec 22, 2023
@failfmi failfmi closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants