Skip to content

BackendForge/token-api-example

Repository files navigation

NO-GRIND token API

This is a API for the NO-GRIND token. Allows many "mint" at the same time. Transactions queued is hardcoded to 30.

Token address is hardcoded.

This is supposed to be run within single wallet.

Pre-requisites

On Linux systems, you may need to install the following dependencies:

apt install libssl-dev

Whenever submodules are added, updated or removed, the following command should be run:

git submodule update --init

Currently there are no submodules.

Server binaries

Build production binaries

RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build --release --bin api -j $(nproc)
# RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build -Z build-std=std,panic_abort --target x86_64-apple-darwin --release
cargo build --release -j $(nproc)

Compress binaries using UPX, if needed

upx --best --lzma target/release/min-sized-rust

Containers

Sometimes it's advantageous to deploy Rust into containers (e.g. Docker). There are several great existing resources to help create minimum sized container images that run Rust binaries.

Build container

docker compose build --remove-orphans

Run container (detached)

docker compose up -d

Run and build container attached

docker compose up --build --remove-orphans

Run server

cargo run --bin no-grind-token-api

Live development

cargo doc --open
cargo watch -p api -x "run --bin no-grind-token-api"

Generate documentation

cargo doc --no-deps --open

Generate SHA256

echo -n "your-string" | openssl dgst -sha256

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

TODO

  • Refactor code, to use more of Borrow, Mut borrow, for things that implements Copy trait
  • Add support for multiple wallets withing smart contract (multiple mint admins) - if scale is needed
  • Add DOCS and examples for everything
  • Add tests
  • Add benchmarking
  • Add CI/CD

About

Rust REST API to "mint" token

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published