diff --git a/ts/src/local/conductor.ts b/ts/src/local/conductor.ts index 1e3a11e5..4e7ab36b 100644 --- a/ts/src/local/conductor.ts +++ b/ts/src/local/conductor.ts @@ -64,6 +64,11 @@ export interface ConductorOptions { */ noDpki?: boolean; + /** + * Set the network seed for the DPKI network. + */ + dpkiNetworkSeed?: string; + /** * Timeout for requests to Admin and App API. */ @@ -77,7 +82,7 @@ export interface ConductorOptions { */ export type CreateConductorOptions = Pick< ConductorOptions, - "bootstrapServerUrl" | "networkType" | "noDpki" | "timeout" + "bootstrapServerUrl" | "networkType" | "noDpki" | "dpkiNetworkSeed" | "timeout" >; /** @@ -96,6 +101,7 @@ export const createConductor = async ( "bootstrapServerUrl", "networkType", "noDpki", + "dpkiNetworkSeed", "timeout", ]); const conductor = await Conductor.create( @@ -160,6 +166,9 @@ export class Conductor implements IConductor { if (options?.noDpki) { args.push("--no-dpki"); } + if (options?.dpkiNetworkSeed) { + args.push("--dpki-network-seed", options.dpkiNetworkSeed); + } args.push(networkType); if (networkType === NetworkType.WebRtc) { args.push(signalingServerUrl.href); @@ -383,19 +392,19 @@ export class Conductor implements IConductor { const installAppRequest: InstallAppRequest = "bundle" in appBundleSource ? { - bundle: appBundleSource.bundle, - agent_key, - membrane_proofs, - installed_app_id, - network_seed, - } + bundle: appBundleSource.bundle, + agent_key, + membrane_proofs, + installed_app_id, + network_seed, + } : { - path: appBundleSource.path, - agent_key, - membrane_proofs, - installed_app_id, - network_seed, - }; + path: appBundleSource.path, + agent_key, + membrane_proofs, + installed_app_id, + network_seed, + }; logger.debug( `installing app with id ${installed_app_id} for agent ${encodeHashToBase64( agent_key diff --git a/ts/src/trycp/conductor/conductor.ts b/ts/src/trycp/conductor/conductor.ts index 464d2e43..09163b40 100644 --- a/ts/src/trycp/conductor/conductor.ts +++ b/ts/src/trycp/conductor/conductor.ts @@ -138,6 +138,11 @@ export interface TryCpConductorOptions { */ noDpki?: boolean; + /** + * Set the network seed for the DPKI network (optional). + */ + dpkiNetworkSeed?: string; + /** * Start up conductor after creation. * @@ -1021,19 +1026,19 @@ export class TryCpConductor implements IConductor { const installAppRequest: InstallAppRequest = "bundle" in appBundleSource ? { - bundle: appBundleSource.bundle, - agent_key, - membrane_proofs, - installed_app_id, - network_seed, - } + bundle: appBundleSource.bundle, + agent_key, + membrane_proofs, + installed_app_id, + network_seed, + } : { - path: appBundleSource.path, - agent_key, - membrane_proofs, - installed_app_id, - network_seed, - }; + path: appBundleSource.path, + agent_key, + membrane_proofs, + installed_app_id, + network_seed, + }; return this.adminWs().installApp(installAppRequest); } @@ -1055,19 +1060,19 @@ export class TryCpConductor implements IConductor { const installAppRequest: InstallAppRequest = "bundle" in appForAgent.app ? { - bundle: appForAgent.app.bundle, - agent_key, - membrane_proofs, - installed_app_id, - network_seed, - } + bundle: appForAgent.app.bundle, + agent_key, + membrane_proofs, + installed_app_id, + network_seed, + } : { - path: appForAgent.app.path, - agent_key, - membrane_proofs, - installed_app_id, - network_seed, - }; + path: appForAgent.app.path, + agent_key, + membrane_proofs, + installed_app_id, + network_seed, + }; logger.debug( `installing app with id ${installed_app_id} for agent ${encodeHashToBase64(