blockchain

package
v0.0.0-...-c9d2d86 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: ISC Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchain

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

Blockchain is blockchain instance

func NewBlockchain

func NewBlockchain(pm peer.IProtocolManager) *Blockchain

NewBlockchain returns a fully initialised blockchain service using input data

func (*Blockchain) CurrentBlockHash

func (bc *Blockchain) CurrentBlockHash() crypto.Hash

CurrentBlockHash returns current block hash of the current block

func (*Blockchain) CurrentHeight

func (bc *Blockchain) CurrentHeight() uint32

CurrentHeight returns current heigt of the current block

func (*Blockchain) GenerateBlock

func (bc *Blockchain) GenerateBlock(txs proto.Transactions, createTime uint32) *proto.Block

GenerateBlock gets transactions from consensus service and generates a new block

func (*Blockchain) GetAsset

func (bc *Blockchain) GetAsset(id uint32) *state.Asset

GetAsset returns asset

func (*Blockchain) GetBalance

func (bc *Blockchain) GetBalance(addr account.Address) *balance.Balance

GetBalance returns balance

func (*Blockchain) GetBlockchainInfo

func (bc *Blockchain) GetBlockchainInfo() *consensus.BlockchainInfo

func (*Blockchain) GetConsenter

func (bc *Blockchain) GetConsenter() consensus.Consenter

func (*Blockchain) GetLedger

func (bc *Blockchain) GetLedger() *ledger.Ledger

func (*Blockchain) GetNextBlockHash

func (bc *Blockchain) GetNextBlockHash(h crypto.Hash) (crypto.Hash, error)

GetNextBlockHash returns the next block hash

func (*Blockchain) GetTransaction

func (bc *Blockchain) GetTransaction(txHash crypto.Hash) (*proto.Transaction, error)

GetTransaction returns transaction in ledger first then txBool

func (*Blockchain) ProcessBlock

func (bc *Blockchain) ProcessBlock(blk *proto.Block, flag bool) bool

ProcessBlock processes new block from the network,flag = true pack up block ,flag = false sync block

func (*Blockchain) ProcessTransaction

func (bc *Blockchain) ProcessTransaction(tx *proto.Transaction, needNotify bool) bool

ProcessTransaction processes new transaction from the network

func (*Blockchain) Relay

func (bc *Blockchain) Relay(inv proto.IInventory)

func (*Blockchain) Start

func (bc *Blockchain) Start()

func (*Blockchain) StartConsensusService

func (bc *Blockchain) StartConsensusService()

StartConsensusService starts consensus service

func (*Blockchain) StartServices

func (bc *Blockchain) StartServices()

Start starts blockchain services

func (*Blockchain) StartTxPoolService

func (bc *Blockchain) StartTxPoolService()

StartTxPool starts txpool service

func (*Blockchain) Started

func (bc *Blockchain) Started() bool

func (*Blockchain) Stop

func (bc *Blockchain) Stop()

func (*Blockchain) Synced

func (bc *Blockchain) Synced() bool

func (*Blockchain) VerifyTxs

VerifyTxs verify

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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