Skip to content

Commit 788f8d8

Browse files
Add the hoodi setup section to the l2 example readme
1 parent de809a3 commit 788f8d8

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

examples/l2/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: gen_devnet_owner_wallet gen_env_l2_holesky gen_env_l2_devnet run_l2 generate_program_id gen_env_contract_holesky gen_env_contract_devnet deploy_contract clean_db
1+
.PHONY: gen_devnet_owner_wallet gen_env_l2_holesky gen_env_l2_hoodi gen_env_l2_devnet run_l2 generate_program_id gen_env_contract_holesky gen_env_contract_hoodi gen_env_contract_devnet deploy_contract clean_db
22

33
SHELL := /bin/bash
44

@@ -17,6 +17,9 @@ gen_devnet_owner_wallet:
1717
gen_env_l2_holesky:
1818
@cp .env.holesky .env
1919

20+
gen_env_l2_hoodi:
21+
@cp .env.hoodi .env
22+
2023
gen_env_l2_devnet:
2124
@cp .env.devnet .env
2225

@@ -27,6 +30,9 @@ generate_program_id:
2730
gen_env_contract_holesky:
2831
@cp ./contracts/.env.holesky ./contracts/.env
2932

33+
gen_env_contract_hoodi:
34+
@cp ./contracts/.env.hoodi ./contracts/.env
35+
3036
gen_env_contract_devnet:
3137
@cp ./contracts/.env.devnet ./contracts/.env
3238

examples/l2/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ make submodules
5757

5858
You can run the example on:
5959
- [Holesky](#setup-holeksy)
60+
- [Hoodi](#setup-hoodi)
6061
- [Localnet](#setup-localnet)
6162

6263
## Setup Holeksy
@@ -124,6 +125,69 @@ make gen_env_l2_holesky
124125

125126
Finally [run the l2](#running-the-l2).
126127

128+
## Setup Hoodi
129+
130+
### 1. Create keystore
131+
132+
You can use cast to create a local keystore. If you already have one you can skip this step.
133+
134+
```bash
135+
cast wallet new-mnemonic
136+
```
137+
138+
Then you can import your created keystore using:
139+
140+
```bash
141+
cast wallet import --interactive <path_to_keystore.json>
142+
```
143+
144+
Then you need to obtain some funds to pay for gas and proof verification.
145+
You can do this by using this [faucet](https://cloud.google.com/application/web3/faucet/ethereum/hoodi)
146+
147+
*This same wallet is used to send the proof via aligned, so you'll also need to fund it on aligned. Follow this [guide](https://docs.alignedlayer.com/guides/0_submitting_proofs#id-2.-send-funds-to-aligned).*
148+
149+
### 2. Deploy the contract
150+
151+
- Generate the base `.env`:
152+
153+
```shell
154+
make gen_env_contract_hoodi
155+
```
156+
157+
- Get the program ID of the l2 program you are proving:
158+
159+
```shell
160+
make generate_program_id
161+
```
162+
163+
- Complete the following fields `contracts/.env` file:
164+
- `PROGRAM_ID=` (use the previously generated ID, you can re check with a `cat ./crates/l2/programs_ids.json` )
165+
- `PRIVATE_KEY`: the private key used for the deployment, it needs to have some funds to pay for the deployment.
166+
- `OWNER_ADDRESS`: you have to provide the *address of the wallet created in step `1.`*.
167+
168+
- Deploy the contracts with:
169+
170+
```shell
171+
make deploy_contract
172+
```
173+
174+
*Save the output contract address.*
175+
176+
### 3. Setup the L2
177+
178+
- Generate the base `.env` run:
179+
180+
```shell
181+
make gen_env_l2_hoodi
182+
```
183+
184+
- Complete the missing fields on the `.env`:
185+
- `PRIVATE_KEY_STORE_PATH`: The path to the keystore created in `1.`.
186+
- `PRIVATE_KEY_STORE_PASSWORD`: The password of the keystore crated in step `1.`.
187+
- `STATE_TRANSITION_CONTRACT_ADDRESS`: The address of the contract deployed in step `2.`
188+
189+
Finally [run the l2](#running-the-l2).
190+
127191
## Setup Localnet
128192

129193
You can also run this example on a local devnet. To get started, navigate to the root of the Aligned repository

0 commit comments

Comments
 (0)