network_client

package
v0.2.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricIdSize = 32
)

Variables

This section is empty.

Functions

func GetConfig

func GetConfig() config.RpcConfig

func GetEmptyParent

func GetEmptyParent() [MetricIdSize]byte

func GetEmptyParentAny

func GetEmptyParentAny() []byte

func SaveBlockTxs

func SaveBlockTxs(blockTxs BlockTxs) error

func SendNewTx

func SendNewTx(raw []byte) error

func SetConfig

func SetConfig(config config.RpcConfig)

Types

type Balance

type Balance struct {
	Address   string
	Balance   int64
	Spendable int64
	UtxoCount int
	Spends    int
	Outputs   int
	UTXOs     int
	Txs       int
}

func NewBalance

func NewBalance() *Balance

func (*Balance) GetByAddress

func (b *Balance) GetByAddress(address string) error

func (*Balance) GetByAddresses

func (b *Balance) GetByAddresses(addresses []string) error

type BlockHeight

type BlockHeight struct {
	Block  []byte
	Height int64
}

type BlockHeightGetter

type BlockHeightGetter struct {
	BlockHeights []*BlockHeight
}

func NewBlockHeight

func NewBlockHeight() *BlockHeightGetter

func (*BlockHeightGetter) Get

func (h *BlockHeightGetter) Get(startHeight int64) error

type BlockInfo

type BlockInfo struct {
	Hash   []byte
	Height int64
	Txs    int64
	Header []byte
}

func (BlockInfo) GetHashString

func (i BlockInfo) GetHashString() string

func (BlockInfo) RawString

func (i BlockInfo) RawString() string

type BlockTx

type BlockTx struct {
	BlockHash []byte
	TxHash    []byte
	Raw       []byte
}

type BlockTxs

type BlockTxs struct {
	Header []byte
	RawTxs [][]byte
}

type Connection

