yue

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: GPL-3.0 Imports: 61 Imported by: 3

README

taiyuechain

init

Documentation

Overview

Package yue implements the Taiyuechain protocol.

Index

Constants

View Source
const (
	StatusMsg          = 0x00
	NewBlockHashesMsg  = 0x01
	TransactionMsg     = 0x02
	GetBlockHeadersMsg = 0x03
	BlockHeadersMsg    = 0x04
	GetBlockBodiesMsg  = 0x05
	BlockBodiesMsg     = 0x06
	NewBlockMsg        = 0x07
	GetNodeDataMsg     = 0x0d
	NodeDataMsg        = 0x0e
	GetReceiptsMsg     = 0x0f
	ReceiptsMsg        = 0x10

	// New protocol message codes introduced in eth65
	//
	// Previously these message ids were used by some legacy and unsupported
	// eth protocols, reown them here.
	NewPooledTransactionHashesMsg = 0x08
	GetPooledTransactionsMsg      = 0x09
	PooledTransactionsMsg         = 0x0a

	// Protocol messages belonging to yue/63
	TbftNodeInfoMsg     = 0x14
	TbftNodeInfoHashMsg = 0x15
	GetTbftNodeInfoMsg  = 0x16
)

eth protocol message codes

View Source
const (
	ErrMsgTooLarge = iota
	ErrDecode
	ErrInvalidMsgCode
	ErrProtocolVersionMismatch
	ErrNetworkIDMismatch
	ErrGenesisMismatch
	ErrForkIDRejected
	ErrNoStatusMsg
	ErrExtraStatusMsg
	ErrCamsg
)
View Source
const DefaultULCMinTrustedFraction = 75
View Source
const ProtocolName = "yue"

protocolName is the official short name of the protocol used during capability negotiation.

Variables

View Source
var DefaultConfig = Config{
	SyncMode:      downloader.FullSync,
	NodeType:      false,
	NetworkId:     19330,
	DatabaseCache: 768,
	TrieCache:     256,
	TrieTimeout:   60 * time.Minute,

	MinervaMode:   0,
	GasPrice:      big.NewInt(1 * params.Babbage),
	MinerGasFloor: 12000000,
	MinerGasCeil:  16000000,
	TxPool:        core.DefaultTxPoolConfig,
	GPO: gasprice.Config{
		Blocks:     20,
		Percentile: 60,
	},
	Port:        30310,
	StandbyPort: 30311,
}

DefaultConfig contains default settings for use on the Taiyuechain main net.

View Source
var ProtocolLengths = map[uint]uint64{/* contains filtered or unexported fields */}

protocolLengths are the number of implemented message corresponding to different protocol versions.

View Source
var ProtocolVersions = []uint{eth65, eth64, eth63}

ProtocolVersions are the supported versions of the eth protocol (first is primary).

Functions

func CreateConsensusEngine

func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, cimList *cim.CimList) consensus.Engine

CreateConsensusEngine creates the required type of consensus engine instance for an Taiyuechain service

func CreateDB

func CreateDB(ctx *node.ServiceContext, config *Config, name string) (yuedb.Database, error)

CreateDB creates the chain database.

func NewBloomIndexer

func NewBloomIndexer(db yuedb.Database, size uint64) *core.ChainIndexer

NewBloomIndexer returns a chain indexer that generates bloom bits data for the canonical chain for fast logs filtering.

Types

type AgentNetworkProxy

type AgentNetworkProxy interface {
	// SubscribeNewPbftSignEvent should return an event subscription of
	// PbftSignEvent and send events to the given channel.
	SubscribeNewPbftSignEvent(chan<- types.PbftSignEvent) event.Subscription
	// SubscribeNodeInfoEvent should return an event subscription of
	// NodeInfoEvent and send events to the given channel.
	SubscribeNodeInfoEvent(chan<- types.NodeInfoEvent) event.Subscription
	// AddRemoteNodeInfo should add the given NodeInfo to the pbft agent.
	AddRemoteNodeInfo(*types.EncryptNodeMessage) error
	//GetNodeInfoByHash get crypto nodeInfo  by hash
	GetNodeInfoByHash(nodeInfoHash common.Hash) (*types.EncryptNodeMessage, bool)
}

type AgentWork

type AgentWork struct {
	Block *types.Block // the new block
	// contains filtered or unexported fields
}

AgentWork is the leader current environment and holds all of the current state information

type Backend

