Crynux Bridge
Deploy Crynux Bridge for Applications
Last updated
Deploy Crynux Bridge for Applications
Last updated
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).
Check out this simple webpage that lets users create images from text prompts. Tasks are sent to the Crynux Bridge API, and the generated image is returned:
The next sections provide step-by-step guide to deploy the Crynux Bridge and connect it to your application.
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:
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
.
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:
In the build folder, run the following command to start the containers:
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: