diff --git a/simple-block-agreement/README.md b/simple-block-agreement/README.md index 82104f0..1005944 100644 --- a/simple-block-agreement/README.md +++ b/simple-block-agreement/README.md @@ -18,10 +18,6 @@ This repository contains the core Based Applications Contracts, including UUPS u ## :page_with_curl: _Instructions for Operator_ -**0)** Install a command line tool to load your env automatically, like: - -__`❍ brew install autoenv`__ - **1)** Fire up your favorite console & clone this repo somewhere: __`❍ git clone https://github.com/ssvlabs/examples.git`__ @@ -38,9 +34,9 @@ __`❍ npm install`__ __`❍ cp .env.example .env`__ -**5)** Load the env: +**5)** Load the env in your favorite way: -__`❍ cd .`__ +__`❍ source .env`__ **6)** Make sure env is loaded correctly: diff --git a/simple-block-agreement/operator/src/index.ts b/simple-block-agreement/operator/src/index.ts index 6a87e25..ec74449 100644 --- a/simple-block-agreement/operator/src/index.ts +++ b/simple-block-agreement/operator/src/index.ts @@ -6,6 +6,22 @@ import { getData } from './data/get-data' dotenv.config() const main = async () => { + const requiredEnvVars = [ + 'BEACONCHAIN_API', + 'THE_GRAPH_API', + 'BAPP_ADDRESS', + 'USE_EXPONENTIAL_WEIGHT', + 'USE_HARMONIC_COMBINATION_FUNCTION', + 'PRIVATE_KEYS', + ] + + requiredEnvVars.forEach((envVar) => { + if (!process.env[envVar]) { + console.error(`Missing required environment variable: ${envVar}`) + process.exit(1) + } + }) + const app = new App() const bAppAddress = process.env.BAPP_ADDRESS || ''