Example of the service
In order to familiarize yourself with the operation of Copper Unlimited Online, the Copper Team has a ready-made containerized example of the service to deploy on your side.
It looks like one more image to deploy together with Copper Unlimited Online and is available on Copper DockerHub.
The application works as follows:
- The application pulls orders in the
working
andawaiting-settlement
statuses using the Copper public API. If there are no orders available, the application enters sleeping mode for 10 seconds. - Then, the application takes the first order, and if it is in the
awaiting-settlement
status, moves it to theworking
status. - After this, it triggers the order signing request to the Copper Unlimited Server.
- The application waits until the request is either in the
completed
orerror
status. - If the request is in
error
status, it fires an error; if it is incompleted
, it repeats the whole process starting from the first point.
To deploy and test the service, perform the following steps:
Configure your docker-compose.yml
Provide shards
Backup your wallet shards and place them in the directory specified as an external volume for the cu-server
container (in the
example: ${PWD}/key-backups/
). Do not forget to activate the created wallets in the desired platform environment and request to
switch the corresponding vaults to hot if it has not been done before.
Configure wallets
The wallets-config.js
file contains details of the shards. Below, you will find an example of the configuration with comments:
Place this file in the directory specified as an external volume for the hot-wallet
container (in the example: ${PWD}/wallets-config.js
).
As per the example, the resulting file composition on this step looks as follows:
Start your service
Start your service with the use of the docker-compose up --build
command.
Create withdrawals and sign
Use the specified environment of the Copper Platform to create withdrawal orders. They will be signed and pushed forward automatically.