This express server application is used to grade submitted challenges from the ETH Tech Tree
Before you begin, you need to install the following tools:
- Node (>= v18.17)
- Yarn (v1 or v2+)
- Git
-
Clone this repo & install dependencies
git clone https://github.com/BuidlGuidl/eth-tech-tree-backend.git cd eth-tech-tree-backend yarn install
-
Set up your environment variables: Make a copy of the
.env.example
file and name it.env.local
and fill in the required environment variables.Set up an Etherscan API Key. Also set up the
MONGODB_URI
pointing to a local or hosted MongoDB instance. -
Seed the database:
seed.example.json
will be used to seed the data. Modify it as needed if you are adding or modifying collections. Run the following command (notice how we add the environment variable then runyarn seed
):MONGODB_URI=mongodb://localhost:27017/your-db-name yarn seed
To overwrite the existing data use
yarn seed --reset
. -
Install challenge folders where tests will be executed
yarn install:challenges
-
Start the server at
localhost:3000
yarn dev
-
Test a challenge submission for token wrapper weth at the following endpoint
POST localhost:3000/submit
With this body:
{ "challengeName": "token-wrapper-weth", "network": "sepolia", "contractAddress": "0xCa359ee2DF0CE120a9eDa850Aa743fC2b4F1ade9", "userAddress": "0x60583563D5879C2E59973E5718c7DE2147971807" }
To test a failing contract use this as the contract address:
0x4c45da107F95d8Ed27951EbDD4CF4CC56B47A83F