Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metamyth hw #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions hello_world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Hello world

This module contains the ABCI Hello World service for an AEA. It implements an ABCI application for a simple demonstration.
83 changes: 83 additions & 0 deletions hello_world/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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'
license: Apache-2.0
fingerprint:
README.md: bafybeiapubcoersqnsnh3acia5hd7otzt7kjxekr6gkbrlumv6tkajl6jm
fingerprint_ignore_patterns: []
agent: valory/hello_world:0.1.0:bafybeibggquyaeowolu276nhjkjm2qo6keghsqld4tqm7oy7hh2aoi7ydm
number_of_agents: 4
deployment: {}
---
extra:
benchmark_persistence_params:
args: &id002
log_dir: ${LOG_DIR:str:/benchmarks}
params_args:
args:
setup: &id001
all_participants: ${ALL_PARTICIPANTS:list:["0x0000000000000000000000000000000000000000"]}
safe_contract_address: ${SAFE_CONTRACT_ADDRESS:str:0x0000000000000000000000000000000000000000}
consensus_threshold: ${CONSENSUS_THRESHOLD:int:null}
public_id: valory/hello_world_abci:0.1.0
type: skill
0:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_0:str:HELLO_WORLD! (from Agent 0)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
1:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_1:str:HELLO_WORLD! (from Agent 1)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
2:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_2:str:HELLO_WORLD! (from Agent 2)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
3:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_3:str:HELLO_WORLD! (from Agent 3)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
---
public_id: valory/ledger:0.19.0
type: connection
config:
ledger_apis:
ethereum:
address: ${LEDGER_RPC:str:http://localhost:8545}
chain_id: ${CHAIN_ID:int:31337}
poa_chain: ${IS_POA_CHAIN:bool:false}
default_gas_price_strategy: ${DEFAULT_GAS_PRICE_STRATEGY:str:eip1559}
3 changes: 3 additions & 0 deletions hello_world_service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Hello world

This module contains the ABCI Hello World service for an AEA. It implements an ABCI application for a simple demonstration.
83 changes: 83 additions & 0 deletions hello_world_service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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'
license: Apache-2.0
fingerprint:
README.md: bafybeiapubcoersqnsnh3acia5hd7otzt7kjxekr6gkbrlumv6tkajl6jm
fingerprint_ignore_patterns: []
agent: valory/hello_world:0.1.0:bafybeihtmp45mbfs5tyzrgxfoimh552on6dif42ifqidifait3ej2m5zvq
number_of_agents: 4
deployment: {}
---
extra:
benchmark_persistence_params:
args: &id002
log_dir: ${LOG_DIR:str:/benchmarks}
params_args:
args:
setup: &id001
all_participants: ${ALL_PARTICIPANTS:list:["0x0000000000000000000000000000000000000000"]}
safe_contract_address: ${SAFE_CONTRACT_ADDRESS:str:0x0000000000000000000000000000000000000000}
consensus_threshold: ${CONSENSUS_THRESHOLD:int:null}
public_id: valory/hello_world_abci:0.1.0
type: skill
0:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_0:str:HELLO_WORLD! (from Agent 0)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
1:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_1:str:HELLO_WORLD! (from Agent 1)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
2:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_2:str:HELLO_WORLD! (from Agent 2)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
3:
models:
params:
args:
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:null}
share_tm_config_on_startup: ${SHARE_TM_CONFIG_ON_STARTUP:bool:false}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
setup: *id001
hello_world_message: ${HELLO_WORLD_STRING_3:str:HELLO_WORLD! (from Agent 3)}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:10}
benchmark_tool:
args: *id002
---
public_id: valory/ledger:0.19.0
type: connection
config:
ledger_apis:
ethereum:
address: ${LEDGER_RPC:str:http://localhost:8545}
chain_id: ${CHAIN_ID:int:31337}
poa_chain: ${IS_POA_CHAIN:bool:false}
default_gas_price_strategy: ${DEFAULT_GAS_PRICE_STRATEGY:str:eip1559}
6 changes: 3 additions & 3 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"dev": {
"skill/valory/hello_world_abci/0.1.0": "bafybeiebittgfcz4idj633fkrvu6qle2ajekdjxpp7slggyur7vv7s7hrq",
"agent/valory/hello_world/0.1.0": "bafybeihtmp45mbfs5tyzrgxfoimh552on6dif42ifqidifait3ej2m5zvq",
"service/valory/hello_world/0.1.0": "bafybeihl6j7ihkytk4t4ca2ffhctpzydwi6r4a354ubjasttuv2pw4oaci"
"skill/valory/hello_world_abci/0.1.0": "bafybeidb6mnutwhryno4najzno6meyuojrafg5gpmqmj2a5zesvllglf6a",
"agent/valory/hello_world/0.1.0": "bafybeibggquyaeowolu276nhjkjm2qo6keghsqld4tqm7oy7hh2aoi7ydm",
"service/valory/hello_world/0.1.0": "bafybeiawomsquuzgjv637goffrfhfhhgjgyyqehv6ftguzrmwa4zuckdfe"
},
"third_party": {
"protocol/valory/acn/1.1.0": "bafybeidluaoeakae3exseupaea4i3yvvk5vivyt227xshjlffywwxzcxqe",
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/agents/hello_world/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protocols:
skills:
- valory/abstract_abci:0.1.0:bafybeicr24cgdovqdp4bh25bpun77v7u33maydwuxwled3tuhyiaepw5gu
- valory/abstract_round_abci:0.1.0:bafybeia6lemk5s64f26qjnd2746s5mufpzxuaf5frsqhfbr62kk3ma6sp4
- valory/hello_world_abci:0.1.0:bafybeiebittgfcz4idj633fkrvu6qle2ajekdjxpp7slggyur7vv7s7hrq
- valory/hello_world_abci:0.1.0:bafybeidb6mnutwhryno4najzno6meyuojrafg5gpmqmj2a5zesvllglf6a
default_ledger: ethereum
required_ledgers:
- ethereum
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/hello_world/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeiapubcoersqnsnh3acia5hd7otzt7kjxekr6gkbrlumv6tkajl6jm
fingerprint_ignore_patterns: []
agent: valory/hello_world:0.1.0:bafybeihtmp45mbfs5tyzrgxfoimh552on6dif42ifqidifait3ej2m5zvq
agent: valory/hello_world:0.1.0:bafybeibggquyaeowolu276nhjkjm2qo6keghsqld4tqm7oy7hh2aoi7ydm
number_of_agents: 4
deployment: {}
---
Expand Down
3 changes: 3 additions & 0 deletions packages/valory/skills/hello_world_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def async_act(self) -> Generator:
message = self.params.hello_world_string
else:
message = ":|"

owner_address = self.params.owner
print(f"owner_address={owner_address}")

printed_message = f"Agent {self.context.agent_name} (address {self.context.agent_address}) in period {self.synchronized_data.period_count} says: {message}"

Expand Down
1 change: 1 addition & 0 deletions packages/valory/skills/hello_world_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class HelloWorldParams(BaseParams):
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize the parameters."""
self.hello_world_string: str = self._ensure("hello_world_message", kwargs, str)
self.owner: str = self._ensure("owner_address", kwargs, str)
super().__init__(*args, **kwargs)


Expand Down
5 changes: 3 additions & 2 deletions packages/valory/skills/hello_world_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ aea_version: '>=1.0.0, <2.0.0'
fingerprint:
README.md: bafybeidrjtykhovnccj3sovugdn4r3tszuzv7h37vta6o35epi5qfzdpke
__init__.py: bafybeibiblks3d3s3ditug4hfzl3ob3cibokcz4ofs7cbbsbqw5zzbtd3m
behaviours.py: bafybeiaai23italbrtlgpl7ie4pelhtrm6uqn773qap6jl5h4mj7fd553e
behaviours.py: bafybeiffzzltozv33qxjkhppvbpthty5axwwvjwpjjhnk6g2n7sfmayxiq
dialogues.py: bafybeigabhaykiyzbluu4mk6bbrmqhzld2kyp32pg24bvjmzrrb74einwm
fsm_specification.yaml: bafybeibsjhlpuigtbmtcusv4qrtebal23ylv2sulj6dolvln6fwlkjp23a
handlers.py: bafybeieyq37quymqq6md3hi5bvynifnkx73bcvmzct6difyvdkbzj6abaq
models.py: bafybeifyc3dezez4wbyexuy7q4do2xwlfrvtcvwsxgvg5cldeyvyi6ofju
models.py: bafybeidlwfoeolpdi4t6ssnxec7qfpi6kuviw2svxmazqizu6buf5nsd6m
payloads.py: bafybeiajaxhepvqsznhgadw24w4zumfpxcqysv7y4mdsnh5awvtvirpb3q
rounds.py: bafybeidxkjo6us24fj46fwfxopbbd3njystt4nuqmgpvrmigestr36tkou
tests/__init__.py: bafybeibpuwe63mjjwnaanx7wdw63reh6qa5xdtjxdf75o3nksvjercte4y
Expand Down Expand Up @@ -97,6 +97,7 @@ models:
version: {}
voting_power: '10'
hello_world_message: HELLO_WORLD!
owner_address: '0x1234567890abcdef1234567890abcdef12345678'
keeper_timeout: 30.0
max_attempts: 10
max_healthcheck: 120
Expand Down