type Backend interface {
	BlockChain() *core.BlockChain
	TxPool() *core.TxPool
	Config() *Config
}

Backend wraps all methods required for pbft_agent

type BadBlockArgs

type BadBlockArgs struct {
	Hash  common.Hash            `json:"hash"`
	Block map[string]interface{} `json:"block"`
	RLP   string                 `json:"rlp"`
}

BadBlockArgs represents the entries in the list returned when bad blocks are queried.

type BlockHeadersData

type BlockHeadersData struct {
	Headers []*types.Header
	Call    uint32 // Distinguish fetcher and downloader
}

BlockHeadersData represents a block header send.

type BloomIndexer

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

BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index for the Taiyuechain header bloom filters, permitting blazing fast filtering.

func (*BloomIndexer) Commit

func (b *BloomIndexer) Commit() error

Commit implements core.ChainIndexerBackend, finalizing the bloom section and writing it out into the database.

func (*BloomIndexer) Process

func (b *BloomIndexer) Process(header *types.Header)

Process implements core.ChainIndexerBackend, adding a new header's bloom into the index.

func (*BloomIndexer) Reset

func (b *BloomIndexer) Reset(section uint64, lastSectionHead common.Hash) error

Reset implements core.ChainIndexerBackend, starting a new bloombits index section.

type Config

type Config struct {
	// The genesis block, which is inserted if the database is empty.
	// If nil, the Taiyuechain main net block is used.
	Genesis *core.Genesis

	// Protocol options
	NetworkId    uint64 // Network ID to use for selecting peers to connect to
	SyncMode     downloader.SyncMode
	NoPruning    bool
	DeletedState bool

	// Whitelist of required block number -> hash values to accept
	Whitelist map[uint64]common.Hash `toml:"-"`
	// GasPrice used for estimate gas
	GasPrice *big.Int `toml:",omitempty"`
	// CommitteeKey is the ECDSA private key for committee member.
	// If this filed is empty, can't be a committee member.
	CommitteeKey  []byte
	CommitteeBase common.Address
	// Host is the host interface on which to start the pbft server. If this
	// field is empty, can't be a committee member.
	Host string `toml:",omitempty"`

	// Port is the TCP port number on which to start the pbft server.
	Port int `toml:",omitempty"`

	// StandByPort is the TCP port number on which to start the pbft server.
	StandbyPort int `toml:",omitempty"`
	// Database options
	SkipBcVersionCheck bool `toml:"-"`
	DatabaseHandles    int  `toml:"-"`
	DatabaseCache      int
	TrieCache          int
	TrieTimeout        time.Duration
	// ModeNormal(0) for Minerva
	MinervaMode   int
	MinerGasCeil  uint64
	MinerGasFloor uint64
	// Transaction pool options
	TxPool core.TxPoolConfig
	// Gas Price Oracle options
	GPO gasprice.Config

	// // Enables tracking of SHA3 preimages in the VM
	EnablePreimageRecording bool

	// // Miscellaneous options
	DocRoot string `toml:"-"`

	// // true indicate singlenode start
	NodeType bool `toml:",omitempty"`
	// Checkpoint is a hardcoded checkpoint which can be nil.
	Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
}

func (*Config) GetNodeType

func (c *Config) GetNodeType() bool

func (Config) MarshalTOML

func (c Config) MarshalTOML() (interface{}, error)

MarshalTOML marshals as TOML.

func (*Config) UnmarshalTOML

func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error

UnmarshalTOML unmarshals from TOML.

type LesServer

type LesServer interface {
	Start(srvr *p2p.Server)
	Stop()
	Protocols() []p2p.Protocol
	SetBloomBitsIndexer(bbIndexer *core.ChainIndexer)
}

type NodeInfo

type NodeInfo struct {
	Network    uint64              `json:"network"`    // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)
	Difficulty *big.Int            `json:"difficulty"` // Total difficulty of the host's blockchain
	Genesis    common.Hash         `json:"genesis"`    // SHA3 hash of the host's genesis block
	Config     *params.ChainConfig `json:"config"`     // Chain configuration for the fork rules
	Head       common.Hash         `json:"head"`       // SHA3 hash of the host's best owned block
}

NodeInfo represents a short summary of the Ethereum sub-protocol metadata known about the host peer.

type PbftAgent

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

PbftAgent receive events from election and communicate with pbftServer

func NewPbftAgent