type Connection struct {
	Client network_pb.NetworkClient
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection() (*Connection, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) GetDefaultContext

func (c *Connection) GetDefaultContext() context.Context

func (*Connection) GetTimeoutContext

func (c *Connection) GetTimeoutContext(d time.Duration) context.Context

type GetBlock

type GetBlock struct {
	Block *BlockInfo
}

func NewGetBlock

func NewGetBlock() *GetBlock

func (*GetBlock) GetByHash

func (b *GetBlock) GetByHash(hash []byte) error

func (*GetBlock) GetByHeight

func (b *GetBlock) GetByHeight(height int64) error

type GetBlockInfos

type GetBlockInfos struct {
	Blocks []BlockInfo
}

func NewGetBlockInfos

func NewGetBlockInfos() *GetBlockInfos

func (*GetBlockInfos) Get

func (t *GetBlockInfos) Get(startHeight int64, newestFirst bool) error

func (GetBlockInfos) GetMaxHeight

func (t GetBlockInfos) GetMaxHeight() int64

func (GetBlockInfos) GetMinHeight

func (t GetBlockInfos) GetMinHeight() int64

type GetBlockTxs

type GetBlockTxs struct {
	BlockHash []byte
	Txs       []BlockTx
}

func NewGetBlockTxs

func NewGetBlockTxs() *GetBlockTxs

func (*GetBlockTxs) Get

func (t *GetBlockTxs) Get(blockHash []byte, startTx []byte) error

func (*GetBlockTxs) GetByHeight

func (t *GetBlockTxs) GetByHeight(height int64) error

type GetDoubleSpends

type GetDoubleSpends struct {
	Txs []Tx
}

func NewGetDoubleSpends

func NewGetDoubleSpends() *GetDoubleSpends

func (*GetDoubleSpends) Get

func (s *GetDoubleSpends) Get(startTx []byte) error

type GetMempoolTxs

type GetMempoolTxs struct {
	Txs []Tx
}

func NewGetMempoolTxs

func NewGetMempoolTxs() *GetMempoolTxs

func (*GetMempoolTxs) Get

func (t *GetMempoolTxs) Get(startTx []byte) error

type GetOutputInput

type GetOutputInput struct {
	Inputs []In
}

func NewGetOutputInput

func NewGetOutputInput() *GetOutputInput

func (*GetOutputInput) Get

func (g *GetOutputInput) Get(outs []Out) error

type GetTx

type GetTx struct {
	Raw       []byte
	BlockHash []byte
	Msg       *wire.MsgTx
}

func NewGetTx

func NewGetTx() *GetTx

func (*GetTx) Get

func (t *GetTx) Get(hash []byte) error

type GetTxBlock

type GetTxBlock struct {
	Txs []BlockTx
}

func NewGetTxBlock

func NewGetTxBlock() *GetTxBlock

func (*GetTxBlock) Get

func (t *GetTxBlock) Get(txHashes [][]byte) error

type GetUtxos

type GetUtxos struct {
	Utxos []Utxo
}

func NewGetUtxos

func NewGetUtxos() *GetUtxos

func (*GetUtxos) Get

func (u *GetUtxos) Get(pkHashes [][]byte) error

type In

type In struct {
	TxHash    []byte
	Index     uint32
	Script    []byte
	PrevHash  []byte
	PrevIndex uint32
}

type MetricInfo

type MetricInfo struct {
	Id       []byte
	Parent   []byte
	Action   string
	Order    int32
	Count    int32
	Start    time.Time
	Duration time.Duration
	Children []*MetricInfo
}

func (MetricInfo) IdShort

func (i MetricInfo) IdShort() string

func (MetricInfo) IdString

func (i MetricInfo) IdString() string

func (MetricInfo) ParentShort

func (i MetricInfo) ParentShort() string

func (MetricInfo) ParentString

func (i MetricInfo) ParentString() string

func (*MetricInfo) SetChildren

func (i *MetricInfo) SetChildren(tree bool) error

type MetricTime

type MetricTime struct {
	Id   []byte
	Time time.Time
}

func (MetricTime) IdShort

func (t MetricTime) IdShort() string

func (MetricTime) IdString

func (t MetricTime) IdString() string

type MetricTimeGetter

type MetricTimeGetter struct {
	MetricTimes []*MetricTime
}

func NewMetricTimeGetter

func NewMetricTimeGetter() *MetricTimeGetter

func (*MetricTimeGetter) Get

func (g *MetricTimeGetter) Get(start time.Time) error

type Metrics

type Metrics struct {
	Infos []*MetricInfo
}

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) Get

func (m *Metrics) Get(id []byte, parentIds [][]byte) error

func (*Metrics) GetById

func (m *Metrics) GetById(id []byte) error

func (*Metrics) GetByParentId

func (m *Metrics) GetByParentId(parentId []byte) error

func (*Metrics) GetTree

func (m *Metrics) GetTree(parentId []byte) error

type Out

type Out struct {
	TxHash []byte
	Index  uint32
	Value  int64
	Script []byte
}

type OutputMessenger

type OutputMessenger struct {
}

func NewOutputMessenger

func NewOutputMessenger() *OutputMessenger

func (*OutputMessenger) Output

func (m *OutputMessenger) Output(message string) error

type SendTx

type SendTx struct {
}

func NewSendTx

func NewSendTx() *SendTx

func (*SendTx) Send

func (t *SendTx) Send(txs [][]byte) error

func (*SendTx) SendWithBlock

func (t *SendTx) SendWithBlock(txs [][]byte, block []byte) error

type Tx

type Tx struct {
	TxHash []byte
}

type TxProcessed

type TxProcessed struct {
	TxHash    []byte
	Timestamp time.Time
}

func NewTxProcessed

func NewTxProcessed() *TxProcessed

func (*TxProcessed) Get

func (t *TxProcessed) Get(txHash []byte) error

type Utxo

type Utxo struct {
	TxHash []byte
	Index  uint32
	Value  int64
	PkHash []byte
}

Jump to

Keyboard shortcuts

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