Skip to main content

Service Creation (~ 5 min)

Services FAQ

Visit the Service FAQ for more information about interacting with Services.

Table of Contents

Introduction

This page will walk you through creating an onchain Service.

To learn more about what a Service is, or how it works, see the Protocol Documentation.

Prerequisites

  1. Install the pocketd CLI.
  2. Create and fund a new account before you begin.

How do I create a new service?

Service Limitations

Service IDs are limited to 42 chars and descriptions are limited to 169 chars.

1. Add a Service

Use the add-service command to create a new service like so:

pocketd tx service add-service \
${SERVICE_ID} "${SERVICE_DESCRIPTION}" ${COMPUTE_UNITS_PER_RELAY} \
--fees 300upokt --from ${SERVICE_OWNER} --network=beta

For example, assuming you have an account with the name USER(pocketdkeysshowUSER (`pocketd keys show USER -a`), you can run the following for Beta TestNet:

pocketd tx service add-service \
"svc-$USER" "service description for $USER" 13 \
--fees 300upokt --from $USER \
--network=beta

2. Query for the Service

Query for your service on the next block:

pocketd query service show-service ${SERVICE_ID}

For example:

pocketd query service show-service "svc-$USER" \
--network=beta --output json | jq

3. What do I do next?

TODO(@olshansk): Coming soon...

How do I update an existing service's compute_units_per_relay?

Use the add-service command to modify the compute_units_per_relay for an existing service.

Provide the SERVICE_ID of the Service you want to update, but with a new value for COMPUTE_UNITS_PER_RELAY.

pocketd tx service add-service \
${SERVICE_ID} "${SERVICE_DESCRIPTION}" ${NEW_COMPUTE_UNITS_PER_RELAY} \
--fees 300upokt --from ${SERVICE_OWNER} --network=beta

For example:

pocketd tx service add-service \
"svc-$USER" "service description for $USER" 20 \
--fees 300upokt --from $USER \
--network=beta