Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay takes headers from the Bitcoin chain and relays them to the given host chain.
func StartRelay ¶
func StartRelay( ctx context.Context, config config.Relay, btcChain btc.Handle, hostChain chain.Handle, observer RelayObserver, ) *Relay
StartRelay creates an instance of the headers relay and runs its processing loops. The lifecycle of the relay can be managed using the passed context. The relay exits automatically once an error occurs.
type RelayObserver ¶
type RelayObserver interface { // NotifyHeaderPulled notifies about new header pulled from the // Bitcoin chain. NotifyHeaderPulled(headerHeight int64) // NotifyHeadersPushed notifies about new headers pushed to the host chain. NotifyHeadersPushed(headersHeights []int64) }
RelayObserver represents an observer of headers relay events.
Click to show internal directories.
Click to hide internal directories.