func NewPbftAgent(yue Backend, config *params.ChainConfig, engine consensus.Engine,
	election *elect.Election, cIMList *cim.CimList, gasFloor, gasCeil uint64) *PbftAgent

NewPbftAgent creates a new pbftAgent ,receive events from election and communicate with pbftServer

func (*PbftAgent) AcquireCommitteeAuth

func (agent *PbftAgent) AcquireCommitteeAuth(fastHeight *big.Int) bool

AcquireCommitteeAuth determine whether the node pubKey is in the specified committee

func (*PbftAgent) AddRemoteNodeInfo

func (agent *PbftAgent) AddRemoteNodeInfo(cryNodeInfo *types.EncryptNodeMessage) error

AddRemoteNodeInfo send cryNodeInfo of committeeNode to network,and recieved by other committeenode

func (*PbftAgent) BroadcastConsensus

func (agent *PbftAgent) BroadcastConsensus(fb *types.Block) error

BroadcastConsensus when More than 2/3 signs with agree,

committee Member Reach a consensus  and insert the fastBlock into fastBlockChain

func (*PbftAgent) ChangeCommitteeLeader

func (agent *PbftAgent) ChangeCommitteeLeader(height *big.Int) bool

ChangeCommitteeLeader trigger view change.

func (*PbftAgent) CommitteeNumber

func (agent *PbftAgent) CommitteeNumber() uint64

CommitteeNumber return current committee number

func (*PbftAgent) FetchFastBlock

func (agent *PbftAgent) FetchFastBlock(committeeID *big.Int, infos []*types.CommitteeMember) (*types.Block, error)

FetchFastBlock generate fastBlock as leader

func (*PbftAgent) GenerateSign

func (agent *PbftAgent) GenerateSign(fb *types.Block) (*types.PbftSign, error)

GenerateSign generate sign with default agree from committeeMember in fastBlock

func (*PbftAgent) GenerateSignWithVote

func (agent *PbftAgent) GenerateSignWithVote(fb *types.Block, vote uint32, result bool) (*types.PbftSign, error)

GenerateSignWithVote generate sign from committeeMember in fastBlock

func (*PbftAgent) GetAlternativeCommittee

func (agent *PbftAgent) GetAlternativeCommittee() []string

GetAlternativeCommittee return received back committee member's pubkey information

func (*PbftAgent) GetCommitteeNumber

func (agent *PbftAgent) GetCommitteeNumber(blockHeight *big.Int) int32

GetCommitteeNumber get Committees number from blockHeight

func (*PbftAgent) GetCommitteeStatus

func (agent *PbftAgent) GetCommitteeStatus() map[string]interface{}

GetCommitteeStatus return current committee infomation

func (*PbftAgent) GetCurrentCommittee

func (agent *PbftAgent) GetCurrentCommittee() []string

GetCurrentCommittee return committee member's pubkey information

func (*PbftAgent) GetCurrentHeight

func (agent *PbftAgent) GetCurrentHeight() *big.Int

GetCurrentHeight return current fastBlock number

func (*PbftAgent) GetFastLastProposer

func (agent *PbftAgent) GetFastLastProposer() common.Address

GetFastLastProposer get last proposer

func (*PbftAgent) GetNodeInfoByHash

func (agent *PbftAgent) GetNodeInfoByHash(nodeInfoHash common.Hash) (*types.EncryptNodeMessage, bool)

GetNodeInfoByHash get cryptoNodeInfo by hash

func (*PbftAgent) GetSeedMember

func (agent *PbftAgent) GetSeedMember() []*types.CommitteeMember

GetSeedMember get seed member

func (*PbftAgent) IsCommitteeMember

func (agent *PbftAgent) IsCommitteeMember() bool

IsCurrentCommitteeMember get whether self is committee member or not

func (*PbftAgent) IsLeader

func (agent *PbftAgent) IsLeader() bool

IsLeader get current committee leader

func (*PbftAgent) IsUsedOrUnusedMember

func (agent *PbftAgent) IsUsedOrUnusedMember(committeeInfo *types.CommitteeInfo, publickey []byte) bool

IsUsedOrUnusedMember whether publickey in committee member

func (*PbftAgent) MarkBroadcastNodeTag

func (agent *PbftAgent) MarkBroadcastNodeTag(cryptoNodeInfo *types.EncryptNodeMessage)

MarkNodeTag Mark received nodeTag,avoid old node information

func (*PbftAgent) MarkNodeInfo

