Skip to content

Latest commit

 

History

History
 
 

agents


Synapse Interchain logo


Go Reference Go Report Card Image

Agents

The Agents are the off-chain components of Synapse Interchain Network. They are responsible for signing, reporting, verifying, and executing messages across chains.

Use

From sanguine/agents, run go run main.go to expose the CLI for all agents. Visit each agents' respective directory's README.md for information on individual agent usage.

Directory Structure

root
├── agents: Contain all the agents used in optimistic messaging
│   ├── agentsintegration: Testing all the agents working together
│   ├── executor: Responsible for verifying and executing cross-chain messages
│   ├── guard: Signs attestations and posts to attestation collector and destination
│   └── notary: Scans origin chains for messages and signs attestations then posts to AttestationCollector
├── cmd: The command line entrypoint for all agents
├── config: Configs for agents
├── contracts: Go interfaces for messaging contracts
├── db: Agents datastore
├── domains: Adapters for each domain
├── indexer: Periodically reads from the db and stores data in the db
├── internal: Dev dependencies
├── testutil: Contains mock deployers for interacting with the mock backend
└── types: Common agents types

Testing Suite

Tests for agents have setup hooks defined in agents/testutil/simulated_backends_suite.go. Any suite that embeds SimulatedBackendsTestSuite will have simulated backend and messaging contract scaffolding for Summit, Origin, and Desination chains. This includes TestExecutorSuite, TestGuardSuite, TestNotarySuite, ExampleAgentSuite, and AgentsIntegrationSuite.

To run all agent tests:

cd agents
go test -v ./...

To run an individual suite (for example, TestExecutorSuite):

cd agents/executor
go test -v

To run an individual test (for example, TestVerifyState):

cd agents/executor
go test -v -run TestExecutorSuite/TestVerifyState