A server to relay meta-transactions for the Decentraland ecosystem, enabling users to interact with blockchain services without directly paying gas fees.
- Features
- Dependencies & Related Services
- API Documentation
- Database Schema
- Getting Started
- Testing
- AI Agent Context
- License
- Meta-Transaction Relaying: Relays meta-transactions to the blockchain, allowing users to interact without paying gas fees directly
- Transaction Tracking: Stores and retrieves user transaction history by address
- Transaction Validation: Validates transaction data and Ethereum addresses before processing
This service interacts with the following services or resources:
- Gelato: Meta-transaction relay provider
- PostgreSQL: Database for storing transaction history
- TheGraph: For querying blockchain data
- Ethereum RPC: For blockchain interactions and contract calls
The API is fully documented using the OpenAPI standard. The schema is located at docs/openapi.yaml.
See docs/database-schemas.md for detailed schema, column definitions, and relationships.
Before running this service, ensure you have the following installed:
- Node.js: Version 20.x or higher
- npm: Version 9.x or higher
- Docker & Docker Compose: For running the PostgreSQL database (recommended)
- PostgreSQL: Version 12 or higher (if not using Docker)
- Clone the repository:
git clone https://github.com/decentraland/transactions-server.git
cd transactions-server- Install dependencies:
npm install- Build the project:
npm run buildThe service uses environment variables for configuration.
Create a .env file in the root directory containing the environment variables for the service to run.
Use the .env.default file as a reference for the required variables.
Start the PostgreSQL database using Docker Compose:
docker-compose up -dThis will start a PostgreSQL container with the following configuration:
- Database:
transactions_db - User:
transactions - Password:
transactions - Port:
5432(accessible on localhost)
To verify the database is running:
docker-compose logs postgresUpdate your .env file with the database connection string:
PG_COMPONENT_PSQL_CONNECTION_STRING=postgres://transactions:transactions@localhost:5432/transactions_db
Make sure to set any required API keys (e.g., GELATO_API_KEY) if needed. See .env.defaults for all available configuration options.
Run database migrations to create the required tables:
npm run migrateFor development with hot-reload:
npm run start:watchFor production mode:
npm startThis service includes comprehensive test coverage with both unit and integration tests.
Run all tests with coverage:
npm testRun tests in watch mode:
npm run test:watch- Unit Tests (
test/tests/logic/): Test individual components and functions in isolation - Integration Tests (
test/tests/ports/): Test external service integrations and complete request/response cycles
For detailed testing guidelines and standards, refer to our Testing Standards documentation.
For detailed AI Agent context, see docs/ai-agent-context.md.
This project is licensed under the Apache License 2.0 - see the LICENSE.txt file for details.