Service Management
Deploy A Service
The aqua remote deploy_service
command allows you to deploy Wasm modules and associate service configuration specifications to some peer, where the command line structure looks like this:
where --addr
is the multiaddr of some relay to connect to the network of choice. Use the --on peerId
option to deploy the service to a peer other than the connection relay.
Note that --config-path
is a path to a service configuration file that includes the path to the Wasm modules.
Consider the following service configuration JSON template:
It is important to note that in a single configuration file, you can specify multiple service configurations, which are called from Aqua with --service-name
flag referencing the respective config name, e.g., service_name
and another_service_name
respectively. For more information see the builtin aqua-lib reference.
--sk secret_key
a secret key that you can get with aqua create_keypair
. It is a required field, cause you cannot manage or delete your service without this key.
Command output:
Here we see that modules are uploading to the node first. Then creating a blueprint. The last line is the most important. Service id will be used for service discovery, management and removal.
Remove A Service
To remove service you need to know the host peer, service id and secret key. If the service location is different from your relay, use the --on peerId
option to provide the required peer location. Since only a service owner is authorized to delete a service, the secret key for the service needs to be provided.
Manual deploy
Deploying a service is a step-by-step process where the script will upload WASM modules, create blueprints and then will create services out of blueprints. You can do it manually to have more control and write your own scripts.
Upload a module to IPFS:
You will get CID of your module. Then you need to add a module from a vault. Right now you can do it with aqua service:
hash
- is a module hash that can be used in blueprint creation.
Create a blueprint:
Blueprint id will be as a result.
Create a service from a blueprint:
Service id will be as a result.
Also, you can create services manually from Aqua language. You can have a close look at these examples and services:
Last updated
Was this helpful?