§ Ayra Trust Network Playground
This document provides instructions for setting up and testing your own Ayra Trust Network playground environment.
This is a DRAFT
§ Prerequisites
- Docker and Docker Compose
- Git
§ Running with Docker
The easiest way to run the playground is using Docker Compose:
-
Clone the repository:
git clone https://github.com/ayraforum/ayra-trust-registry-resources.git cd ayra-trust-registry-resources/playground
-
Start all services using Docker Compose:
docker-compose up -d
-
The following services will be available:
- Ayra: http://localhost:8082
- Ecosystem: http://localhost:8083
- Verifier UI: http://localhost:8501
-
To view logs from any service:
docker-compose logs ayra docker-compose logs ecosystem docker-compose logs verifier
-
To stop all services:
docker-compose down
§ Manual Setup (Alternative to Docker)
If you prefer to run the services without Docker:
§ Prerequisites for Manual Setup
- Go programming language (version 1.15+)
- Python (version 3.7+) with pip installed
§ Step 1: Set up a Sample Ayra Trust Registry
-
Navigate to the
trust-registry
directory:cd trust-registry
-
Initialize the Go modules:
go mod tidy
-
Run the Go program:
go run main.go --port=8082 --registry-name=TR-1
-
You will see a DID generated in the console output. Take note of this as it will be referred to as the Ayra DID.
§ Step 2: Set up a Sample Ecosystem
-
Open a new terminal window
-
Navigate to the
trust-registry
directory:cd trust-registry
-
Run the Go program on a different port:
go run main.go --port=8083 --registry-name=TR-2
-
This creates a second ecosystem running independently of the Ayra Trust Registry.
-
Note the DID generated for this ecosystem, which will be referred to as the Sample Ecosystem DID.
§ Step 3: Set up the Verifier
- Navigate to the verifier directory:
cd ../verifier
- Install the required Python dependencies:
pip install -r requirements.txt
- Launch the Streamlit verification interface:
This will open a web interface in your default browser at http://localhost:8501streamlit run ui.py
§ Working with the Playground
§ Step 1: Authorize an Entry in Your Ecosystem
- Open a web browser and navigate to
http://localhost:8083/admin/docs
- Locate and select the
admin/authorize
API endpoint - Enter the following required parameters:
- Authorization Type: [string that defines the type of authorization]
- EGF Identifier: [identifier for your ecosystem governance framework]
- Entry ID: [unique identifier for the entity being authorized]
- Submit the request
- The entity is now authorized within your sample ecosystem
Note: In production environments, authorization will follow your specific trust framework and governance processes. This is a simplified sample implementation.
§ Step 2: Establish Recognition Between Ecosystems
- Navigate to
http://localhost:8082/admin/docs
in your browser - Locate and select the
/admin/recognition
API endpoint - Enter the following parameters:
- Target Ecosystem: [Sample Ecosystem DID from Step 2]
- EGF DID: [Ayra Ecosystem DID from Step 1]
- Submit the request
Note: In production, this recognition process will be conducted through the formal Ayra Governance Process.
§ Step 3: Test Verification
§ Testing Ecosystem Recognition
- In the Streamlit interface (http://localhost:8501), navigate to the “Ecosystem Recognition” tab
- Complete the form with the following information:
- Recognizing Ecosystem’s DID: [Enter the Ayra DID from Trust Registry 1]
- Ecosystem ID: [Enter the Sample Ecosystem DID from Ecosystem]
- Click “Perform Ecosystem Recognition Query”
- The interface will display the recognition status and details of the trust relationship between the two ecosystems
§ Testing Authorization
- Navigate to the “Authorization” tab in the Streamlit interface
- Complete the form with the following information:
- EGF DID: [Enter the Sample Ecosystem DID from Ecosystem]
- Entity ID: [Enter the authorized entity ID from Step 3]
- Entity Authorization ID: [Enter the authorization type string from Step 3]
- Click “Perform Authorization Query”
- The interface will display the authorization status, confirming whether the specified entity is authorized within the ecosystem
§ Environment Configuration
Both trust registries can be configured using the following environment variables:
PORT
: The port to listen onREGISTRY_NAME
: Name identifier for the registryBASE_URL
: Base URL for service endpoints (including protocol and hostname, with optional port)REGISTRY_PATH
: Path to the registry data fileREGISTRY_DATA
: Registry data as inline JSON/YAML (alternative to using a file)
The verifier can be configured with:
DEFAULT_DID_RESOLVER_URL
: URL for the DID resolver service
§ Important Note on BASE_URL
The BASE_URL
value is used directly for creating DIDs and service endpoints. In Docker Compose, the BASE_URL
should include the container name and port (e.g., http://ayra:8082
). This allows containers to properly communicate with each other within the Docker network.
When running manually, you’ll typically use http://localhost:PORT
as the BASE_URL.
§ Exploring DIDs
To better understand the structure of the DIDs created:
- Visit https://dev.uniresolver.io
- Enter any of the DIDs generated during this setup
- Review the DID document structure and properties
§ Security Notice
The JWT signatures in response messages should be verified to ensure message integrity. The current implementation in this playground environment does not include comprehensive signature verification for demonstration purposes.
§ Troubleshooting
- If using Docker and services fail to start, check logs with
docker-compose logs <service-name>
- Ensure all ports are available (8082, 8083, 8501)
- If running manually, verify that Go and Python dependencies are installed
- Check console output for any error messages that might identify configuration issues
§ Next Steps
After successful testing in the playground environment, review the Ayra Trust Network documentation for production implementation guidelines and best practices.