bhs

package
v1.0.0-beta.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service for BHS requests.

func NewBHSService

func NewBHSService(logger zerolog.Logger, httpClient *resty.Client, bhsCfg chainmodels.BHSConfig) *Service

NewBHSService creates a new instance of BHS service.

func (*Service) GetMerkleRoots

func (s *Service) GetMerkleRoots(ctx context.Context, query url.Values) (*models.MerkleRootsBHSResponse, error)

GetMerkleRoots returns Merkle Roots from Block Header Service

func (*Service) HealthcheckBHS

func (s *Service) HealthcheckBHS(ctx context.Context) error

HealthcheckBHS checks the health of the Block Headers Service (BHS). It verifies the BHS is reachable and ready to verify merkle roots by providing a known merkle root.

func (*Service) VerifyMerkleRoots

func (s *Service) VerifyMerkleRoots(ctx context.Context, merkleRoots []*spv.MerkleRootConfirmationRequestItem) (valid bool, err error)

VerifyMerkleRoots verifies the merkle roots of the given transactions using BHS request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL