Skip to content

Commit 9431eac

Browse files
committed
Update environment configuration for wallet keys and accounts
1 parent 30aaeb6 commit 9431eac

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

infrastructure/local-setup-preparation/src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ export async function isOperator(chainId: string, walletAddress: string): Promis
5959

6060
export function getWalletKeys(): WalletKey[] {
6161
// Use private keys from environment variables
62-
const privateKeys = process.env.API_WEB3_JSON_RPC_ACCOUNT_PKS
63-
? process.env.API_WEB3_JSON_RPC_ACCOUNT_PKS.split(',').map(key => key.trim())
62+
const privateKeys = process.env.PRE_FUNDED_ACCOUNT_PKS
63+
? process.env.PRE_FUNDED_ACCOUNT_PKS.split(',').map(key => key.trim())
6464
: [];
6565

6666
// If no keys are provided in environment, log a warning

local-setup/.env.example

+8
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ ETH_SENDER_SENDER_OPERATOR_BLOBS_ETH_ADDR=your-eth-sender-operator-blobs-address
9898
CHAIN_STATE_KEEPER_FEE_ACCOUNT_ADDR=your-fee-account-address
9999
FEE_RECEIVER_PRIVATE_KEY=your-fee-account-private-key
100100

101+
# Private key for the governance account
102+
GOVERNANCE_PRIVATE_KEY=0x86830b34ff2ee5a1e43ba6f3861e594137c3606e97d8bb30a4697e7be9c6969
103+
104+
# Private key for the validator account
105+
VALIDATOR_PRIVATE_KEY=0x86830b34ff2ee5a1e43ba6f3861e594137c3606e97d8bb30a4697e7be9c6969d
106+
101107
# Basic configuration: GOVERNOR_PRIVATE_KEY and DEPLOYER_PRIVATE_KEY should be the same
102108
# GOVERNOR_ADDRESS and CHAIN_ADMIN_ADDRESS should both be derived from that private key
103109
# Advanced configuration: GOVERNOR_ADDRESS should be derived from GOVERNOR_PRIVATE_KEY
@@ -110,6 +116,8 @@ GOVERNOR_PRIVATE_KEY=your-governor-private-key
110116
GOVERNOR_ADDRESS=your-governor-address
111117
# Address with administrative privileges for chain management
112118
CHAIN_ADMIN_ADDRESS=your-chain-admin-address
119+
# Pre-funded account private keys
120+
PRE_FUNDED_ACCOUNT_PKS=your-pre-funded-account-pks
113121

114122
#######################
115123
# Block Explorer Configuration

local-setup/README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,31 @@ Your `.env` file must configure the following roles, using addresses that are pr
155155
GOVERNOR_PRIVATE_KEY=<private-key>
156156
GOVERNOR_ADDRESS=<derived-address>
157157
CHAIN_ADMIN_ADDRESS=<derived-address>
158+
GOVERNANCE_PRIVATE_KEY=<private-key>
158159
```
159160

160-
- Basic setup: Use the same private key for DEPLOYER and GOVERNOR roles
161+
- Basic setup: Use the same private key for DEPLOYER, GOVERNOR and GOVERNANCE roles
161162
- Advanced setup: Can use different addresses for granular permissions
162163
- All addresses must be pre-funded in reth_config
163164
- GOVERNOR_ADDRESS and CHAIN_ADMIN_ADDRESS should be derived from their respective private keys
164165

166+
5. **Validator Account**
167+
168+
```
169+
VALIDATOR_PRIVATE_KEY=<private-key>
170+
```
171+
172+
- Responsible for validating transactions and blocks
173+
- Must be pre-funded in reth_config
174+
175+
6. **Pre-funded Account**
176+
177+
```
178+
PRE_FUNDED_ACCOUNT_PKS=<private-key>
179+
```
180+
181+
- Pre-funded account private keys
182+
165183
#### L1 Chain Configuration
166184

167185
The Layer 1 chain configuration is defined in `local-setup/reth_chaindata/reth_config`. This file configures the local Ethereum-compatible chain used as the L1 for the zkSync deployment.

0 commit comments

Comments
 (0)