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.
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.
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.
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
Ensure you have the following installed on your local machine:
- Rust (1.78)
- Docker Compose
- PostgreSQL (14)
- Clone the repository:
git clone https://github.com/Ludium-Official/ludium-world-payment.git
cd ludium-world-payment
- Set up the environment variables by creating a .env file:
cp .env.example .env.local
- 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
.
- run app & db container
cd docker-compose && docker-compose -f ./local.yml up -d
// or just `cargo run`
check the docker-compose
- Start the application with hot-reloading for development:
cargo watch -q -c -w src/ -x run
- To run the tests with hot-reloading:
cargo watch -q -c -w tests/ -x "test -q quick_dev -- --nocapture --ignored"
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, runningscripts/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