Skip to content

Commit

Permalink
Revert "Update env var names"
Browse files Browse the repository at this point in the history
This reverts commit b95fa3a.
  • Loading branch information
ytham committed Apr 30, 2024
1 parent 951cba7 commit 62cd59f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Make a copy of this file and rename to `.env`

# Your provider URI (starting with 'https://...' from Alchemy, Quicknode, Infura, etc)
# **IMPORTANT:** replace `11155111` with your desired chain ID if not using Sepolia testnet
RPC_URL_11155111=""
# **IMPORTANT:** replace `11155111` with your desired chainID if not using Eth Sepolia
PROVIDER_URI_11155111=""
ETHERSCAN_API_KEY=""

# (Optional) Private key for sending a transaction to the AxiomV2Query contract if
# you want to actually send the Query on-chain.
# **IMPORTANT:** replace `11155111` with your desired chain ID if not using Sepolia testnet
# **IMPORTANT:** replace `11155111` with your desired chainID if not using Eth Sepolia
PRIVATE_KEY_11155111=<optional>
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:

- name: Run Foundry tests
run: |
export RPC_URL_11155111=${{ secrets.RPC_URL_11155111 }}
export PROVIDER_URI_11155111=${{ secrets.PROVIDER_URI_11155111 }}
RUST_BACKTRACE=1 forge test -vvv
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ To run Foundry tests that simulate the Axiom integration flow, run
forge test -vvvv
```

## Send a query on-chain
## Send a Query on-chain

> **IMPORTANT**: Please update the chain ID in the environment variable name to the chain ID that you are running on, if not 11155111 (Sepolia testnet).
> **IMPORTANT**: Please update the chain ID in the environment variable name to the chain ID that you are running on, if not 11155111 (Eth Sepolia).
To send a query on Sepolia testnet (requires `PRIVATE_KEY_11155111` in `.env` file), run
To send a Query on Sepolia testnet (requires `PRIVATE_KEY_11155111` in `.env` file), run

```bash
npx tsx app/index.ts
Expand All @@ -43,13 +43,13 @@ npx tsx app/index.ts

```bash
# compile
npx axiom circuit compile app/axiom/average.circuit.ts --provider $RPC_URL_11155111
npx axiom circuit compile app/axiom/average.circuit.ts --provider $PROVIDER_URI_11155111

# prove
npx axiom circuit prove app/axiom/average.circuit.ts --sourceChainId 11155111 --provider $RPC_URL_11155111
npx axiom circuit prove app/axiom/average.circuit.ts --sourceChainId 11155111 --provider $PROVIDER_URI_11155111

# get parameters to send a query to Axiom using sendQuery
npx axiom circuit query-params <callback contract address> --refundAddress <your Sepolia wallet address> --sourceChainId 11155111 --provider $RPC_URL_11155111
npx axiom circuit query-params <callback contract address> --refundAddress <your Sepolia wallet address> --sourceChainId 11155111 --provider $PROVIDER_URI_11155111
```

## Package Manager Installation
Expand Down
6 changes: 3 additions & 3 deletions app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import compiledCircuit from "./axiom/data/compiled.json";

const CHAIN_ID = "11155111";

if (!process.env[`RPC_URL_${CHAIN_ID}`]) {
console.error(`No provider URI provided for env var \`RPC_URL_${CHAIN_ID}\`.`);
if (!process.env[`PROVIDER_URI_${CHAIN_ID}`]) {
console.error(`No provider URI provided for env var \`PROVIDER_URI_${CHAIN_ID}\`.`);
process.exit(1);
}

Expand All @@ -23,7 +23,7 @@ const axiomMain = async (input: UserInput<CircuitInputs>) => {
circuit: circuit,
compiledCircuit: compiledCircuit,
chainId: CHAIN_ID, // Sepolia
provider: process.env[`RPC_URL_${CHAIN_ID}`] as string,
provider: process.env[`PROVIDER_URI_${CHAIN_ID}`] as string,
privateKey: process.env[`PRIVATE_KEY_${CHAIN_ID}`] as string,
callback: {
target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e",
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ast = true

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
[rpc_endpoints]
provider = "${RPC_URL_11155111}"
provider = "${PROVIDER_URI_11155111}"

[fmt]
bracket_spacing = true
Expand Down

0 comments on commit 62cd59f

Please sign in to comment.