@@ -39,6 +39,7 @@ import (
3939 "github.com/blinklabs-io/gouroboros/protocol/localstatequery"
4040 "github.com/blinklabs-io/gouroboros/protocol/localtxmonitor"
4141 "github.com/blinklabs-io/gouroboros/protocol/localtxsubmission"
42+ "github.com/blinklabs-io/gouroboros/protocol/peersharing"
4243 "github.com/blinklabs-io/gouroboros/protocol/txsubmission"
4344)
4445
@@ -59,19 +60,21 @@ type Connection struct {
5960 delayMuxerStart bool
6061 fullDuplex bool
6162 // Mini-protocols
62- handshake * handshake.Handshake
63- chainSync * chainsync.ChainSync
64- chainSyncConfig * chainsync.Config
6563 blockFetch * blockfetch.BlockFetch
6664 blockFetchConfig * blockfetch.Config
65+ chainSync * chainsync.ChainSync
66+ chainSyncConfig * chainsync.Config
67+ handshake * handshake.Handshake
6768 keepAlive * keepalive.KeepAlive
6869 keepAliveConfig * keepalive.Config
70+ localStateQuery * localstatequery.LocalStateQuery
71+ localStateQueryConfig * localstatequery.Config
6972 localTxMonitor * localtxmonitor.LocalTxMonitor
7073 localTxMonitorConfig * localtxmonitor.Config
7174 localTxSubmission * localtxsubmission.LocalTxSubmission
7275 localTxSubmissionConfig * localtxsubmission.Config
73- localStateQuery * localstatequery. LocalStateQuery
74- localStateQueryConfig * localstatequery .Config
76+ peerSharing * peersharing. PeerSharing
77+ peerSharingConfig * peersharing .Config
7578 txSubmission * txsubmission.TxSubmission
7679 txSubmissionConfig * txsubmission.Config
7780}
@@ -165,16 +168,16 @@ func (c *Connection) Close() error {
165168 return err
166169}
167170
168- // ChainSync returns the chain-sync protocol handler
169- func (c * Connection ) ChainSync () * chainsync.ChainSync {
170- return c .chainSync
171- }
172-
173171// BlockFetch returns the block-fetch protocol handler
174172func (c * Connection ) BlockFetch () * blockfetch.BlockFetch {
175173 return c .blockFetch
176174}
177175
176+ // ChainSync returns the chain-sync protocol handler
177+ func (c * Connection ) ChainSync () * chainsync.ChainSync {
178+ return c .chainSync
179+ }
180+
178181// Handshake returns the handshake protocol handler
179182func (c * Connection ) Handshake () * handshake.Handshake {
180183 return c .handshake
@@ -185,6 +188,11 @@ func (c *Connection) KeepAlive() *keepalive.KeepAlive {
185188 return c .keepAlive
186189}
187190
191+ // LocalStateQuery returns the local-state-query protocol handler
192+ func (c * Connection ) LocalStateQuery () * localstatequery.LocalStateQuery {
193+ return c .localStateQuery
194+ }
195+
188196// LocalTxMonitor returns the local-tx-monitor protocol handler
189197func (c * Connection ) LocalTxMonitor () * localtxmonitor.LocalTxMonitor {
190198 return c .localTxMonitor
@@ -195,9 +203,9 @@ func (c *Connection) LocalTxSubmission() *localtxsubmission.LocalTxSubmission {
195203 return c .localTxSubmission
196204}
197205
198- // LocalStateQuery returns the local-state-query protocol handler
199- func (c * Connection ) LocalStateQuery () * localstatequery. LocalStateQuery {
200- return c .localStateQuery
206+ // PeerSharing returns the peer-sharing protocol handler
207+ func (c * Connection ) PeerSharing () * peersharing. PeerSharing {
208+ return c .peerSharing
201209}
202210
203211// TxSubmission returns the tx-submission protocol handler
@@ -320,6 +328,9 @@ func (c *Connection) setupConnection() error {
320328 c .keepAlive .Client .Start ()
321329 }
322330 }
331+ if versionNtN .EnablePeerSharingProtocol {
332+ c .peerSharing = peersharing .New (protoOptions , c .peerSharingConfig )
333+ }
323334 } else {
324335 versionNtC := GetProtocolVersionNtC (handshakeVersion )
325336 protoOptions .Mode = protocol .ProtocolModeNodeToClient
0 commit comments