func (agent *PbftAgent) MarkNodeInfo(encryptNode *types.EncryptNodeMessage, nodeTagHash common.Hash)

MarkNodeInfo Mark received NodeInfo

func (*PbftAgent) MarkNodeTag

func (agent *PbftAgent) MarkNodeTag(nodeTag common.Hash, timestamp *big.Int)

MarkNodeTag Mark received nodeTag,avoid old node information

func (*PbftAgent) Start

func (agent *PbftAgent) Start()

Start means receive events from election and send pbftNode infomation

func (*PbftAgent) SubscribeNewPbftSignEvent

func (agent *PbftAgent) SubscribeNewPbftSignEvent(ch chan<- types.PbftSignEvent) event.Subscription

SubscribeNewPbftSignEvent registers a subscription of PbftSignEvent and starts sending event to the given channel.

func (*PbftAgent) SubscribeNodeInfoEvent

func (agent *PbftAgent) SubscribeNodeInfoEvent(ch chan<- types.NodeInfoEvent) event.Subscription

SubscribeNodeInfoEvent registers a subscription of NodeInfoEvent.

func (*PbftAgent) VerifyCommitteeSign

func (agent *PbftAgent) VerifyCommitteeSign(sign *types.PbftSign) bool

VerifyCommitteeSign verify sign of node is in committee

func (*PbftAgent) VerifyFastBlock

func (agent *PbftAgent) VerifyFastBlock(fb *types.Block, result bool) (*types.PbftSign, error)

VerifyFastBlock committee member verify fastBlock and vote agree or disagree sign

type PeerInfo

type PeerInfo struct {
	Version    int      `json:"version"`    // Ethereum protocol version negotiated
	Difficulty *big.Int `json:"difficulty"` // Total difficulty of the peer's blockchain
	Head       string   `json:"head"`       // SHA3 hash of the peer's best owned block
}

PeerInfo represents a short summary of the Ethereum sub-protocol metadata known about a connected peer.

type PrivateAdminAPI

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

PrivateAdminAPI is the collection of Taiyuechain full node-related APIs exposed over the private admin endpoint.

func NewPrivateAdminAPI

func NewPrivateAdminAPI(yue *Taiyuechain) *PrivateAdminAPI

NewPrivateAdminAPI creates a new API definition for the full node private admin methods of the Taiyuechain service.

func (*PrivateAdminAPI) ExportChain

func (api *PrivateAdminAPI) ExportChain(file string) (bool, error)

ExportChain exports the current blockchain into a local file.

func (*PrivateAdminAPI) ImportChain

func (api *PrivateAdminAPI) ImportChain(file string) (bool, error)

ImportChain imports a blockchain from a local file.

type PrivateDebugAPI

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

PrivateDebugAPI is the collection of Taiyuechain full node APIs exposed over the private debugging endpoint.

func NewPrivateDebugAPI

func NewPrivateDebugAPI(config *params.ChainConfig, yue *Taiyuechain) *PrivateDebugAPI

NewPrivateDebugAPI creates a new API definition for the full node-related private debug methods of the Taiyuechain service.

func (*PrivateDebugAPI) GetBadBlocks

func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error)

GetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network and returns them as a JSON list of block-hashes

func (*PrivateDebugAPI) GetModifiedAccountsByHash

func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error)

GetModifiedAccountsByHash returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.

With one parameter, returns the list of accounts modified in the specified block.

func (*PrivateDebugAPI) GetModifiedAccountsByNumber

func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error)

GetModifiedAccountsByNumber returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.

With one parameter, returns the list of accounts modified in the specified block.

func (*PrivateDebugAPI) Preimage

func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)

Preimage is a debug API function that returns the preimage for a sha3 hash, if known.

func (*PrivateDebugAPI) StorageRangeAt

func (api *PrivateDebugAPI) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error)

StorageRangeAt returns the storage at the given block height and transaction index.

func (*PrivateDebugAPI) TraceBlock

func (api *PrivateDebugAPI) TraceBlock(ctx context.Context, blob []byte, config *TraceConfig) ([]*txTraceResult, error)

TraceBlock returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*PrivateDebugAPI) TraceBlockByHash

func (api *PrivateDebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)

TraceBlockByHash returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*PrivateDebugAPI) TraceBlockByNumber

func (api *PrivateDebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error)

TraceBlockByNumber returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*PrivateDebugAPI) TraceBlockFromFile

