Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Replace postgress with mongo #1

Merged
merged 6 commits into from
Aug 31, 2023
Merged

Conversation

knoll3
Copy link
Contributor

@knoll3 knoll3 commented Aug 28, 2023

View the readme for instructions on setting up the db. Still using docker compose as before but you need to set the env variable in .env.

DATABASE_URL="mongodb://admin:pass@localhost:27017/prisma-mongo?authSource=admin&retryWrites=true&w=majority"

I set up a quick temporary test for the db in scripts/index.ts. This scripts directory can be removed, it's just there for quickly testing db insertions.

cd backend
npx ts-node scripts/index.ts

model Leaf {
address String @map("_id")
usdValue Int
merkleProof String[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question regarding the merkle proof. Why did this change from path, indices, and root?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this should remain the same as path + indices --- and then we need to link the leaf to the group somehow (whether thats via a root other other)

merkleRoot String @map("_id")
name String
threshold Int
erc20Addresses String[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure if we need to save erc20 addresses since they will be available from the leaf object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christopherdancy -- where are the ERC20addresses on the leaf object? The leaf is only the address, balance, and proof currently.

@christopherdancy christopherdancy merged commit 52595b9 into main Aug 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants