{"id":13653921,"url":"https://github.com/valory-xyz/open-acn","last_synced_at":"2026-01-17T08:54:32.201Z","repository":{"id":43117688,"uuid":"452694292","full_name":"valory-xyz/open-acn","owner":"valory-xyz","description":"Open Agent Communication Network - Fork of acn on fetchai/agents-aea","archived":false,"fork":false,"pushed_at":"2023-09-29T08:28:16.000Z","size":13796,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-10T04:36:38.512Z","etag":null,"topics":["agent-communication","dht","multi-agent-systems"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valory-xyz.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-27T13:31:02.000Z","updated_at":"2024-04-24T04:13:45.000Z","dependencies_parsed_at":"2023-09-29T11:01:41.077Z","dependency_job_id":null,"html_url":"https://github.com/valory-xyz/open-acn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valory-xyz%2Fopen-acn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valory-xyz%2Fopen-acn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valory-xyz%2Fopen-acn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valory-xyz%2Fopen-acn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valory-xyz","download_url":"https://codeload.github.com/valory-xyz/open-acn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250385336,"owners_count":21421901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-communication","dht","multi-agent-systems"],"created_at":"2024-08-02T02:01:20.776Z","updated_at":"2026-01-17T08:54:32.186Z","avatar_url":"https://github.com/valory-xyz.png","language":"Go","funding_links":[],"categories":["Relevant Links"],"sub_categories":["open-acn (Agent Communication Network)"],"readme":"\nThe `libp2p_node` is an integral part of the ACN.\n\n## ACN - Agent Communication Network\n\nThe agent communication network (ACN) provides a system for [agents](https://github.com/valory-xyz/open-aea) \nto find each other and communicate, solely based on their wallet addresses. \nIt addresses the message delivery problem.\n\nFor more details check out the [docs](https://stack.olas.network/open-aea/acn/).\n\n## Development\n\nTo run all tests run:\n\n``` bash\nmake test\n```\n\nTo lint:\n\n``` bash\nmake lint\n```\n\nFor mocks generation:\ncheck https://github.com/golang/mock\n\n## Messaging patterns\n\nInteraction protocol\n___\nACN\n___\nTCP/UDP/...\n___\n\n### Messaging patterns inwards ACN:\n\n\nConnection (`p2p_libp2p_client`) \u003e Delegate Client \u003e Relay Peer \u003e Peer (Discouraged!)\n\nConnection (`p2p_libp2p_client`)  \u003e Delegate Client \u003e Peer\n\nConnection (`p2p_libp2p`) \u003e Relay Peer \u003e Peer\n\nConnection (`p2p_libp2p`) \u003e Peer\n\n\n### Messaging patterns outwards ACN\n\n\nPeer \u003e Relay Peer \u003e Delegate Client \u003e Connection (`p2p_libp2p_client`) (Discouraged!)\n\nPeer \u003e Relay Peer \u003e Connection (`p2p_libp2p`)\n\nPeer \u003e Delegate Client \u003e Connection (`p2p_libp2p_client`)\n\nPeer \u003e Connection (`p2p_libp2p`)\n\n\nIn total 4*4 = 16 patterns (practically: 3*3 = 9 patterns)\n\n## Guarantees\n\nACN should guarantee total ordering of messages for all agent pairs, independent of the type of connection and ACN messaging pattern used.\n\n## Advanced feature (post `v1`):\n\nFurthermore, there is the agent mobility. An agent can move between entry-points (Relay Peer/Peer/Delegate Client). The ACN must ensure that all messaging patterns maintain total ordering of messages for agent pairs during the move.\n\n## ACN protocols\n\nThe ACN has the following protocols:\n\n- register\n- lookup\n- unregister (dealt with by DHT defaults)\n- DHT default protocols in libp2p\n- message delivery protocol\n\n## Dockerfile\n\n\n#### Key and peerID generation\nWe need a private key (secp256k1), which can be generated using the\n[go-libp2p-core crypto package](https://pkg.go.dev/github.com/libp2p/go-libp2p-core/crypto#GenerateSecp256k1Key)\nFrom this a PeerID can be derived using the\n[go-libp2p-core peer package](https://pkg.go.dev/github.com/libp2p/go-libp2p-core/peer)\n\n\n#### Example: starting up a boostrap (genesis) node on a local network\n**This key should be used for testing purposes only!**\n```bash\nprivate key: 54562eb807d2f80df8151db0a394cac72e16435a5f64275c277cae70308e8b24\npublic key:  037ed15dcee3a317e590cbdd28768ad8e2d29960b3e5d4eccca14bc94f83747f09\nPeerID:      16Uiu2HAmA3cBbvMtLjqnkmoLBFuzmsVYnGfNLvr5Ws3Ey7JeRFAa\n```\n\nThese can be passed using an environment variables file (`.boostrap_node`):\n```bash\nAEA_P2P_ID=54562eb807d2f80df8151db0a394cac72e16435a5f64275c277cae70308e8b24\nAEA_P2P_URI=0.0.0.0:9000\nAEA_P2P_URI_PUBLIC=0.0.0.0:10000\nAEA_P2P_DELEGATE_URI=0.0.0.0:11000\nAEA_P2P_URI_MONITORING=0.0.0.0:8080\n```\n\nthen the boostrap node can be started as follows: \n```bash\ndocker run --network=host --env-file .bootstrap_node -it valory/open-acn-node:latest --config-from-env\n```\n\nThe expected output should look as follows:\n```bash\nWARNING: Published ports are discarded when using host network mode\n10:41:19.319 DBG node/aea/api.go:184 \u003e env_file: .acn_config package=AeaApi\n10:41:19.320 DBG node/aea/api.go:216 \u003e msgin_path:  package=AeaApi\n10:41:19.320 DBG node/aea/api.go:217 \u003e msgout_path:  package=AeaApi\n10:41:19.320 DBG node/aea/api.go:218 \u003e id: 54562eb807d2f80df8151db0a394cac72e16435a5f64275c277cae70308e8b24 package=AeaApi\n10:41:19.320 DBG node/aea/api.go:219 \u003e addr:  package=AeaApi\n10:41:19.320 DBG node/aea/api.go:220 \u003e entry_peers:  package=AeaApi\n10:41:19.320 DBG node/aea/api.go:221 \u003e uri: 0.0.0.0:9000 package=AeaApi\n10:41:19.320 DBG node/aea/api.go:222 \u003e uri public: 0.0.0.0:10000 package=AeaApi\n10:41:19.320 DBG node/aea/api.go:223 \u003e uri delegate service: 0.0.0.0:11000 package=AeaApi\n2022-09-28T10:41:19.320547746Z INF node/libp2p_node.go:67 \u003e successfully initialized API to AEA!\n2022-09-28T10:41:19.340368199Z INF node/dht/dhtpeer/dhtpeer.go:317 \u003e My Peer ID is 16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340423964Z INF node/dht/dhtpeer/dhtpeer.go:319 \u003e successfully created libp2p node! package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340509775Z DBG node/dht/dhtpeer/dhtpeer.go:329 \u003e Setting /aea-register/0.1.0 stream... package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340532593Z INF node/dht/dhtpeer/dhtpeer.go:465 \u003e Load records from store ./agent_records_store_16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340612489Z INF node/dht/dhtpeer/dhtpeer.go:375 \u003e successfully loaded 0 agents package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340630719Z DBG node/dht/dhtpeer/dhtpeer.go:398 \u003e Setting /aea-address/0.1.0 stream... package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340646646Z DBG node/dht/dhtpeer/dhtpeer.go:402 \u003e Setting /aea/0.1.0 stream... package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.34068517Z INF node/dht/dhtpeer/dhtpeer.go:802 \u003e DelegateService listening for new connections... package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.340715804Z INF node/dht/dhtpeer/dhtpeer.go:532 \u003e Starting monitoring service: Prometheus at 8080 package=DHTPeer peerid=16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n2022-09-28T10:41:19.34073922Z INF node/libp2p_node.go:148 \u003e Peer ID: 16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\nMULTIADDRS_LIST_START\n/dns4/0.0.0.0/tcp/10000/p2p/16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\nMULTIADDRS_LIST_END\n```\n\n#### Example: adding an entry peer on a local network\n\nWe create an environment variables file (`.entry_node`), containing the genesis node maddr as the entry point:\n```bash\nAEA_P2P_ID=f4261323cf7c42f4e5113fad6bd30c9ea71d0dbe4f34f72217e18c703cda4011\nAEA_P2P_URI=0.0.0.0:9001\nAEA_P2P_URI_PUBLIC=0.0.0.0:10001\nAEA_P2P_DELEGATE_URI=0.0.0.0:11001\nAEA_P2P_URI_MONITORING=0.0.0.0:8081\nAEA_P2P_ENTRY_URIS=/dns4/0.0.0.0/tcp/9000/p2p/16Uiu2HAmMC2tJMRaRTeWSESv8mArbq6jipJCD4adSBcBLsbc7cSL\n```\n\nWith the bootstrap node running in a different terminal, we can start the entry node:\n```bash\ndocker run --network=host --env-file .entry_node -it valory/open-acn-node:latest --config-from-env\n```\n\nThe output one may expect is similar to that of starting up the bootstrap node.\nNote that if you're not using a local network the correct port exposure and forwarding should be set.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalory-xyz%2Fopen-acn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalory-xyz%2Fopen-acn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalory-xyz%2Fopen-acn/lists"}