gOuroboros examples
The gOuroboros repository includes runnable programs that demonstrate how Go applications connect to Cardano nodes and use Ouroboros mini-protocols. This page includes a docs snapshot based on the examples from gOuroboros v0.211.0, with corrections listed in the bundle README.
Download all examples or browse the versioned source files on GitHub.
| Example | Demonstrates |
|---|---|
| block-fetch | Fetch a block by slot and hash from a node. |
| chain-sync | Synchronize blocks and headers, with optional block fetching and range queries. |
| chain-tip | Read and display the current chain tip. |
| peer-sharing | Request peers through the peer-sharing mini-protocol. |
| ping | Measure node connection and ChainSync response times. |
| state-query | Query ledger state from a local node. |
| tx-monitor | Monitor transactions in the node’s local mempool. |
| tx-submission | Submit a transaction to a local node. |
The examples are Go programs in the gOuroboros module. Follow the environment and connection settings in each source file, and use the module’s API documentation for additional package details.