[](https://pkg.go.dev/github.com/synapsecns/sanguine/agents)
[](https://goreportcard.com/report/github.com/synapsecns/sanguine/agents)
[](https://github.com/synapsecns/sanguine/pkgs/container/sanguine%2Fagents)
# 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:
```bash
cd agents
go test -v ./...
```
To run an individual suite (for example, `TestExecutorSuite`):
```bash
cd agents/executor
go test -v
```
To run an individual test (for example, `TestVerifyState`):
```bash
cd agents/executor
go test -v -run TestExecutorSuite/TestVerifyState
```