ektclient

package
v0.0.0-...-7ede18c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVotesFromResp

func GetVotesFromResp(body []byte) blockchain.Votes

func InitEKTClient

func InitEKTClient()

Types

type Client

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

func (Client) BroadcastBlock

func (client Client) BroadcastBlock(block blockchain.Block)

func (Client) GetAccountNonce

func (client Client) GetAccountNonce(address string) int64

func (Client) GetBlockByHeight

func (client Client) GetBlockByHeight(height int64) *blockchain.Block

func (Client) GetGenesisAccounts

func (client Client) GetGenesisAccounts() []types.Account

func (Client) GetHeaderByHash

func (client Client) GetHeaderByHash(hash []byte) *blockchain.Header

func (Client) GetHeaderByHeight

func (client Client) GetHeaderByHeight(height int64) *blockchain.Header

func (Client) GetLastBlock

func (client Client) GetLastBlock() *blockchain.Header

func (Client) GetReceipt

func (client Client) GetReceipt(txHash string) *userevent.ReceiptDetail

func (Client) GetSuggestionFee

func (client Client) GetSuggestionFee() int64

func (Client) GetValueByHash

func (client Client) GetValueByHash(hash []byte) []byte

func (Client) GetVotesByBlockHash

func (client Client) GetVotesByBlockHash(hash string) blockchain.Votes

func (Client) SendTransaction

func (client Client) SendTransaction(tx userevent.Transaction) error

func (Client) SendVote

func (client Client) SendVote(vote blockchain.PeerBlockVote)

func (Client) SendVoteResult

func (client Client) SendVoteResult(votes blockchain.Votes)

type IClient

type IClient interface {
	// block
	GetHeaderByHeight(height int64) *blockchain.Header
	GetBlockByHeight(height int64) *blockchain.Block
	GetLastBlock() *blockchain.Header
	GetHeaderByHash(hash []byte) *blockchain.Header

	// vote
	GetVotesByBlockHash(hash string) blockchain.Votes

	// delegate
	BroadcastBlock(block blockchain.Block)
	SendVote(vote blockchain.PeerBlockVote)
	SendVoteResult(votes blockchain.Votes)

	// transaction
	GetSuggestionFee() int64
	SendTransaction(tx userevent.Transaction) error
	GetReceipt(txHash string) *userevent.ReceiptDetail

	// account
	GetAccountNonce(address string) int64
	GetGenesisAccounts() []types.Account

	GetValueByHash(hash []byte) []byte
}

func GetInst

func GetInst() IClient

func NewClient

func NewClient(peers []types.Peer) IClient

Jump to

Keyboard shortcuts

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