Manually insert the authority discovery key into the keystore

I did try pulling in `pallet-authority-discovery` for this, updating
`SessionKeys`, but that was insufficient for whatever reason.
This commit is contained in:
Luke Parker
2025-09-30 06:40:19 -04:00
parent 1d0a26e32e
commit 10ca5b9757
3 changed files with 5 additions and 2 deletions

View File

@@ -315,7 +315,7 @@ impl Serai {
&self,
network: NetworkId,
) -> Result<Vec<multiaddr::Multiaddr>, SeraiError> {
self.call("p2p_validators", network).await
self.call("p2p_validators", [network]).await
}
}

View File

@@ -59,7 +59,7 @@ where
authority_discovery_module.register_async_method(
"p2p_validators",
|params, context, _ext| async move {
let network: NetworkId = params.parse()?;
let [network]: [NetworkId; 1] = params.parse()?;
let (id, client, authority_discovery) = &*context;
let latest_block = client.info().best_hash;

View File

@@ -287,6 +287,9 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let role = config.role;
let keystore = keystore_container;
if let Some(seed) = config.dev_key_seed.as_ref() {
let _ = keystore.sr25519_generate_new(sp_core::crypto::key_types::AUTHORITY_DISCOVERY, Some(seed));
}
let prometheus_registry = config.prometheus_registry().cloned();
// TODO: Ensure we're considered as an authority is a validator of an external network