Skip to content

Developer-DAO/rpc

Repository files navigation

How to Run

This server requires a few things set up in order to properly run it.

Postgres

Install Postgres:

MacOs: brew install postgresql@16

Linux: sudo apt-get -y install postgresql-16

Windows: Download the installer

Optional: Install PgAdmin

Rust Compiler

Install Rust compiler:

Linux / Mac: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Windows: Download the installer

Set Up

  • Create database locally using PgAdmin or Postgres on the CLI

  • run cargo install sqlx-cli

  • cd into the project's root

  • create .env file

  • The following fields should be added:

    1. DATABASE_URL
    2. SMTP_USERNAME
    3. SMTP_PASSWORD
    4. ETHEREUM_ENDPOINT
    5. JWT_KEY
  • Create connection string from DB details and add to .env as the value of DATABASE_URL. Example: postgres://username:password@localhost:5432/databasename

  • run sqlx database create

  • run sqlx migrate run

  • generate JWT key by running the test called get_key in crate::routes::login and use as value of JWT_KEY in .env

  • add an email address for SMTP_USERNAME (it is probably best to make a new one or a temp)

  • add a password to that email for SMTP_PASSWORD

  • add a URL to any Ethereum JSON-RPC endpoint (local or otherwise) for ETHEREUM_ENDPOINT

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published