Skip to content

Commit eb34070

Browse files
committed
docs: provide a default wallet for devnet
1 parent 9fd5b85 commit eb34070

4 files changed

Lines changed: 38 additions & 5 deletions

File tree

examples/L2/.env.devnet

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ NETWORK=devnet
33
ETH_RPC_URL=http://localhost:8545
44
WS_ETH_RPC_URL=ws://localhost:8546
55
BEACON_CLIENT_URL=http://localhost:58801
6-
PRIVATE_KEY_STORE_PATH=<PATH_TO_STATE_TRANSITION_OWNER_KEYSTORE>
7-
PRIVATE_KEY_STORE_PASSWORD=<STATE_TRANSITION_OWNER_KEYSTORE_PASSWORD>
6+
# Generate it with make gen_devnet_owner_wallet
7+
PRIVATE_KEY_STORE_PATH="contract-owner.keystore.json"
8+
PRIVATE_KEY_STORE_PASSWORD="<!w5Y%In94Vw"
89
STATE_TRANSITION_CONTRACT_ADDRESS=<STATE_TRANSITION_CONTRACT_ADDRESS>

examples/L2/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
SHELL := /bin/bash
44

5+
gen_devnet_owner_wallet:
6+
cast wallet import -k . contract-owner.keystore.json --private-key 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a --unsafe-password "<!w5Y%In94Vw"
7+
@echo "Funding on Aligned"
8+
cd ../../batcher/aligned/ && \
9+
cargo run --release -- deposit-to-batcher \
10+
--amount 0.01ether \
11+
--private_key 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a \
12+
--network devnet \
13+
--rpc_url http://localhost:8545
14+
515
gen_env_l2_holesky:
616
@cp .env.holesky .env
717

examples/L2/README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ You should see a transaction receipt in the console and the stateRoot updated on
105105
You can also run this example on a local devnet. To get started, navigate to the root of the Aligned repository and run:
106106

107107
```shell
108+
# This will start the local net
108109
make ethereum_package_start
110+
# Start the batcher
111+
make batcher_start_ethereum_package
112+
# Send proofs to be able to build batches
113+
make batcher_send_burst_groth16
109114
```
110115

111116
The remaining steps are the same as for other networks, except you'll be using the `devnet` environment. Specifically, generate the `.env` files for `devnet` using:
@@ -115,4 +120,21 @@ make gen_env_contract_devnet
115120
make gen_env_l2_devnet
116121
```
117122

118-
Finally, make sure to fund your wallet on Aligned using `NETWORK=devnet`.
123+
By default and to make things simpler, the `.env` will be generated using a dev rich wallet. You can of course, creaste your own wallet by following the steps on `1.`. Since the L2 requires a keystore, you'll need to generate it via:
124+
125+
```shell
126+
# This will generate the keystore and fund it on aligned
127+
make gen_devnet_owner_wallet
128+
```
129+
130+
Finally, generate the program id with: `make generate_program_id`, copy the address to the generated `.env` and deploy the contract:
131+
132+
```shell
133+
make deploy_contract
134+
```
135+
136+
Pass the output address in the `.env` and run the l2:
137+
138+
```shell
139+
make run_l2
140+
```

examples/L2/contracts/.env.devnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ RPC_URL=http://localhost:8545
33
INITIAL_STATE_ROOT=0x3c1d1c01f8e0a4533085bc9d8a3829c5f6872e6d6cf62e04ae71acbc803747ce
44
# You can read it from crates/l2/programs_ids.json and generate it via `make generate_program_id`
55
PROGRAM_ID=<PROGRAM_ID>
6-
# Address of the wallet you want to set as owner
7-
OWNER_ADDRESS=<CONTRACT_OWNER_ADDRESS>
6+
# Address of the wallet you want to set as owner (default to rich account 4 on ethereum package)
7+
OWNER_ADDRESS=0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
88
# A prefunded rich account
99
PRIVATE_KEY=0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a
1010
# This is the aligned proof aggregator address in devnet

0 commit comments

Comments
 (0)