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
- Run
bin/dc_prep
bin/dc_console
Metadata folder contains the architecture, the database 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
Architecture multitenant guide:
- base/ folder: contains all graphql and hasura dependencies necessary for tenants.
- build/ folder: prepare tenants with all graphql and hasura dependencies.
- tenants/ folder: contains all tenant database files, tables, functions, relations, triggers, etc.
- build-metadata.sh file: prepares the tenants with their dependencies and corresponding configurations.
- deploy-tenant.sh: deploys to the database with the tenants, their tables and relationships.
- Go to the directory called metadata and run the following command:
./build-metadata.sh <tenant_name> --admin-secret myadminsecretkey --endpoint <endpoint>
- Verify build folder contains correct tenant data
- Deploy the tenants running the following command:
./deploy-tenant.sh <tenant_name> --admin-secret myadminsecretkey --endpoint <endpoint>
-
tenant_name is the name of the tenant that you will work on
-
endpoint is the endpoint where you are running the hasura, commonly it's localhost:8080
Go to migrations folder: cd migrations/
hasura migrate apply
Then select the tenant to migrate it !
Go to seeds folder: cd seeds/
hasura seed apply
Then select the tenant to seed it !
This project uses Karate framework for API testing. The tests are designed to run in a Docker environment.
To run all tests:
docker compose -f docker-compose-test.yml run --rm --build karate
This 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, you can find the HTML reports at:
- Summary:
tests/results/karate-summary.html
- Detailed:
tests/results/karate-tags.html
- Create new
.feature
files intests/karate/features/
- Follow the Karate DSL syntax
- Tests will be 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