core

package
v1.2.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "rpcclient"

Variables

This section is empty.

Functions

func WaitForMNReady

func WaitForMNReady(client Client, retryTimeout time.Duration) error

WaitForMNReady waits until the masternode is ready

Types

type Client

type Client interface {
	QuorumVerifier

	// QuorumInfo returns quorum info
	QuorumInfo(quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash) (*btcjson.QuorumInfoResult, error)
	// MasternodeStatus returns masternode status
	MasternodeStatus() (*btcjson.MasternodeStatusResult, error)
	// GetNetworkInfo returns network info
	GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)
	// MasternodeListJSON returns masternode list json
	MasternodeListJSON(filter string) (map[string]btcjson.MasternodelistResultJSON, error)
	// QuorumSign signs message in a quorum session
	QuorumSign(
		quorumType btcjson.LLMQType,
		requestID bytes.HexBytes,
		messageHash bytes.HexBytes,
		quorumHash bytes.HexBytes,
	) (*btcjson.QuorumSignResult, error)
	QuorumVerify(
		quorumType btcjson.LLMQType,
		requestID bytes.HexBytes,
		messageHash bytes.HexBytes,
		signature bytes.HexBytes,
		quorumHash bytes.HexBytes,
	) (bool, error)
	// Close Closes connection to dashd
	Close() error
	// Ping Sends ping to dashd
	Ping() error
}

type MockClient

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

MockClient is an implementation of a mock core-server

func NewMockClient

func NewMockClient(chainID string, llmqType btcjson.LLMQType, localPV types.PrivValidator, canSign bool) *MockClient

func (*MockClient) Close

func (mc *MockClient) Close() error

Close closes the underlying connection

func (*MockClient) GetNetworkInfo

func (mc *MockClient) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)

func (*MockClient) MasternodeListJSON

func (mc *MockClient) MasternodeListJSON(_filter string) (map[string]btcjson.MasternodelistResultJSON, error)

func (*MockClient) MasternodeStatus

func (mc *MockClient) MasternodeStatus() (*btcjson.MasternodeStatusResult, error)

func (*MockClient) Ping

func (mc *MockClient) Ping() error

Ping sends a ping request to the remote signer

func (*MockClient) QuorumInfo

func (mc *MockClient) QuorumInfo(
	quorumType btcjson.LLMQType,
	quorumHash crypto.QuorumHash,
) (*btcjson.QuorumInfoResult, error)

func (*MockClient) QuorumSign

func (mc *MockClient) QuorumSign(
	quorumType btcjson.LLMQType,
	requestID tmbytes.HexBytes,
	messageHash tmbytes.HexBytes,
	quorumHash crypto.QuorumHash,
) (*btcjson.QuorumSignResult, error)

func (*MockClient) QuorumVerify

func (mc *MockClient) QuorumVerify(
	quorumType btcjson.LLMQType,
	requestID tmbytes.HexBytes,
	messageHash tmbytes.HexBytes,
	signature tmbytes.HexBytes,
	quorumHash crypto.QuorumHash,
) (bool, error)

type QuorumVerifier

type QuorumVerifier interface {
	// QuorumVerify verifies quorum signature
	QuorumVerify(
		quorumType btcjson.LLMQType,
		requestID bytes.HexBytes,
		messageHash bytes.HexBytes,
		signature bytes.HexBytes,
		quorumHash bytes.HexBytes,
	) (bool, error)
}

QuorumVerifier represents subset of priv validator features that allows verification of threshold signatures.

type RPCClient

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

RPCClient implements Client Handles connection to the underlying dashd instance

func NewRPCClient

func NewRPCClient(host string, username string, password string, logger log.Logger) (*RPCClient, error)

NewRPCClient returns an instance of Client. it will start the endpoint (if not already started)

func (*RPCClient) Close

func (rpcClient *RPCClient) Close() error

Close closes the underlying connection

func (*RPCClient) GetNetworkInfo

func (rpcClient *RPCClient) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)

func (*RPCClient) MasternodeListJSON

func (rpcClient *RPCClient) MasternodeListJSON(filter string) (
	map[string]btcjson.MasternodelistResultJSON,
	error,
)

func (*RPCClient) MasternodeStatus

func (rpcClient *RPCClient) MasternodeStatus() (*btcjson.MasternodeStatusResult, error)

func (*RPCClient) Ping

func (rpcClient *RPCClient) Ping() error

Ping sends a ping request to the remote signer

func (*RPCClient) QuorumInfo

func (rpcClient *RPCClient) QuorumInfo(
	quorumType btcjson.LLMQType,
	quorumHash crypto.QuorumHash,
) (*btcjson.QuorumInfoResult, error)

func (*RPCClient) QuorumSign

func (rpcClient *RPCClient) QuorumSign(
	quorumType btcjson.LLMQType,
	requestID bytes.HexBytes,
	messageHash bytes.HexBytes,
	quorumHash crypto.QuorumHash,
) (*btcjson.QuorumSignResult, error)

func (*RPCClient) QuorumVerify

func (rpcClient *RPCClient) QuorumVerify(
	quorumType btcjson.LLMQType,
	requestID bytes.HexBytes,
	messageHash bytes.HexBytes,
	signature bytes.HexBytes,
	quorumHash crypto.QuorumHash,
) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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