func (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string, config *TraceConfig) ([]*txTraceResult, error)

TraceBlockFromFile returns the structured logs created during the execution of EVM and returns them as a JSON object.

func (*PrivateDebugAPI) TraceChain

func (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.BlockNumber, config *TraceConfig) (*rpc.Subscription, error)

TraceChain returns the structured logs created during the execution of EVM between two blocks (excluding start) and returns them as a JSON object.

func (*PrivateDebugAPI) TraceTransaction

func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error)

TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.

type ProtocolManager

type ProtocolManager struct {
	SubProtocols []p2p.Protocol
	// contains filtered or unexported fields
}

func NewProtocolManager

func NewProtocolManager(config *params.ChainConfig, checkpoint *params.TrustedCheckpoint, mode downloader.SyncMode, networkID uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine, blockchain *core.BlockChain, chaindb yuedb.Database, agent *PbftAgent, cacheLimit int, whitelist map[uint64]common.Hash, cimList *cim.CimList, nodeCert []byte) (*ProtocolManager, error)

NewProtocolManager returns a new Ethereum sub protocol manager. The Ethereum sub protocol manages peers capable with the Ethereum network.

func (*ProtocolManager) BroadcastBlock

func (pm *ProtocolManager) BroadcastBlock(block *types.Block, propagate bool)

