Skip to content

Commit 4c46384

Browse files
authored
Doc: Update guardian doc (#4427)
* Doc: Update guardian doc * Doc: Code review rework
1 parent cce052c commit 4c46384

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

docs/guardian.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ Each watcher listens to one chain, and there are a number of different watcher t
1919
mechanism to listen for new logs from the Wormhole core contract as well as the latest blocks. Additionally, it polls for
2020
new finalized and safe blocks (as supported on each chain).
2121

22-
2. Solana - the Solana watcher monitors a Solana runtime based chain, namely Solana and Pyth. It uses the `solana-go` library.
23-
For each chain, there are two watchers, one listening for new confirmed slots, and one listening for new finalized slots.
24-
For Pyth, it uses a web socket subscription to listen for messages. For Solana, it polls for slots.
22+
2. Solana - the Solana watcher monitors SVM based chains, namely Solana, Pyth and Fogo. It uses the `solana-go` library.
23+
For each chain, there are two watchers, one listening for confirmed observations, and one listening for finalized observations.
24+
25+
- For Solana, it polls for slots and searches for Wormhole transactions in all slots since the previous one.
26+
- For Pyth, it uses a web socket subscription to listen for messages.
27+
- For Fogo, it polls for any transactions involving the core contract since the previous one.
2528

2629
3. Cosmwasm - the Cosmwasm watcher connects to the various Cosmwasm chains (one chain per watcher instance). It subscribes
2730
for events from the Wormhole core contract and polls for new blocks.
@@ -83,6 +86,41 @@ for things like the status of a given VAA.
8386

8487
For a list of the guardian public RPC endpoints see `PublicRPCEndpoints` in [sdk/mainnet_consts.go](../sdk/mainnet_consts.go)
8588

89+
### Guardian Key Management
90+
91+
Originally, the guardian signing key had to be stored in an armored file on local disk. The guardian signer feature added support
92+
for other signing methods, including the existing armored file and Amazon KMS. The interface is generic, meaning that additional
93+
signing techniques may be added going forward.
94+
95+
To enable a custom signer, use the `guardianSignerUri` config parameter.
96+
97+
### Alternate Publishing
98+
99+
The guardian supports the ability to publish observations to one or more configured HTTP endpoints. This is in addition to publishing
100+
over P2P. This feature is described in more detail [here](../node/pkg/altpub/README.md).
101+
102+
### Transfer Verification
103+
104+
The guardian supports the ability to verify that transfers are valid. This feature is currently supported for certain EVM chains and Sui.
105+
106+
The verifier can be run as a stand alone monitoring tool as described [here](../node/cmd/txverifier/README.md). Or it can be enabled in the
107+
guardian. In that case, suspect transfers will be blocked, meaning the observation will not be published. For more information on this mode,
108+
see [here](../node/pkg/txverifier//README.md).
109+
110+
### Logs and Metrics
111+
112+
The guardian uses the [Zap logger](https://pkg.go.dev/go.uber.org/zap) for all of its logging
113+
and [Prometheus](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus) for metrics.
114+
The logs are always written to local disk and the metrics are always available locally on the box.
115+
116+
The guardian can also be configured to publish logs to Grafana. To enable this, set the `telemetryLokiURL`
117+
config parameter to point at a Grafana endpoint. In this mode, it still logs to local disk, but it
118+
also publishes to Grafana in a non-blocking manner.
119+
120+
The guardian can also be configured to publish metrics to Grafana. To enable this, set the `promRemoteURL`
121+
config parameter to point at a Grafana endpoint. In this mode, metrics will be posted to Grafana every
122+
fifteen seconds, also in a non-blocking manner.
123+
86124
## Observation Lifecycle
87125

88126
An observation transitions through the following steps:

0 commit comments

Comments
 (0)