Skip to content

Commit

Permalink
Add possibility to use a global .env file in the root of the project
Browse files Browse the repository at this point in the history
  • Loading branch information
TucksonDev committed Mar 9, 2023
1 parent 77f827e commit ba7f90d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is a sample .env file for use in local development.
# Duplicate this file as .env here

# Your Private key
DEVNET_PRIVKEY="0x your key here"

# Hosted Aggregator Node (JSON-RPC Endpoint). This is Arbitrum Goerli Testnet, can use any Arbitrum chain
L2RPC="https://goerli-rollup.arbitrum.io/rpc"

# Ethereum RPC; i.e., for Goerli https://goerli.infura.io/v3/<your infura key>
L1RPC=""
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.env
node_modules/
packages/.DS_Store
packages/*/.DS_Store
Expand Down
3 changes: 2 additions & 1 deletion packages/arb-shared-dependencies/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const hardhatConfig = require('./hardhat.config.js')
require('dotenv').config()
const path = require('path')
require('dotenv').config({ path: path.join(__dirname, '..', '..', '.env') })

const wait = (ms = 0) => {
return new Promise(res => setTimeout(res, ms || 0))
Expand Down
2 changes: 2 additions & 0 deletions packages/gas-estimation/scripts/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { utils, providers } from "ethers";
import { ArbGasInfo__factory } from "@arbitrum/sdk/dist/lib/abi/factories/ArbGasInfo__factory";
import { NodeInterface__factory } from "@arbitrum/sdk/dist/lib/abi/factories/NodeInterface__factory";
import { ARB_GAS_INFO, NODE_INTERFACE_ADDRESS } from "@arbitrum/sdk/dist/lib/dataEntities/constants";
const { requireEnvVariables } = require('arb-shared-dependencies');

// Importing configuration //
require('dotenv').config();
requireEnvVariables(['L2RPC']);

// Initial setup //
const baseL2Provider = new providers.StaticJsonRpcProvider(process.env.L2RPC);
Expand Down

0 comments on commit ba7f90d

Please sign in to comment.