BroadcastBlock will either propagate a block to a subset of its peers, or will only announce its availability (depending what's requested).

func (*ProtocolManager) BroadcastFastBlock

func (pm *ProtocolManager) BroadcastFastBlock(block *types.Block, propagate bool)

BroadcastFastBlock will either propagate a block to a subset of it's peers, or will only announce it's availability (depending what's requested).

func (*ProtocolManager) BroadcastPbNodeInfo

func (pm *ProtocolManager) BroadcastPbNodeInfo(nodeInfo *types.EncryptNodeMessage)

BroadcastPbNodeInfo will propagate a batch of EncryptNodeMessage to all peers which are not known to already have the given CryNodeInfo.

func (*ProtocolManager) BroadcastTransactions

func (pm *ProtocolManager) BroadcastTransactions(txs types.Transactions, propagate bool)

BroadcastTransactions will propagate a batch of transactions to all peers which are not known to already have the given transaction.

func (*ProtocolManager) NodeInfo

func (pm *ProtocolManager) NodeInfo() *NodeInfo

NodeInfo retrieves some protocol metadata about the running host node.

func (*ProtocolManager) Start

func (pm *ProtocolManager) Start(maxPeers int)

func (*ProtocolManager) Stop

func (pm *ProtocolManager) Stop()

type PublicDebugAPI

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

PublicDebugAPI is the collection of Taiyuechain full node APIs exposed over the public debugging endpoint.

func NewPublicDebugAPI

func NewPublicDebugAPI(yue *Taiyuechain) *PublicDebugAPI

NewPublicDebugAPI creates a new API definition for the full node- related public debug methods of the Taiyuechain service.

func (*PublicDebugAPI) DumpBlock

func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error)

DumpBlock retrieves the entire state of the database at a given block.

type PublicTaichainAPI

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

PublicTaichainAPI provides an API to access Taiyuechain full node-related information.

func NewPublicTaiyueChainAPI

func NewPublicTaiyueChainAPI(e *Taiyuechain) *PublicTaichainAPI

NewPublicTaiyueChainAPI creates a new Taiyuechain protocol API for full nodes.

func (*PublicTaichainAPI) ChainId

func (api *PublicTaichainAPI) ChainId() hexutil.Uint64

ChainId retuurn current taiyuechain's chain config.

func (*PublicTaichainAPI) CommitteeCoinBase

func (api *PublicTaichainAPI) CommitteeCoinBase() common.Address

CommitteeCoinBase is the address that mining rewards will be send to

func (*PublicTaichainAPI) CommitteeNumber

func (api *PublicTaichainAPI) CommitteeNumber() uint64

CommitteeNumber return number of current committee

func (*PublicTaichainAPI) GetCurrentState

func (api *PublicTaichainAPI) GetCurrentState() map[string]interface{}

GetCurrentState get current committee state

func (*PublicTaichainAPI) IsCommitteeMember

func (api *PublicTaichainAPI) IsCommitteeMember() bool

IsCommitteeMember return node whether current committee member

func (*PublicTaichainAPI) Pubkey

func (api *PublicTaichainAPI) Pubkey() string

Pubkey is the address that mining rewards will be send to (alias for Etherbase)

type StorageRangeResult

type StorageRangeResult struct {
	Storage storageMap   `json:"storage"`
	NextKey *common.Hash `json:"nextKey"` // nil if Storage includes the last key in the trie.
}

StorageRangeResult is the result of a debug_storageRangeAt API call.

type Taiyuechain

type Taiyuechain struct {
	APIBackend *TrueAPIBackend
	// contains filtered or unexported fields
}

Taiyuechain implements the Taiyuechain full node service.

func New

func New(ctx *node.ServiceContext, config *Config, p2pCert []byte) (*Taiyuechain, error)

New creates a new Taiyuechain object (including the initialisation of the common Taiyuechain object)

func (*Taiyuechain) APIs

func (s *Taiyuechain) APIs() []rpc.API

APIs return the collection of RPC services the yue package offers. NOTE, some of these services probably need to be moved to somewhere else.

func (*Taiyuechain) AccountManager

func (s *Taiyuechain) AccountManager() *accounts.Manager

func (*Taiyuechain) AddLesServer

func (s *Taiyuechain) AddLesServer(ls LesServer)

func (*Taiyuechain) BlockChain

func (s *Taiyuechain) BlockChain() *core.BlockChain

func (*Taiyuechain) ChainDb

func (s *Taiyuechain) ChainDb() yuedb.Database

func (*Taiyuechain) Config

func (s *Taiyuechain) Config() *Config

func (*Taiyuechain) Downloader

func (s *Taiyuechain) Downloader() *downloader.Downloader

func (*Taiyuechain) Engine

func (s *Taiyuechain) Engine() consensus.Engine

func (*Taiyuechain) EthVersion

func (s *Taiyuechain) EthVersion() int

func (*Taiyuechain) Etherbase

func (s *Taiyuechain) Etherbase() common.Address

func (*Taiyuechain) EventMux

func (s *Taiyuechain) EventMux() *event.TypeMux

func (*Taiyuechain) IsListening

func (s *Taiyuechain) IsListening() bool

func (*Taiyuechain) NetVersion

func (s *Taiyuechain) NetVersion() uint64

func (*Taiyuechain) PbftAgent

func (s *Taiyuechain) PbftAgent() *PbftAgent

func (*Taiyuechain) Protocols

func (s *Taiyuechain) Protocols() []p2p.Protocol

Protocols implements node.Service, returning all the currently configured network protocols to start.

func (*Taiyuechain) ResetWithFastGenesisBlock

func (s *Taiyuechain) ResetWithFastGenesisBlock(gb *types.Block)

func (*Taiyuechain) ResetWithGenesisBlock

func (s *Taiyuechain) ResetWithGenesisBlock(gb *types.Block)

func (*Taiyuechain) Start

func (s *Taiyuechain) Start(srvr *p2p.Server) error

Start implements node.Service, starting all internal goroutines needed by the Taiyuechain protocol implementation.

func (*Taiyuechain) Stop

func (s *Taiyuechain) Stop() error

Stop implements node.Service, terminating all internal goroutines used by the Taiyuechain protocol.

func (*Taiyuechain) TxPool

func (s *Taiyuechain) TxPool() *core.TxPool

type TraceConfig

type TraceConfig struct {
	*vm.LogConfig
	Tracer  *string
	Timeout *string
	Reexec  *uint64
}

TraceConfig holds extra parameters to trace functions.

type TrueAPIBackend

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

TRUEAPIBackend implements ethapi.Backend for full nodes

func (*TrueAPIBackend) AccountManager

func (b *TrueAPIBackend) AccountManager() *accounts.Manager

func (*TrueAPIBackend) BlockByNumber

func (b *TrueAPIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)

func (*TrueAPIBackend) BloomStatus

func (b *TrueAPIBackend) BloomStatus() (uint64, uint64)

func (*TrueAPIBackend) ChainConfig

func (b *TrueAPIBackend) ChainConfig() *params.ChainConfig

ChainConfig returns the active chain configuration.

func (*TrueAPIBackend) ChainDb

func (b *TrueAPIBackend) ChainDb() yuedb.Database

func (*TrueAPIBackend) CurrentBlock

func (b *TrueAPIBackend) CurrentBlock() *types.Block

func (*TrueAPIBackend) Downloader

func (b *TrueAPIBackend) Downloader() *downloader.Downloader

func (*TrueAPIBackend) EventMux

func (b *TrueAPIBackend) EventMux() *event.TypeMux

func (*TrueAPIBackend) GetBlock

func (b *TrueAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)

func (*TrueAPIBackend) GetCa

func (b *TrueAPIBackend) GetCa(ctx context.Context, dir string) (interface{}, error)

func (*TrueAPIBackend) GetChainBaseParams

func (b *TrueAPIBackend) GetChainBaseParams() []byte

func (*TrueAPIBackend) GetCommittee

func (b *TrueAPIBackend) GetCommittee(number rpc.BlockNumber) (map[string]interface{}, error)

func (*TrueAPIBackend) GetEVM

func (b *TrueAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error)

func (*TrueAPIBackend) GetLogs

func (b *TrueAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error)

func (*TrueAPIBackend) GetPoolNonce

func (b *TrueAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)

func (*TrueAPIBackend) GetPoolTransaction

func (b *TrueAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction

func (*TrueAPIBackend) GetPoolTransactions

func (b *TrueAPIBackend) GetPoolTransactions() (types.Transactions, error)

func (*TrueAPIBackend) GetReceipts

func (b *TrueAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)

func (*TrueAPIBackend) HeaderByHash

func (b *TrueAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

func (*TrueAPIBackend) HeaderByNumber

func (b *TrueAPIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)

func (*TrueAPIBackend) IsNoGasUsageModel

func (b *TrueAPIBackend) IsNoGasUsageModel() bool

func (*TrueAPIBackend) ProtocolVersion

func (b *TrueAPIBackend) ProtocolVersion() int

func (*TrueAPIBackend) SendTx

func (b *TrueAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error

func (*TrueAPIBackend) ServiceFilter

func (b *TrueAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)

func (*TrueAPIBackend) SetHead

func (b *TrueAPIBackend) SetHead(number uint64)

func (*TrueAPIBackend) SetSnailHead

func (b *TrueAPIBackend) SetSnailHead(number uint64)

func (*TrueAPIBackend) StateAndHeaderByNumber

func (b *TrueAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)

func (*TrueAPIBackend) Stats

func (b *TrueAPIBackend) Stats() (pending int, queued int)

func (*TrueAPIBackend) SubscribeChainEvent

func (b *TrueAPIBackend) SubscribeChainEvent(ch chan<- types.FastChainEvent) event.Subscription

func (*TrueAPIBackend) SubscribeChainHeadEvent

func (b *TrueAPIBackend) SubscribeChainHeadEvent(ch chan<- types.FastChainHeadEvent) event.Subscription

func (*TrueAPIBackend) SubscribeChainSideEvent

func (b *TrueAPIBackend) SubscribeChainSideEvent(ch chan<- types.FastChainSideEvent) event.Subscription

func (*TrueAPIBackend) SubscribeLogsEvent

func (b *TrueAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription

func (*TrueAPIBackend) SubscribeNewTxsEvent

func (b *TrueAPIBackend) SubscribeNewTxsEvent(ch chan<- types.NewTxsEvent) event.Subscription

func (*TrueAPIBackend) SubscribeRemovedLogsEvent

func (b *TrueAPIBackend) SubscribeRemovedLogsEvent(ch chan<- types.RemovedLogsEvent) event.Subscription

func (*TrueAPIBackend) SuggestPrice

func (b *TrueAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error)

func (*TrueAPIBackend) TxPoolContent

type ULCConfig

type ULCConfig struct {
	TrustedServers     []string `toml:",omitempty"` // A list of trusted servers
	MinTrustedFraction int      `toml:",omitempty"` // Minimum percentage of connected trusted servers to validate trusted (1-100)
}

ULCConfig is a Ultra Light client options.

Directories

Path Synopsis
Package downloader contains the manual full chain synchronisation.
Package downloader contains the manual full chain synchronisation.
Package fetcher contains the announcement based blocks or transaction synchronisation.
Package fetcher contains the announcement based blocks or transaction synchronisation.
Package filters implements an ethereum filtering system for block, transactions and log events.
Package filters implements an ethereum filtering system for block, transactions and log events.
Package tracers is a collection of JavaScript transaction tracers.
Package tracers is a collection of JavaScript transaction tracers.
internal/tracers
Package tracers contains the actual JavaScript tracer assets.
Package tracers contains the actual JavaScript tracer assets.

Jump to

Keyboard shortcuts

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