Skip to content

Commit

Permalink
update readme and env example
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalgek committed Dec 23, 2024
1 parent 0fe71b3 commit 56ef326
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 54 deletions.
49 changes: 43 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,23 +1,60 @@
# Private key of the deployer account used for deployment process
# Private key of the deployer account used for deployment process. It is the same for both L1 and L2 networks.
DEPLOYER_PRIVATE_KEY=

# Network chain IDs for the respective blockchain networks.
# The chain ID can be found in the documentation of the specific blockchain.

# L1_CHAIN_ID: The chain ID for the Layer1 network (e.g., Ethereum, Mainnet, or a specific testnet).
L1_CHAIN_ID=11155111

# L2_CHAIN_ID: The chain ID for the Layer2 network (e.g., Optimism, Unichain, or another L2 solution).
L2_CHAIN_ID=1301
L1_REMOTE_RPC_URL=https://sepolia.infura.io/v3/<key>
L2_REMOTE_RPC_URL=https://unichain-sepolia.g.alchemy.com/v2/<key>


# RPC URLs for connecting to blockchain networks.
# It's recommended to use a paid service to ensure reliability and minimize RPC errors.

# L1_REMOTE_RPC_URL: The RPC URL for the Layer1 network (e.g., Ethereum or a specific testnet like Sepolia).
L1_REMOTE_RPC_URL=https://sepolia.infura.io/v3/<your_rpc_key>

# L2_REMOTE_RPC_URL: The RPC URL for the Layer2 network (e.g., Unichain on Sepolia or other L2 solutions).
L2_REMOTE_RPC_URL=https://unichain-sepolia.g.alchemy.com/v2/<your_rpc_key>


# Ports used for local forks to test deployments and run integration tests.

# L1_LOCAL_RPC_PORT: The port for the local fork of the Layer1 network.
L1_LOCAL_RPC_PORT=8545

# L2_LOCAL_RPC_PORT: The port for the local fork of the Layer2 network.
L2_LOCAL_RPC_PORT=9545

# Port required to run hardhat in diffyscan
DIFFYSCAN_RPC_PORT=7545


# Configuration for verifying contracts.

# L1_EXPLORER_TOKEN: API token for the Layer1 block explorer (e.g., Etherscan for Sepolia).
L1_EXPLORER_TOKEN=

# L2_EXPLORER_TOKEN: API token for the Layer2 block explorer (e.g., Blockscout for Unichain-Sepolia).
L2_EXPLORER_TOKEN=

# L1_BLOCK_EXPLORER_BROWSER_URL: The browser URL for the Layer1 block explorer.
L1_BLOCK_EXPLORER_BROWSER_URL=https://sepolia.etherscan.io

# L2_BLOCK_EXPLORER_BROWSER_URL: The browser URL for the Layer2 block explorer.
L2_BLOCK_EXPLORER_BROWSER_URL=https://unichain-sepolia.blockscout.com

# L1_BLOCK_EXPLORER_API_HOST: The API host for the Layer1 block explorer.
L1_BLOCK_EXPLORER_API_HOST=api-sepolia.etherscan.io

# L2_BLOCK_EXPLORER_API_HOST: The API host for the Layer2 block explorer.
L2_BLOCK_EXPLORER_API_HOST=unichain-sepolia.blockscout.com

GITHUB_API_TOKEN=

L1_BLOCK_EXPLORER_API_URL="https://${L1_BLOCK_EXPLORER_API_HOST}/api"
L2_BLOCK_EXPLORER_API_URL="https://${L2_BLOCK_EXPLORER_API_HOST}/api"
# Configuration for DiffyScan to compare GitHub sources with deployed contracts.
# Ensure you have a valid GitHub API token with the necessary permissions.

GITHUB_API_TOKEN=
58 changes: 10 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,57 +34,19 @@ This command installs all necessary dependencies for the automaton and its submo

## Usage

### Environment Setup

Before running the script, set up your environment variables.

#### Deployer Private Key

```bash
export DEPLOYER_PRIVATE_KEY=<your-deployer-private-key>
```
### Prerequisites
- deployer must have ETH on both networks.
- config setup with EM brakes.

#### RPC URLs
### Config Setup
Create config file using existing one for unichain (`./configs/unichain_sepolia.yaml`) as an example.

Set up chain ID's and remote RPC URLs to run local testnet nodes that forks real network state.

```bash
export L1_CHAIN_ID=<l1-chain-id>
export L2_CHAIN_ID=<l2-chain-id>
export L1_REMOTE_RPC_URL=<your-l1-remote-rpc-url>
export L2_REMOTE_RPC_URL=<your-l2-remote-rpc-url>
```

Set up local port numbers for running forked nodes.

```bash
export L1_LOCAL_RPC_PORT=<your-l1-local-rpc-port>
export L2_LOCAL_RPC_PORT=<your-l2-local-rpc-port>
```

Set up port number to run diffyscan fork.

```bash
export DIFFYSCAN_RPC_PORT=<rpc-port-for-diffyscan-fork>
```

#### API Tokens

Set your Etherscan tokens and URL's to fetch verified source code:

```bash
export L1_EXPLORER_TOKEN=<your-etherscan-token>
export L2_EXPLORER_TOKEN=<your-optimism-etherscan-token>
export L1_BLOCK_EXPLORER_BROWSER_URL=<l1-block-explorer-browser-url>
export L2_BLOCK_EXPLORER_BROWSER_URL=<l2-block-explorer-browser-url>
export L1_BLOCK_EXPLORER_API_URL=<l1-block-explorer-api-url>
export L2_BLOCK_EXPLORER_API_URL=<l2-block-explorer-api-url>
```
### Environment Setup

Set your GitHub token to avoid strict rate limiting when querying the API:
Before running the script, set up your environment variables by copying `.env.example` and fill it with your data:

```bash
export GITHUB_API_TOKEN=<your-github-token>
cp .env.example .env
```

### Running the Script
Expand All @@ -99,10 +61,10 @@ yarn start ./path/to/config.yaml
### Docker

To reate container:
To сreate containe use this command with `linux/amd64` architecture:

```bash
docker build -t <build_name> .
docker buildx build --platform linux/amd64 -t <build_name> .
```

Provide .env file and path to config to run it:
Expand Down

0 comments on commit 56ef326

Please sign in to comment.