# Create a service with an existing agent

The typical use case that this guide intends to illustrate is where a service owner wants to use existing agents to run its own service with a custom configuration. For example, an oracle service customized to serve data of their interest.

## What you will learn

In this guide, you will learn how to:

• Create a service configuration using an already available agent on the IPFS.
• Test the service using a local deployment.
• Publish the service on the IPFS.
• Register the service in the on-chain protocol. We will be using the Görli testnet.
• Deploy the registered service.

If you recall the overview of the development process, this roughly consists in steps 4, 5, and 6. For illustration purposes, we will also be using the agents from the Hello World agent service and we will create a new (but functionally equivalent) "Hello World 2 agent service".

Before starting this guide, ensure that your machine satisfies the framework requirements and that you have followed the set up guide. As a result you should have a Pipenv workspace folder.

## Step-by-step instructions

To create a service with an existing agent published on a local or remote repository you need to identify the public ID and the package hash of the agent. It can be some agent that you have developed, or you can reuse an existing agent from a repository. You can browse the list of default packages of the Open Autonomy framework available on the default remote IPFS registry. For this example, we consider the hello_world agent, whose public ID and hash are

valory/hello_world:0.1.0:bafybeicealdcbxjdejskntddizntwqmlpyxa2ujaxnw2cgy73x3swldwcq


You can view the agent contents stored in the IPFS here.

Note

Future releases of the Open Autonomy framework will provide convenient commands to browse and discover existing registered components. For now, we assume that we already know the IPFS hash of the agent.

1. Define the service. Create an empty folder with the service name. Inside that folder, create:

• a README.md file, where you can write a description of the service, and
• a service configuration file service.yaml, where you will indicate the IPFS hash of the agent.
mkdir <service_name>
cd <service_name>
touch service.yaml

Example of a service configuration file service.yaml

The service configuration file service.yaml is where the parameters of the agent service are defined, including the particular agent that composes the service. Below you can find an exampe for the Hello World agent service. You can read the service configuration file section to understand its structure.

name: hello_world
author: valory
version: 0.1.0
description: A simple demonstration of a simple ABCI application
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
fingerprint_ignore_patterns: []
agent: valory/hello_world:0.1.0:bafybeihqzkncz7r563lfkots4fphb7abdymdna4ir7in7fsbzjtx6yyndq
number_of_agents: 4
---
extra:
benchmark_persistence_params:
args: &id001
log_dir: /benchmarks
overide_type: multiple
public_id: valory/hello_world_abci:0.1.0
type: skill
0:
models:
params:
args:
hello_world_message: ${SERVICE_HELLO_WORLD_HELLO_WORLD_STRING:str:HELLO_WORLD!} benchmark_tool: args: *id001 1: models: params: args: hello_world_message:${SERVICE_HELLO_WORLD_HELLO_WORLD_STRING:str:HELLO_WORLD!}
benchmark_tool:
args: *id001
2:
models:
params:
args:
hello_world_message: ${SERVICE_HELLO_WORLD_HELLO_WORLD_STRING:str:HELLO_WORLD!} benchmark_tool: args: *id001 3: models: params: args: hello_world_message:${SERVICE_HELLO_WORLD_HELLO_WORLD_STRING:str:HELLO_WORLD!}
benchmark_tool:
args: *id001
---
public_id: valory/ledger:0.19.0
type: connection
config:
ledger_apis:
ethereum: