SafeTrust is a decentralized platform designed to revolutionize P2P transactions, providing secure deposits and payments powered by blockchain and trustless technologies. 🌐✨ Experience transparency and reliability in every cryptocurrency transaction. 💸🔒
🔐 Trustless Technology: Secure and block deposits without intermediaries.
💾 Blockchain-Powered Transparency: Immutable, auditable, and verifiable transactions.
💱 Crypto-Payment Support: Manage cryptocurrency payments safely and efficiently.
✅ Automated Refunds: Streamlined processes ensure refunds and payment releases happen automatically.
🛠️ Trustless Escrow:
Funds are securely held in blockchain-based escrow accounts until all terms are met.
🔎 Blockchain Transparency:
Every transaction is logged on the blockchain for full visibility and accountability. 📜
💰 Crypto Payments:
Supports irreversible and secure cryptocurrency payments while reducing risks of fraud or disputes.
🔗 Trustline Process:
Verified trustlines between parties add an extra layer of transaction security. 🔒
📤 Automated Refund System:
Ensures funds are automatically released based on the terms of the agreement, with no manual intervention required.
- Install Docker and Docker Compose
- Copy the environment file and fill in the required values:
cp .env.example .env- Start the containers:
bin/dc_prep
bin/dc_consoleThe metadata folder contains the Hasura GraphQL Engine configuration per tenant.
backend/
└── metadata/
└── base/
│ ├── actions.graphql
│ ├── actions.yaml
│ ├── allow_list.yaml
│ ├── api_limits.yaml
│ ├── backend_configs.yaml
│ ├── cron_triggers.yaml
│ ├── graphql_schema_introspection.yaml
│ ├── inherited_roles.yaml
│ ├── metrics_config.yaml
│ ├── network.yaml
│ ├── opentelemetry.yaml
│ ├── query_collections.yaml
│ ├── remote_schemas.yaml
│ ├── rest_endpoints.yaml
│ └── version.yaml
└── build/
│ └── tenant_a/
│ └── tenant_b/
│ └── ...
└── tenants/
│ └── tenant_a/
│ │ ├── databases/
│ │ ├── tables/
│ │ ├── functions/
│ │ └── databases.yaml
│ └── tenant_b/
│ │ ├── databases/
│ │ ├── tables/
│ │ ├── functions/
│ │ └── databases.yaml
│ └── ...
├── build-metadata.sh
├── deploy-tenant.sh
└── setup-tenant.sh
Folder guide:
base/— Hasura base configuration and GraphQL dependencies shared across all tenantsbuild/— Generated output: tenants merged with base dependencies, ready to deploytenants/— Tenant-specific database files, tables, functions, relations, and triggersbuild-metadata.sh— Prepares a tenant by merging it with base configurationsdeploy-tenant.sh— Deploys a built tenant to Hasura (tracks tables and relationships)setup-tenant.sh— Runs both steps above in one command ✅
Go to the metadata/ directory and run:
./setup-tenant.sh <tenant_name> [--admin-secret SECRET] [--endpoint URL]Example:
./setup-tenant.sh safetrust --endpoint http://localhost:8080This runs build-metadata.sh followed by deploy-tenant.sh automatically in the correct order.
Default values: --admin-secret myadminsecretkey · --endpoint http://localhost:8080
- Go to the
metadata/directory and build the tenant:
./build-metadata.sh <tenant_name> --admin-secret myadminsecretkey --endpoint <endpoint>-
Verify the
build/folder contains the correct tenant data. -
Deploy the tenant:
./deploy-tenant.sh <tenant_name> --admin-secret myadminsecretkey --endpoint <endpoint>tenant_name— the name of the tenant you will work on (e.g.safetrust)endpoint— the Hasura endpoint, commonlyhttp://localhost:8080
Go to the migrations/ folder:
cd migrations/
hasura migrate applyThen select the tenant to migrate.
Go to the seeds/ folder:
cd seeds/
hasura seed applyThen select the tenant to seed.
This project uses the Karate framework for API testing. Tests run in a Docker environment.
docker compose -f docker-compose-test.yml run --rm --build karateThis command will:
- Build the test container
- Start PostgreSQL and Hasura containers
- Run all Karate tests
- Show test results in the console
- Generate HTML reports in
target/karate-reports/
After running the tests, find the HTML reports at:
- Summary:
tests/results/karate-summary.html - Detailed:
tests/results/karate-tags.html
- Create new
.featurefiles intests/karate/features/ - Follow the Karate DSL syntax
- Tests are automatically picked up when running the test command
- Main config:
tests/karate/src/test/resources/karate-config.js - Database config:
docker-compose-test.yml - Test environment:
Dockerfile.test