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.

@radkomih radkomih self-assigned this 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

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