Skip to content

Ludium-Official/ludium-world-payment

Repository files navigation

Ludium Reward Payment System

About

Ludium Reward Payment is an Axum-based backend system designed to manage off-chain transactions and APIs, also serving as a on-chain relayer system.

off-chain things

The system manages reward payment transaction records and handles various APIs to facilitate smooth operations. This includes tracking and recording transaction histories, ensuring data consistency, and providing necessary endpoints for interacting with the system.

on-chain things

Ludium Reward Payment utilizes NEAR protocol's meta-transaction capabilities to facilitate efficient transaction processing. the system is designed with scalability in mind to support future integration with multi-chain networks, enabling seamless transactions across different chains.

Project Structure - Hexagonal Architecture

check the ARCHITECTURE.md

payment system use Hexagonal Architecture to achieve scalability and flexibility. This architecture allows us to:

  • Isolate the core logic of the application from external dependencies
  • Facilitate easier testing and maintenance
  • Support future integration with multi-chain

Getting Started

Prerequisites

Ensure you have the following installed on your local machine:

  • Rust (1.78)
  • Docker Compose
  • PostgreSQL (14)

Installation

  1. Clone the repository:
git clone https://github.com/Ludium-Official/ludium-world-payment.git
cd ludium-world-payment
  1. Set up the environment variables by creating a .env file:
cp .env.example .env.local
  1. Set up near multi account_keys

check the near/pagoda-relayer-rs readme

You will need to create and set your own multi account_keys in the /account_keys folder, and set the relayer_account_id, keys_filename to match the account you set in config.toml.

  1. run app & db container
cd docker-compose && docker-compose -f ./local.yml up -d

// or just `cargo run`

check the docker-compose

For Development

  1. Start the application with hot-reloading for development:
cargo watch -q -c -w src/ -x run
  1. To run the tests with hot-reloading:
cargo watch -q -c -w tests/ -x "test -q quick_dev -- --nocapture --ignored"

db schema update (FYI)

if you want to set a new db table. you have to print db schema file

Note: The payment system does not use disel migration directly. You can configure and use Diesel migrations if needed. Currently, in development, running scripts/dev_initial will automatically set up the database with mock data.

# diesel print-schema --database-url={db_url} > {print_path}
diesel print-schema --database-url=postgres://postgres:postgres@localhost:5432/temp_local > src/adapter/output/persistence/db/schema.rs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published