GBS is a lightweight REST API core for P2P transactions, designed to support multiple clients and plugins via built-in user authentication. The core idea is that user permissions and credentials can be leveraged to easily develop various plugins that seamlessly integrate with the system.
- Install Docker on your system if you haven't already.
- Make sure that database settings in config.json are the same as in docker-compose.yml.
- Run the application with Docker Compose:
docker compose up -d
- Start PostgreSQL and ensure that the
config.jsonfile contains the correct database credentials. - Run the application manually:
go run cmd/app/main.go
On the first launch, the system automatically generates passwords for four default users and prints them to the console: Default users:
- adm → root user with full privileges
- fees → receives all transaction fees
- money_printer → has permission to print new money
- registration → handles user signups when direct registration is disabled
After the server is running and default users are created, you can interact with the API using the generated credentials.
Here’s a simple example of how to authenticate and call a protected endpoint using curl:
# Log in with one of the default users (e.g., adm)
curl -X POST http://localhost:8080/api/v1/login \\
-H "Content-Type: application/json" \\
-d '{"username": "adm", "password": "<generated_password>"}'This will return a JSON response with an authentication token:
{
"token": "abc.def.ghi",
"token_expiry": "5m",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token_expiry": "24h"
}You can then use this token to access other protected endpoints:
curl -X GET http://localhost:8080/api/v1/getBalances?id=1 \\
-H "Authorization: Bearer <your_token_here>"This will return the balance data for the user with ID 1.
- Add webhook support
- Add oauth2
- Add cache
- Add v2 api with much better endpoints than v1