Skip to content

Commit

Permalink
feat: update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Nov 11, 2024
1 parent dc8fe1c commit 0fcc0a7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -341,7 +341,7 @@ pub struct OrbitSetupConfig {
pub bridge: Option<String>,
pub upgrade_executor: Option<String>,
pub validator_utils: Option<String>,
pub validator_wallet_creator: Option<String>,
pub validator_wallet_staker: Option<String>,
pub deployed_at_block_number: Option<u64>,
}

Expand All @@ -359,7 +359,7 @@ impl OrbitConfig {
pub fn new(
chain_id: u64,
chain_name: impl Into<String>,
creator_address: Address,
staker_address: Address,
private_key: impl Into<String>,
avail_config: AvailConfig,
working_dir: impl Into<PathBuf>,
Expand All @@ -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(),
}
Expand Down Expand Up @@ -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),
Expand Down
14 changes: 7 additions & 7 deletions src/deployments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand Down Expand Up @@ -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| {
Expand All @@ -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(())
Expand Down Expand Up @@ -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()),
)
Expand Down Expand Up @@ -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()),
)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/node_config.json.template
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/orbit_setup_config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

0 comments on commit 0fcc0a7

Please sign in to comment.