Crynux Bridge
Deploy Crynux Bridge for Applications
Crynux Bridge is middleware that connects traditional applications to the Crynux Network. It simplifies using the Crynux Network for applications by handling all complex interactions with the Crynux Network. The application only needs to interact with the Crynux Bridge by sending task parameters and waiting for the result images or texts.
More specifically, the Crynux Bridge:
Manages the application wallet, signs the underlying transactions and API requests.
Interacts with the blockchain and Relay to execute the entire task workflow.
Provides simpler APIs to the application to execute tasks using only the task parameters(no blockchain transactions or signatures).
This document provides a step-by-step guide to deploy the Crynux Bridge and connect it to your application.
Get the Docker Compose Files
The Docker Compose files are located in the build
folder of the Crynux Bridge project:
Download the folder to the deployment server, or clone the whole project:
Application Wallet Configuration
The application wallet's private key will be loaded from a file in the build folder and stored as Docker secrets. For security, this file can be deleted once the container is created. Ensure to back up the private key, as it will be required again if the container needs to be recreated.
Create a file named privkey.txt
and paste the private key into the file. The private key should be a hex string prefixed with 0x
.
Database Configuration
Crynux Bridge relies on a database to store data. A MySQL instance is configured in the Docker Compose file by default.
If the default configuration meets your needs, no further action is required. If you need to use another database instance, remove the service section of MySQL in the docker-compose.yml
file, and modify config/config.yml
to use another database instance:
Start the Docker Container
In the build folder, run the following command to start the containers:
Use the Crynux Bridge APIs
The application can utilize the APIs of the Crynux Bridge to send tasks and receive results. The description of the APIs can be accessed as the OpenAPI Specification on the started Crynux Bridge instance. Assume the IP address of the instance is 192.168.1.2, the JSON schema of the specification can be accessed at:
And a human readable documentation can be accessed at:
As an example, the URLs of the Crynux Bridge used by the showcase applications online are:
API List
Last updated