MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / setup

Method setup

fendermint/testing/materializer/src/testnet.rs:98–120  ·  view source on GitHub ↗

Set up a testnet from scratch. To validate a manifest, we can first create a testnet with a [Materializer] that only creates symbolic resources.

(m: &mut R, name: &TestnetName, manifest: &Manifest)

Source from the content-addressed store, hash-verified

96 /// To validate a manifest, we can first create a testnet with a [Materializer]
97 /// that only creates symbolic resources.
98 pub async fn setup(m: &mut R, name: &TestnetName, manifest: &Manifest) -> anyhow::Result<Self> {
99 let mut t = Self::new(m, name).await?;
100 let root_name = t.root();
101
102 // Create keys for accounts.
103 for account_id in manifest.accounts.keys() {
104 t.create_account(m, account_id)?;
105 }
106
107 // Create the rootnet.
108 t.create_and_start_rootnet(m, &root_name, &manifest.rootnet)
109 .await
110 .context("failed to create and start rootnet")?;
111
112 // Recursively create and start all subnet nodes.
113 for (subnet_id, subnet) in &manifest.subnets {
114 t.create_and_start_subnet(m, &root_name, subnet_id, subnet)
115 .await
116 .with_context(|| format!("failed to create and start subnet {subnet_id}"))?;
117 }
118
119 Ok(t)
120 }
121
122 /// Return a reference to the physical network.
123 fn network(&self) -> &M::Network {

Callers

nothing calls this directly

Calls 6

contextMethod · 0.80
with_contextMethod · 0.80
rootMethod · 0.45
create_accountMethod · 0.45

Tested by

no test coverage detected