Skip to content

Commit 3588e09

Browse files
committed
Simplify readme
1 parent 5deddd2 commit 3588e09

1 file changed

Lines changed: 25 additions & 19 deletions

File tree

examples/l2/README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ After processing the transfers, the vm computes the commitment of the post state
99

1010
Notice a lot of checks that a real L2 should have are missing, since the focus are on the integration of Aligned.
1111

12-
### How it works: Step by Step
12+
## How it works: Step by Step
1313

1414
1. Load or initialize the state.
1515
2. Load user transfers.
@@ -54,22 +54,24 @@ This same wallet is used to send the proof via aligned, so you'll also need to f
5454

5555
#### 2. Deploy the contract
5656

57-
Generate the base `.env`. For `Holesky` you can run:
57+
- Generate the base `.env`. For `Holesky` you can run:
5858

5959
```shell
6060
make gen_env_contract_holesky
6161
```
6262

63-
And then in `contracts/.env` you have to complete the missing variables:
63+
- Get the program ID of the l2 program you are proving:
6464

65-
- `INITIAL_STATE_ROOT`: you can leave it as it is unless you change the initial state in `crates/l2/db.rs`
66-
- `PROGRAM_ID`: you need to ensure it matches the one on your machine:
67-
1. Run `make generate_program_id` to generate it.
68-
2. Check `crates/l2/programs_ids.json` for the ID.
69-
- `OWNER_ADDRESS`: you have to provide the address of the wallet created in step `1.`.
70-
- `PRIVATE_KEY`: the private key used for the deployment, it needs to have some funds to pay for the deployment.
65+
```shell
66+
make generate_program_id
67+
```
68+
69+
- Complete the following fields `contracts/.env` file:
70+
- ```PROGRAM_ID=``` (use the previously generated ID, you can re check with a ```sh cat ./crates/l2/programs_ids.json``` )
71+
- `PRIVATE_KEY`: the private key used for the deployment, it needs to have some funds to pay for the deployment.
72+
- `OWNER_ADDRESS`: you have to provide the address of the wallet created in step `1.`.
7173

72-
Once you have completed the `.env`, you can deploy the contract:
74+
- Deploy the contracts with:
7375

7476
```shell
7577
make deploy_contract
@@ -79,28 +81,32 @@ Save the output contract address.
7981

8082
#### 3. Run L2 program
8183

82-
Generate the base `.env`. For `Holesky` you can run:
84+
- Generate the base `.env`. For `Holesky` you can run:
8385

8486
```shell
8587
make gen_env_l2_holesky
8688
```
8789

88-
And complete the variables:
90+
- Complete the missing fields on the ```sh .env```:
91+
92+
- `BEACON_CLIENT_URL`: A beacon client url, public node usually don't work as they don't support the endpoints to retrieve blob data
93+
- `PRIVATE_KEY_STORE_PATH`: The path to the keystore created in `1.`.
94+
- `PRIVATE_KEY_STORE_PASSWORD`: The password of the keystore crated in step `1.`.
95+
- `STATE_TRANSITION_CONTRACT_ADDRESS`: The address of the contract deployed in step `2.`
96+
97+
- If you have run the program before, and want to start from scratch, run:
8998

90-
- `BEACON_CLIENT_URL`: A beacon client url, public node usually don't work as they don't support the endpoints to retrieve blob data
91-
- `PRIVATE_KEY_STORE_PATH`: The path to the keystore created in `1.`.
92-
- `PRIVATE_KEY_STORE_PASSWORD`: The password of the keystore crated in step `1.`.
93-
- `STATE_TRANSITION_CONTRACT_ADDRESS`: The address of the contract deployed in step `2.`
99+
```make clean_db```
94100

95-
Finally, run the L2:
101+
- Run the L2:
96102

97103
```shell
98104
make run_l2
99105
```
100106

101-
You should see a transaction receipt in the console and the stateRoot updated on-chain. You can run this process repeatedly, but make sure to not delete the db file, or the application will not be able to prove valid state transitions.
107+
You should see a transaction receipt in the console and after the stateRoot updated on-chain.
102108

103-
### Run it on a local devnet
109+
### Running it on a local network
104110

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

0 commit comments

Comments
 (0)