This application enables the users to receiver coins on the Bitsong Testnet. It can be called through simple HTTP GET requests, whose single query parameter is the address of the wallet who wants to receive the coins.
It is empowered by an anti-bruteforce attack system and a jobs queue built on Redis.
It is also possible to see a documentation for the available APIs at /api.
Server: NestJS, Node.js, Redis and Swagger
Benchmark: Python
To run this project you need to create a .env file. You can copy the example file by typing:
cp .env.example .env
Then, you should edit the variables. Their explaination follows:
FAUCET_MNEMONIC
Faucet mnemonic used for transaction signing
FAUCET_ADDRESS
Faucet address used for transaction
ADDRESS_PREFIX
Address prefix used for receiver address validation
RPC_URL
Link to Bitsong RPC API
NODE_PORT
Node port used by server instance
QUEUE_MAX_JOBS
The maximum number of items in the queue
QUEUE_DURATION
The maximum duration of a queued job
THROTTLER_TTL
The maximum duration of each throttle
THROTTLER_LIMIT
The number of times an endpoint can be called from the same ip address in a TTL
REDIS_HOST
Redis server hostname
REDIS_PORT
Redis server port
Clone the project
git clone https://github.com/bitsongofficial/bitsong-faucet.gitGo to the project directory
cd bitsong-faucetInstall dependencies
pnpm iOr you can use:
npm iStart docker container (Redis):
docker-compose up -dStart the server on dev mode:
pnpm start:devStart the server on debug mode:
pnpm start:debugStart the server on prod mode:
pnpm start:prodMoreover if you want to start docker service and Node.js server on debug mode, you can use:
start:debug-dockerBuild the server for production:
pnpm buildCreate a virtual enviroment on python:
python3 -m venv benchmark/envActive the virtual enviroment:
source benchmark/env/bin/activateInstall dependencies:
pip3 install -r benchmark/requirements.txtRun the benchmark:
python3 benchmark/main.py-
Angelo Recca@angelorc -
Giorgio Nocera@Giorgionocera -
Davide Segullo@DavideSegullo
For support, email [email protected] or join our Discord.
Copyright © 2022 BitSong.
This project is licensed by MIT License.