Rune Airdrop Backend (This ๐ฆ repository contains the backend ๐งฉ services for the ๐ Rune Airdrop ๐ project, featuring a Swagger UI ๐ for API ๐ ๏ธ documentation ๐ and ๐งช testing)
The Runestone Airdrop Backend is a server application that facilitates the airdrop of Runestone tokens. The backend is developed using Node.js and Express.js and includes API endpoints for various functionalities such as redeeming fees, estimating transaction fees, and managing different amounts for airdrops. The project also integrates Swagger UI for API documentation.
root/
โโโ config/
โ โโโ config.ts
โโโ routes
โ โโโ AirdropRoute
โ โโโ different-amount.route.ts
โ โโโ large-different-amount.route.ts
โ โโโ large-different-amount-airdrop.route.ts
โ โโโ same-amount.route.ts
โ โโโ EstimateRoute
โ โโโ different-amount-estimate.route.ts
โ โโโ same-amount-estimate.route.ts
โ โโโ SubRoute
โ โโโ runestone-fee.route.ts
โโโ service/
โ โโโ psbt/
โ โโโ CreateAirdropRunestonePsbt.ts
โ โโโ redeemRunestoneAmountRunestone.ts
โ โโโ redeemRunestoneSameAmount.ts
โ โโโ RuneOne.ts
โ โโโ RuneSub.ts
โ โโโ SameAmountEstimate.ts
โโโ test/
โ โโโ CreateTest.ts
โ โโโ freeTierAirdrop.ts
โ โโโ matchTests.ts
โ โโโ MWtests.ts
โโโ utils/
โ โโโ blockcypher.api.ts
โ โโโ mempool.api.ts
โ โโโ TS
โ โ โโโ mw.ts
โ โ โโโ TsUtils.ts
โ โโโ unisat.api.ts
โโโ .env.example
โโโ package.json
โโโ README.md
โโโ swagger.yaml
โโโ tsconfig.json
โโโ yarn.lock
env
Clone the repository:
git clone git clone https://github.com/leionion/rune-airdrop-backend.git
cd rune-airdrop-backend
Install dependencies:
yarn install
Create a .env
file:
cp .env.example .env
Configure the environment variables in .env
file:
PORT=your-port
Start the server:
yarn dev
The server should be running on the specified port. You can visit http://localhost:[PORT]
to check if the server is up and running.
Access the API documentation via Swagger UI at http://localhost:[PORT]/api-docs
.
Here are some key API endpoints provided by the backend:
cors
package.body-parser
and express.json
.Swagger UI is integrated to provide interactive API documentation. The swagger.yaml
file is required to configure API documentation, which can be accessed at /api-docs
.
Mutex from async-mutex
is used for API rate limit protection functionality.
app.locals.walletIndex
: Global iterator for wallet management.app.locals.iterator
: Global iterator for unisat API distribution.The base URL for the API is:
http://localhost:5000/api
https://rune-airdrop-backend.onrender.com/api
/different-amount
/large-different-amount
/large-different-amount-airdrop
/same-amount
/runestone-fee
/estimate/different-amount
/estimate/same-amount
In case of errors, the API responds with appropriate HTTP status codes along with error messages in the response body.