From 0fcc0a7e6dae9e82007bc11952a2eaa97681b7e2 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 11 Nov 2024 11:55:54 +0700 Subject: [PATCH] feat: update templates --- src/config.rs | 14 +++++++------- src/deployments.rs | 14 +++++++------- src/templates/node_config.json.template | 2 +- src/templates/orbit_setup_config.json.template | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/config.rs b/src/config.rs index d1f035e..af42084 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; pub struct OrbitConfig { pub chain_id: u64, pub chain_name: String, - pub creator_address: Address, + pub staker_address: Address, pub private_key: String, pub rollup_config: RollupConfig, pub node_config: NodeConfig, @@ -20,7 +20,7 @@ impl Default for OrbitConfig { Self { chain_id: 20121999, chain_name: "Avail-Orbit-Testnet".to_string(), - creator_address: Address::default(), + staker_address: Address::default(), private_key: "".to_string(), // Must be provided by user rollup_config: RollupConfig { confirm_period_blocks: 150, @@ -161,7 +161,7 @@ impl Default for OrbitConfig { bridge: None, upgrade_executor: None, validator_utils: None, - validator_wallet_creator: None, + validator_wallet_staker: None, deployed_at_block_number: None, }, avail_config: AvailConfig { @@ -341,7 +341,7 @@ pub struct OrbitSetupConfig { pub bridge: Option, pub upgrade_executor: Option, pub validator_utils: Option, - pub validator_wallet_creator: Option, + pub validator_wallet_staker: Option, pub deployed_at_block_number: Option, } @@ -359,7 +359,7 @@ impl OrbitConfig { pub fn new( chain_id: u64, chain_name: impl Into, - creator_address: Address, + staker_address: Address, private_key: impl Into, avail_config: AvailConfig, working_dir: impl Into, @@ -372,7 +372,7 @@ impl OrbitConfig { rollup_config: RollupConfig::default(chain_id), node_config: NodeConfig::default(), orbit_setup_config: OrbitSetupConfig::default(chain_id, &chain_name), - creator_address, + staker_address, avail_config, working_dir: working_dir.into(), } @@ -502,7 +502,7 @@ impl OrbitSetupConfig { bridge: Some("0xC83ee8e28B7b258f41aF8ef4279c02f901288029".to_string()), upgrade_executor: Some("0x805bB07B88dDA56030eC48644E0C276e2e5E3949".to_string()), validator_utils: Some("0xB11EB62DD2B352886A4530A9106fE427844D515f".to_string()), - validator_wallet_creator: Some( + validator_wallet_staker: Some( "0xEb9885B6c0e117D339F47585cC06a2765AaE2E0b".to_string(), ), deployed_at_block_number: Some(11274529), diff --git a/src/deployments.rs b/src/deployments.rs index 325bfb6..d3d060d 100644 --- a/src/deployments.rs +++ b/src/deployments.rs @@ -77,7 +77,7 @@ impl OrbitDeployment { // Create .env file and set the Rollup Creator Address let env_content = format!( "ROLLUP_CREATOR_ADDRESS=\"{}\"\nDEVNET_PRIVKEY=\"{}\"", - self.config.creator_address, self.config.private_key + self.config.staker_address, self.config.private_key ); fs::write(nitro_contracts_dir.join(".env"), env_content).await?; @@ -126,7 +126,7 @@ impl OrbitDeployment { let sequencer_inbox = extract_address("SequencerInbox (proxy) created at address:"); let bridge = extract_address("Bridge (proxy) Contract created at address:"); let validator_utils = extract_address("ValidatorUtils Contract created at address:"); - let validator_wallet_creator = + let validator_wallet_staker = extract_address("ValidatorWalletCreator Contract created at address:"); let deployed_block_number = output.get("deploy_rollup").and_then(|out| { @@ -146,7 +146,7 @@ impl OrbitDeployment { self.config.orbit_setup_config.sequencer_inbox = sequencer_inbox; self.config.orbit_setup_config.bridge = bridge; self.config.orbit_setup_config.validator_utils = validator_utils; - self.config.orbit_setup_config.validator_wallet_creator = validator_wallet_creator; + self.config.orbit_setup_config.validator_wallet_staker = validator_wallet_staker; self.config.orbit_setup_config.deployed_at_block_number = deployed_block_number; Ok(()) @@ -316,10 +316,10 @@ impl OrbitDeployment { .unwrap_or(&"".to_string()), ) .replace( - "${validator_wallet_creator}", + "${validator_wallet_staker}", self.config .orbit_setup_config - .validator_wallet_creator + .validator_wallet_staker .as_ref() .unwrap_or(&"".to_string()), ) @@ -475,10 +475,10 @@ impl OrbitDeployment { .unwrap_or(&"".to_string()), ) .replace( - "${validator_wallet_creator}", + "${validator_wallet_staker}", self.config .orbit_setup_config - .validator_wallet_creator + .validator_wallet_staker .as_ref() .unwrap_or(&"".to_string()), ) diff --git a/src/templates/node_config.json.template b/src/templates/node_config.json.template index 751aa98..0d14a13 100644 --- a/src/templates/node_config.json.template +++ b/src/templates/node_config.json.template @@ -1,6 +1,6 @@ { "chain": { - "info-json": "[{\"chain-id\":${chain_id},\"parent-chain-id\":421614,\"parent-chain-is-arbitrum\":true,\"chain-name\":\"${chain_name}\",\"chain-config\":{\"homesteadBlock\":0,\"daoForkBlock\":null,\"daoForkSupport\":true,\"eip150Block\":0,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"clique\":{\"period\":0,\"epoch\":0},\"arbitrum\":{\"EnableArbOS\":true,\"AllowDebugPrecompiles\":false,\"DataAvailabilityCommittee\":false,\"InitialArbOSVersion\":11,\"GenesisBlockNum\":0,\"MaxCodeSize\":24576,\"MaxInitCodeSize\":49152,\"InitialChainOwner\":\"${chain_owner}\"},\"chainId\":${chain_id}},\"rollup\":{\"bridge\":\"${bridge}\",\"inbox\":\"${inbox}\",\"sequencer-inbox\":\"${sequencer_inbox}\",\"rollup\":\"${rollup}\",\"validator-utils\":\"${validator_utils}\",\"validator-wallet-creator\":\"${validator_wallet_creator}\",\"deployed-at\":${deployed_at}}}]", + "info-json": "[{\"chain-id\":${chain_id},\"parent-chain-id\":421614,\"parent-chain-is-arbitrum\":true,\"chain-name\":\"${chain_name}\",\"chain-config\":{\"homesteadBlock\":0,\"daoForkBlock\":null,\"daoForkSupport\":true,\"eip150Block\":0,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"clique\":{\"period\":0,\"epoch\":0},\"arbitrum\":{\"EnableArbOS\":true,\"AllowDebugPrecompiles\":false,\"DataAvailabilityCommittee\":false,\"InitialArbOSVersion\":11,\"GenesisBlockNum\":0,\"MaxCodeSize\":24576,\"MaxInitCodeSize\":49152,\"InitialChainOwner\":\"${chain_owner}\"},\"chainId\":${chain_id}},\"rollup\":{\"bridge\":\"${bridge}\",\"inbox\":\"${inbox}\",\"sequencer-inbox\":\"${sequencer_inbox}\",\"rollup\":\"${rollup}\",\"validator-utils\":\"${validator_utils}\",\"validator-wallet-staker\":\"${validator_wallet_staker}\",\"deployed-at\":${deployed_at}}}]", "name": "${chain_name}" }, "parent-chain": { diff --git a/src/templates/orbit_setup_config.json.template b/src/templates/orbit_setup_config.json.template index 99a2fd8..0d00899 100644 --- a/src/templates/orbit_setup_config.json.template +++ b/src/templates/orbit_setup_config.json.template @@ -21,6 +21,6 @@ "bridge": "${bridge}", "upgradeExecutor": "${upgrade_executor}", "validatorUtils": "${validator_utils}", - "validatorWalletCreator": "${validator_wallet_creator}", + "validatorWalletCreator": "${validator_wallet_staker}", "deployedAtBlockNumber": ${deployed_at_block_number} } \ No newline at end of file