Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
README, scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Jan 22, 2024
1 parent b4f77fb commit 3d9fb9d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ roots from Avail blocks.
## Deployment
The circuits are available on Succinct X [here](https://platform.succinct.xyz/succinctlabs/vectorx).

Vector X is currently deployed for Avail's Goldberg testnet on Holesky [here](https://holesky.etherscan.io/address/0x17156d52c0707cde305661ba45457afc23d851e0#events).
Vector X is currently deployed for Avail's Goldberg testnet on Sepolia [here](https://sepolia.etherscan.io/address/0x5ac10644a873AAcd288775A90d6D0303496A4304#events).

## Integrate
## Run the VectorX Light Client
Get the genesis parameters for the `VectorX` contract with a specific Avail block (with no input defaults to block 1).
```
cargo run --bin genesis -- --block 100
cargo run --bin genesis -- --block 240000
```

Update `contracts/.env` following `contracts/.env.example`.
Expand All @@ -38,25 +38,6 @@ In `/`, run
cargo run --bin vectorx
```

### Reset the Contract
Get the new genesis parameters for the `VectorX` contract with a specific Avail block (with no input defaults to block 1).
```
cargo run --bin genesis -- --block 100
```

Update `contracts/.env` following `contracts/.env.example`.

Deploy the `VectorX` contract with genesis parameters.

In `contracts/`, run
```
forge install
source .env
forge script script/Reinitialize.s.sol --rpc-url $ETHEREUM_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY
```

## Avail Indexer
Avail does not currently store justifications for non-era end blocks on archive nodes, so the
following service indexes Avail and stores the ephermal justifications, which are used for `step`
Expand All @@ -70,13 +51,23 @@ cargo run --bin indexer
## Avail Merkle Proof Service
Whenever a new data root commitment is stored on-chain, the merkle proofs need to be made available for end-users to prove the data root's of blocks within those data commitments. This service listens for data root commitment events on-chain and stores the merkle proofs for each data root in the range, which is then exposed via a separate endpoint.

### Run the Merkle Proof Service
### Run the Merkle Proof Indexer Service
```
cargo run --bin events
```

### Query for a `dataRoot` Proof
Example of querying for the merkle proof data for Goldberg testnet block 156961.
### Query for `dataRoot` Proof Data
Example of querying for the merkle proof data for Goldberg testnet block 248490 from the VectroX contract
deployed on Sepolia (chainId 11155111) at address 0x5ac10644a873AAcd288775A90d6D0303496A4304.
```
curl https://beaconapi.succinct.xyz/api/integrations/vectorx/156961
curl https://beaconapi.succinct.xyz/api/integrations/vectorx?chainName=goldberg&contractChainId=11155111&contractAddress=0x5ac10644a873AAcd288775A90d6D0303496A4304&blockNumber=248490
```

## Dummy VectorX Set-Up
If you do not want to generate proofs for the `VectorX` light client, you can use `DummyVectorX` instead with dummy circuits that do not require any intensive proof generation. You can deploy the DummyVectorX contract with the same genesis parameters as the VectorX contract and re-initialize the light client using the following commands. Ensure you are using the dummy function IDs for [`dummy_rotate`](https://alpha.succinct.xyz/avail/vectorx/releases/10) and [`dummy_step`](https://alpha.succinct.xyz/avail/vectorx/releases/9).

```
forge script script/DeployDummy.s.sol --rpc-url $ETHEREUM_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY
forge script script/ReinitializeDummy.s.sol --rpc-url $ETHEREUM_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY
```

0 comments on commit 3d9fb9d

Please sign in to comment.