Skip to content

Developer-DAO/rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a6e76b3 · Apr 8, 2025

History

90 Commits
Apr 8, 2025
Mar 25, 2025
Apr 8, 2025
Apr 8, 2025
Sep 19, 2024
Apr 8, 2025
Apr 7, 2025
Apr 1, 2025
May 2, 2024
Jan 28, 2024
May 2, 2024

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

  • run cargo test routes::login::tests::get_key -- --show-output to generate a JWT key, and the output 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

Start the Server

Once the database is set up and all the values are added to .env, you can start the server with cargo run --release.

To run auth with a localhost SIWE domain && use any contract with the payment processor for testing, run cargo run --release --features dev.