Documentation
¶
Index ¶
- Constants
- Variables
- func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Database, error)
- func NewBlockProposer(dex *Tangerine, watchCat *syncer.WatchCat, dMoment time.Time) *blockProposer
- func NewBloomIndexer(db ethdb.Database, size, confirms uint64) *core.ChainIndexer
- type BadBlockArgs
- type BloomIndexer
- type Config
- type DexAPIBackend
- func (b *DexAPIBackend) AccountManager() *accounts.Manager
- func (b *DexAPIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
- func (b *DexAPIBackend) BloomStatus() (uint64, uint64)
- func (b *DexAPIBackend) ChainConfig() *params.ChainConfig
- func (b *DexAPIBackend) ChainDb() ethdb.Database
- func (b *DexAPIBackend) CurrentBlock() *types.Block
- func (b *DexAPIBackend) Downloader() ethapi.Downloader
- func (b *DexAPIBackend) EventMux() *event.TypeMux
- func (b *DexAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (b *DexAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, ...) (*vm.EVM, func() error, error)
- func (b *DexAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error)
- func (b *DexAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
- func (b *DexAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction
- func (b *DexAPIBackend) GetPoolTransactions() (types.Transactions, error)
- func (b *DexAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
- func (b *DexAPIBackend) GetTd(blockHash common.Hash) *big.Int
- func (b *DexAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (b *DexAPIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)
- func (b *DexAPIBackend) ProtocolVersion() int
- func (b *DexAPIBackend) RPCGasCap() *big.Int
- func (b *DexAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
- func (b *DexAPIBackend) SendTxs(ctx context.Context, signedTxs []*types.Transaction) []error
- func (b *DexAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
- func (b *DexAPIBackend) SetHead(number uint64)
- func (b *DexAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)
- func (b *DexAPIBackend) Stats() (pending int, queued int)
- func (b *DexAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
- func (b *DexAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
- func (b *DexAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
- func (b *DexAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
- func (b *DexAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
- func (b *DexAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
- func (b *DexAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error)
- func (b *DexAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
- type DexconApp
- func (d *DexconApp) BlockConfirmed(block coreTypes.Block)
- func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, blockPosition coreTypes.Position, rand []byte)
- func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte, err error)
- func (d *DexconApp) PrepareWitness(consensusHeight uint64) (witness coreTypes.Witness, err error)
- func (d *DexconApp) Stop()
- func (d *DexconApp) SubscribeNewFinalizedBlockEvent(ch chan<- core.NewFinalizedBlockEvent) event.Subscription
- func (d *DexconApp) VerifyBlock(block *coreTypes.Block) coreTypes.BlockVerifyStatus
- type DexconGovernance
- func (d *DexconGovernance) AddDKGComplaint(complaint *dkgTypes.Complaint)
- func (d *DexconGovernance) AddDKGFinalize(final *dkgTypes.Finalize)
- func (d *DexconGovernance) AddDKGMPKReady(ready *dkgTypes.MPKReady)
- func (d *DexconGovernance) AddDKGMasterPublicKey(masterPublicKey *dkgTypes.MasterPublicKey)
- func (d *DexconGovernance) AddDKGSuccess(success *dkgTypes.Success)
- func (d *DexconGovernance) ProposeCRS(round uint64, signedCRS []byte)
- func (d *DexconGovernance) RawConfiguration(round uint64) (*params.DexconConfig, error)
- func (d *DexconGovernance) ReportForkBlock(block1, block2 *coreTypes.Block)
- func (d *DexconGovernance) ReportForkVote(vote1, vote2 *coreTypes.Vote)
- func (d *DexconGovernance) ResetDKG(newSignedCRS []byte)
- func (d *DexconGovernance) Round() uint64
- type DexconNetwork
- func (n *DexconNetwork) BroadcastAgreementResult(result *types.AgreementResult)
- func (n *DexconNetwork) BroadcastBlock(block *types.Block)
- func (n *DexconNetwork) BroadcastDKGPartialSignature(psig *dkgTypes.PartialSignature)
- func (n *DexconNetwork) BroadcastDKGPrivateShare(prvShare *dkgTypes.PrivateShare)
- func (n *DexconNetwork) BroadcastVote(vote *types.Vote)
- func (n *DexconNetwork) PullBlocks(hashes coreCommon.Hashes)
- func (n *DexconNetwork) PullVotes(pos types.Position)
- func (n *DexconNetwork) ReceiveChan() <-chan types.Msg
- func (n *DexconNetwork) ReportBadPeerChan() chan<- interface{}
- func (n *DexconNetwork) SendDKGPrivateShare(pub crypto.PublicKey, prvShare *dkgTypes.PrivateShare)
- type NodeInfo
- type NotaryInfo
- type NotaryNodeInfo
- type PeerInfo
- type PrivateAdminAPI
- type PrivateDebugAPI
- func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error)
- func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error)
- func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error)
- func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)
- func (api *PrivateDebugAPI) StandardTraceBadBlockToFile(ctx context.Context, hash common.Hash, config *StdTraceConfig) ([]string, error)
- func (api *PrivateDebugAPI) StandardTraceBlockToFile(ctx context.Context, hash common.Hash, config *StdTraceConfig) ([]string, error)
- func (api *PrivateDebugAPI) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex int, ...) (StorageRangeResult, error)
- func (api *PrivateDebugAPI) TraceBadBlock(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)
- func (api *PrivateDebugAPI) TraceBlock(ctx context.Context, blob []byte, config *TraceConfig) ([]*txTraceResult, error)
- func (api *PrivateDebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)
- func (api *PrivateDebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error)
- func (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string, config *TraceConfig) ([]*txTraceResult, error)
- func (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.BlockNumber, config *TraceConfig) (*rpc.Subscription, error)
- func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error)
- type ProtocolManager
- func (pm *ProtocolManager) BroadcastAgreementResult(agreement *coreTypes.AgreementResult)
- func (pm *ProtocolManager) BroadcastBlock(block *types.Block, propagate bool)
- func (pm *ProtocolManager) BroadcastCoreBlock(block *coreTypes.Block)
- func (pm *ProtocolManager) BroadcastDKGPartialSignature(psig *dkgTypes.PartialSignature)
- func (pm *ProtocolManager) BroadcastDKGPrivateShare(privateShare *dkgTypes.PrivateShare)
- func (pm *ProtocolManager) BroadcastFinalizedBlock(block *coreTypes.Block)
- func (pm *ProtocolManager) BroadcastPullBlocks(hashes coreCommon.Hashes)
- func (pm *ProtocolManager) BroadcastPullVotes(pos coreTypes.Position)
- func (pm *ProtocolManager) BroadcastTxs(txs types.Transactions)
- func (pm *ProtocolManager) BroadcastVote(vote *coreTypes.Vote)
- func (pm *ProtocolManager) NodeInfo() *NodeInfo
- func (pm *ProtocolManager) NotaryInfo() (*NotaryInfo, error)
- func (pm *ProtocolManager) ReceiveChan() <-chan coreTypes.Msg
- func (pm *ProtocolManager) ReportBadPeerChan() chan<- interface{}
- func (pm *ProtocolManager) SendDKGPrivateShare(pub coreCrypto.PublicKey, privateShare *dkgTypes.PrivateShare)
- func (pm *ProtocolManager) SetReceiveCoreMessage(enabled bool)
- func (pm *ProtocolManager) Start(srvr p2pServer, maxPeers int)
- func (pm *ProtocolManager) Stop()
- type PublicDebugAPI
- type PublicEthereumAPI
- type Recovery
- type StdTraceConfig
- type StorageRangeResult
- type Tangerine
- func (s *Tangerine) APIs() []rpc.API
- func (d *Tangerine) AccountManager() *accounts.Manager
- func (d *Tangerine) BlockChain() *core.BlockChain
- func (d *Tangerine) ChainDb() ethdb.Database
- func (d *Tangerine) DexVersion() int
- func (d *Tangerine) Downloader() ethapi.Downloader
- func (d *Tangerine) Engine() consensus.Engine
- func (d *Tangerine) Etherbase() common.Address
- func (d *Tangerine) EventMux() *event.TypeMux
- func (s *Tangerine) IsCoreSyncing() bool
- func (s *Tangerine) IsProposing() bool
- func (d *Tangerine) NetVersion() uint64
- func (s *Tangerine) Protocols() []p2p.Protocol
- func (s *Tangerine) Start(srvr *p2p.Server) error
- func (s *Tangerine) Stop() error
- func (d *Tangerine) TxPool() *core.TxPool
- type TraceConfig
Constants ¶
const ( // Protocol messages belonging to eth/62 StatusMsg = 0x00 NewBlockHashesMsg = 0x01 TxMsg = 0x02 GetBlockHeadersMsg = 0x03 BlockHeadersMsg = 0x04 GetBlockBodiesMsg = 0x05 BlockBodiesMsg = 0x06 NewBlockMsg = 0x07 // Protocol messages belonging to eth/63 GetNodeDataMsg = 0x0d NodeDataMsg = 0x0e GetReceiptsMsg = 0x0f ReceiptsMsg = 0x10 // Protocol messages belonging to dex/64 CoreBlockMsg = 0x20 VoteMsg = 0x21 AgreementMsg = 0x22 DKGPartialSignatureMsg = 0x24 PullBlocksMsg = 0x25 PullVotesMsg = 0x26 GetGovStateMsg = 0x29 GovStateMsg = 0x2a )
eth protocol message codes
const ( ErrMsgTooLarge = iota ErrDecode ErrInvalidMsgCode ErrProtocolVersionMismatch ErrNetworkIdMismatch ErrGenesisBlockMismatch ErrNoStatusMsg ErrExtraStatusMsg ErrSuspendedPeer ErrInvalidGovStateMsg )
const ProtocolMaxMsgSize = 10 * 1024 * 1024 // Maximum cap on the size of a protocol message
Variables ¶
var DefaultConfig = Config{ SyncMode: downloader.FastSync, NetworkId: 411, LightPeers: 100, DatabaseCache: 768, TrieCleanCache: 256, TrieDirtyCache: 256, TrieTimeout: 60 * time.Minute, TxPool: core.DefaultTxPoolConfig, GPO: gasprice.Config{ Blocks: 20, Percentile: 60, }, BlockProposerEnabled: false, DefaultGasPrice: big.NewInt(params.GWei), Indexer: indexer.Config{}, }
DefaultConfig contains default settings for use on the Ethereum main net.
var ProtocolLengths = []uint64{43}
ProtocolLengths are the number of implemented message corresponding to different protocol versions.
var ProtocolName = "dex"
ProtocolName is the official short name of the protocol used during capability negotiation.
var ProtocolVersions = []uint{dex64}
ProtocolVersions are the supported versions of the eth protocol (first is primary).
Functions ¶
func NewBlockProposer ¶
func NewBloomIndexer ¶
func NewBloomIndexer(db ethdb.Database, size, confirms uint64) *core.ChainIndexer
NewBloomIndexer returns a chain indexer that generates bloom bits data for the canonical chain for fast logs filtering.
Types ¶
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 BloomIndexer ¶
type BloomIndexer struct {
// contains filtered or unexported fields
}
BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index for the Ethereum 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.
type Config ¶
type Config struct { // The genesis block, which is inserted if the database is empty. // If nil, the Ethereum main net block is used. Genesis *core.Genesis `toml:",omitempty"` // PrivateKey, also represents the node identity. PrivateKey *ecdsa.PrivateKey `toml:",omitempty"` // Protocol options NetworkId uint64 // Network ID to use for selecting peers to connect to SyncMode downloader.SyncMode NoPruning bool // Whitelist of required block number -> hash values to accept Whitelist map[uint64]common.Hash `toml:"-"` // Light client options LightServ int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests LightPeers int `toml:",omitempty"` // Maximum number of LES client peers // Database options SkipBcVersionCheck bool `toml:"-"` DatabaseHandles int `toml:"-"` DatabaseCache int DatabaseDir string TrieCleanCache int TrieDirtyCache int TrieTimeout time.Duration // For calculate gas limit DefaultGasPrice *big.Int // Transaction pool options TxPool core.TxPoolConfig // Gas Price Oracle options GPO gasprice.Config // BlockProposer options BlockProposerEnabled bool // Enables tracking of SHA3 preimages in the VM EnablePreimageRecording bool // Miscellaneous options DocRoot string `toml:"-"` // Type of the EWASM interpreter ("" for default) EWASMInterpreter string // Type of the EVM interpreter ("" for default) EVMInterpreter string // RPCGasCap is the global gas cap for eth-call variants. RPCGasCap *big.Int `toml:",omitempty"` // Tangerine options DMoment int64 // Indexer config Indexer indexer.Config // Recovery network RPC RecoveryNetworkRPC string }
type DexAPIBackend ¶
type DexAPIBackend struct {
// contains filtered or unexported fields
}
DexAPIBackend implements ethapi.Backend for full nodes
func (*DexAPIBackend) AccountManager ¶
func (b *DexAPIBackend) AccountManager() *accounts.Manager
func (*DexAPIBackend) BlockByNumber ¶
func (b *DexAPIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
func (*DexAPIBackend) BloomStatus ¶
func (b *DexAPIBackend) BloomStatus() (uint64, uint64)
func (*DexAPIBackend) ChainConfig ¶
func (b *DexAPIBackend) ChainConfig() *params.ChainConfig
ChainConfig returns the active chain configuration.
func (*DexAPIBackend) ChainDb ¶
func (b *DexAPIBackend) ChainDb() ethdb.Database
func (*DexAPIBackend) CurrentBlock ¶
func (b *DexAPIBackend) CurrentBlock() *types.Block
func (*DexAPIBackend) Downloader ¶
func (b *DexAPIBackend) Downloader() ethapi.Downloader
func (*DexAPIBackend) EventMux ¶
func (b *DexAPIBackend) EventMux() *event.TypeMux
func (*DexAPIBackend) GetPoolNonce ¶
func (*DexAPIBackend) GetPoolTransaction ¶
func (b *DexAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction
func (*DexAPIBackend) GetPoolTransactions ¶
func (b *DexAPIBackend) GetPoolTransactions() (types.Transactions, error)
func (*DexAPIBackend) GetReceipts ¶
func (*DexAPIBackend) HeaderByHash ¶
func (*DexAPIBackend) HeaderByNumber ¶
func (b *DexAPIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)
func (*DexAPIBackend) ProtocolVersion ¶
func (b *DexAPIBackend) ProtocolVersion() int
func (*DexAPIBackend) RPCGasCap ¶
func (b *DexAPIBackend) RPCGasCap() *big.Int
func (*DexAPIBackend) SendTx ¶
func (b *DexAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
func (*DexAPIBackend) SendTxs ¶
func (b *DexAPIBackend) SendTxs(ctx context.Context, signedTxs []*types.Transaction) []error
func (*DexAPIBackend) ServiceFilter ¶
func (b *DexAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
func (*DexAPIBackend) SetHead ¶
func (b *DexAPIBackend) SetHead(number uint64)
func (*DexAPIBackend) StateAndHeaderByNumber ¶
func (b *DexAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)
func (*DexAPIBackend) Stats ¶
func (b *DexAPIBackend) Stats() (pending int, queued int)
func (*DexAPIBackend) SubscribeChainEvent ¶
func (b *DexAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
func (*DexAPIBackend) SubscribeChainHeadEvent ¶
func (b *DexAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
func (*DexAPIBackend) SubscribeChainSideEvent ¶
func (b *DexAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
func (*DexAPIBackend) SubscribeLogsEvent ¶
func (b *DexAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
func (*DexAPIBackend) SubscribeNewTxsEvent ¶
func (b *DexAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
func (*DexAPIBackend) SubscribeRemovedLogsEvent ¶
func (b *DexAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
func (*DexAPIBackend) SuggestPrice ¶
func (*DexAPIBackend) TxPoolContent ¶
func (b *DexAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
type DexconApp ¶
type DexconApp struct {
// contains filtered or unexported fields
}
DexconApp implements the DEXON consensus core application interface.
func NewDexconApp ¶
func NewDexconApp(txPool *core.TxPool, blockchain *core.BlockChain, gov *DexconGovernance, chainDB ethdb.Database, config *Config) *DexconApp
func (*DexconApp) BlockConfirmed ¶
BlockConfirmed is called when a block is confirmed.
func (*DexconApp) BlockDelivered ¶
func (d *DexconApp) BlockDelivered( blockHash coreCommon.Hash, blockPosition coreTypes.Position, rand []byte)
BlockDelivered is called when a block is add to the compaction chain.
func (*DexconApp) PreparePayload ¶
PreparePayload is called when consensus core is preparing payload for block.
func (*DexconApp) PrepareWitness ¶
PrepareWitness will return the witness data no lower than consensusHeight.
func (*DexconApp) SubscribeNewFinalizedBlockEvent ¶
func (d *DexconApp) SubscribeNewFinalizedBlockEvent( ch chan<- core.NewFinalizedBlockEvent) event.Subscription
func (*DexconApp) VerifyBlock ¶
func (d *DexconApp) VerifyBlock(block *coreTypes.Block) coreTypes.BlockVerifyStatus
VerifyBlock verifies if the payloads are valid.
type DexconGovernance ¶
type DexconGovernance struct { *core.Governance // contains filtered or unexported fields }
func NewDexconGovernance ¶
func NewDexconGovernance(backend *DexAPIBackend, chainConfig *params.ChainConfig, privKey *ecdsa.PrivateKey) *DexconGovernance
NewDexconGovernance returns a governance implementation of the DEXON consensus governance interface.
func (*DexconGovernance) AddDKGComplaint ¶
func (d *DexconGovernance) AddDKGComplaint(complaint *dkgTypes.Complaint)
AddDKGComplaint adds a DKGComplaint.
func (*DexconGovernance) AddDKGFinalize ¶
func (d *DexconGovernance) AddDKGFinalize(final *dkgTypes.Finalize)
AddDKGFinalize adds a DKG finalize message.
func (*DexconGovernance) AddDKGMPKReady ¶
func (d *DexconGovernance) AddDKGMPKReady(ready *dkgTypes.MPKReady)
AddDKGMPKReady adds a DKG mpk ready message.
func (*DexconGovernance) AddDKGMasterPublicKey ¶
func (d *DexconGovernance) AddDKGMasterPublicKey(masterPublicKey *dkgTypes.MasterPublicKey)
AddDKGMasterPublicKey adds a DKGMasterPublicKey.
func (*DexconGovernance) AddDKGSuccess ¶
func (d *DexconGovernance) AddDKGSuccess(success *dkgTypes.Success)
AddDKGSuccess adds a DKG success message.
func (*DexconGovernance) ProposeCRS ¶
func (d *DexconGovernance) ProposeCRS(round uint64, signedCRS []byte)
ProposeCRS send proposals of a new CRS
func (*DexconGovernance) RawConfiguration ¶
func (d *DexconGovernance) RawConfiguration(round uint64) (*params.DexconConfig, error)
RawConfiguration return raw config in state.
func (*DexconGovernance) ReportForkBlock ¶
func (d *DexconGovernance) ReportForkBlock(block1, block2 *coreTypes.Block)
ReportForkBlock reports a node for forking blocks.
func (*DexconGovernance) ReportForkVote ¶
func (d *DexconGovernance) ReportForkVote(vote1, vote2 *coreTypes.Vote)
ReportForkVote reports a node for forking votes.
func (*DexconGovernance) ResetDKG ¶
func (d *DexconGovernance) ResetDKG(newSignedCRS []byte)
func (*DexconGovernance) Round ¶
func (d *DexconGovernance) Round() uint64
type DexconNetwork ¶
type DexconNetwork struct {
// contains filtered or unexported fields
}
func NewDexconNetwork ¶
func NewDexconNetwork(pm *ProtocolManager) *DexconNetwork
func (*DexconNetwork) BroadcastAgreementResult ¶
func (n *DexconNetwork) BroadcastAgreementResult(result *types.AgreementResult)
BroadcastAgreementResult broadcasts rand request to DKG set.
func (*DexconNetwork) BroadcastBlock ¶
func (n *DexconNetwork) BroadcastBlock(block *types.Block)
BroadcastBlock broadcasts block to all nodes in DEXON network.
func (*DexconNetwork) BroadcastDKGPartialSignature ¶
func (n *DexconNetwork) BroadcastDKGPartialSignature( psig *dkgTypes.PartialSignature)
BroadcastDKGPartialSignature broadcasts partialSignature to all DKG participants.
func (*DexconNetwork) BroadcastDKGPrivateShare ¶
func (n *DexconNetwork) BroadcastDKGPrivateShare( prvShare *dkgTypes.PrivateShare)
BroadcastDKGPrivateShare broadcasts PrivateShare to all DKG participants.
func (*DexconNetwork) BroadcastVote ¶
func (n *DexconNetwork) BroadcastVote(vote *types.Vote)
BroadcastVote broadcasts vote to all nodes in DEXON network.
func (*DexconNetwork) PullBlocks ¶
func (n *DexconNetwork) PullBlocks(hashes coreCommon.Hashes)
PullBlocks tries to pull blocks from the DEXON network.
func (*DexconNetwork) PullVotes ¶
func (n *DexconNetwork) PullVotes(pos types.Position)
PullVotes tries to pull votes from the DEXON network.
func (*DexconNetwork) ReceiveChan ¶
func (n *DexconNetwork) ReceiveChan() <-chan types.Msg
ReceiveChan returns a channel to receive messages from DEXON network.
func (*DexconNetwork) ReportBadPeerChan ¶
func (n *DexconNetwork) ReportBadPeerChan() chan<- interface{}
ReportBadPeerChan returns a channel to receive messages from DEXON network.
func (*DexconNetwork) SendDKGPrivateShare ¶
func (n *DexconNetwork) SendDKGPrivateShare( pub crypto.PublicKey, prvShare *dkgTypes.PrivateShare)
SendDKGPrivateShare sends PrivateShare to a DKG participant.
type NodeInfo ¶
type NodeInfo struct { Network uint64 `json:"network"` // Network ID (411=Mainnet, 374=Testnet) Number uint64 `json:"number"` // 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 NotaryInfo ¶
type NotaryInfo struct { Round uint64 `json:"round"` IsNotary bool `json:"is_notary"` Nodes []*NotaryNodeInfo `json:"nodes"` IsNextNotary bool `json:"is_next_notary"` Next []*NotaryNodeInfo `json:"next"` }
type NotaryNodeInfo ¶
type PeerInfo ¶
type PeerInfo struct { Version int `json:"version"` // Ethereum protocol version negotiated Number uint64 `json:"number"` // Number 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 Ethereum full node-related APIs exposed over the private admin endpoint.
func NewPrivateAdminAPI ¶
func NewPrivateAdminAPI(dex *Tangerine) *PrivateAdminAPI
NewPrivateAdminAPI creates a new API definition for the full node private admin methods of the Ethereum 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.
func (*PrivateAdminAPI) IsCoreSyncing ¶
func (api *PrivateAdminAPI) IsCoreSyncing() bool
func (*PrivateAdminAPI) IsProposing ¶
func (api *PrivateAdminAPI) IsProposing() bool
func (*PrivateAdminAPI) NotaryInfo ¶
func (api *PrivateAdminAPI) NotaryInfo() (*NotaryInfo, error)
type PrivateDebugAPI ¶
type PrivateDebugAPI struct {
// contains filtered or unexported fields
}
PrivateDebugAPI is the collection of Ethereum full node APIs exposed over the private debugging endpoint.
func NewPrivateDebugAPI ¶
func NewPrivateDebugAPI(config *params.ChainConfig, dex *Tangerine) *PrivateDebugAPI
NewPrivateDebugAPI creates a new API definition for the full node-related private debug methods of the Ethereum 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 ¶
Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
func (*PrivateDebugAPI) StandardTraceBadBlockToFile ¶
func (api *PrivateDebugAPI) StandardTraceBadBlockToFile(ctx context.Context, hash common.Hash, config *StdTraceConfig) ([]string, error)
StandardTraceBadBlockToFile dumps the structured logs created during the execution of EVM against a block pulled from the pool of bad ones to the local file system and returns a list of files to the caller.
func (*PrivateDebugAPI) StandardTraceBlockToFile ¶
func (api *PrivateDebugAPI) StandardTraceBlockToFile(ctx context.Context, hash common.Hash, config *StdTraceConfig) ([]string, error)
StandardTraceBlockToFile dumps the structured logs created during the execution of EVM to the local file system and returns a list of files to the caller.
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) TraceBadBlock ¶
func (api *PrivateDebugAPI) TraceBadBlock(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)
TraceBadBlockByHash returns the structured logs created during the execution of EVM against a block pulled from the pool of bad ones and returns them as a JSON object.
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, mode downloader.SyncMode, networkID uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine, blockchain *core.BlockChain, chaindb ethdb.Database, whitelist map[uint64]common.Hash, isBlockProposer bool, gov governance, app dexconApp) (*ProtocolManager, error)
NewProtocolManager returns a new Ethereum sub protocol manager. The Ethereum sub protocol manages peers capable with the Ethereum network.
func (*ProtocolManager) BroadcastAgreementResult ¶
func (pm *ProtocolManager) BroadcastAgreementResult( agreement *coreTypes.AgreementResult)
func (*ProtocolManager) BroadcastBlock ¶
func (pm *ProtocolManager) BroadcastBlock(block *types.Block, propagate bool)
BroadcastBlock 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) BroadcastCoreBlock ¶
func (pm *ProtocolManager) BroadcastCoreBlock(block *coreTypes.Block)
BroadcastCoreBlock broadcasts the core block to all its peers.
func (*ProtocolManager) BroadcastDKGPartialSignature ¶
func (pm *ProtocolManager) BroadcastDKGPartialSignature( psig *dkgTypes.PartialSignature)
func (*ProtocolManager) BroadcastDKGPrivateShare ¶
func (pm *ProtocolManager) BroadcastDKGPrivateShare( privateShare *dkgTypes.PrivateShare)
func (*ProtocolManager) BroadcastFinalizedBlock ¶
func (pm *ProtocolManager) BroadcastFinalizedBlock(block *coreTypes.Block)
BroadcastFinalizedBlock broadcasts the finalized core block to some of its peers.
func (*ProtocolManager) BroadcastPullBlocks ¶
func (pm *ProtocolManager) BroadcastPullBlocks( hashes coreCommon.Hashes)
func (*ProtocolManager) BroadcastPullVotes ¶
func (pm *ProtocolManager) BroadcastPullVotes( pos coreTypes.Position)
func (*ProtocolManager) BroadcastTxs ¶
func (pm *ProtocolManager) BroadcastTxs(txs types.Transactions)
BroadcastTxs will propagate a batch of transactions to all peers which are not known to already have the given transaction.
func (*ProtocolManager) BroadcastVote ¶
func (pm *ProtocolManager) BroadcastVote(vote *coreTypes.Vote)
BroadcastVote broadcasts the given vote to all peers in same notary set
func (*ProtocolManager) NodeInfo ¶
func (pm *ProtocolManager) NodeInfo() *NodeInfo
NodeInfo retrieves some protocol metadata about the running host node.
func (*ProtocolManager) NotaryInfo ¶
func (pm *ProtocolManager) NotaryInfo() (*NotaryInfo, error)
func (*ProtocolManager) ReceiveChan ¶
func (pm *ProtocolManager) ReceiveChan() <-chan coreTypes.Msg
func (*ProtocolManager) ReportBadPeerChan ¶
func (pm *ProtocolManager) ReportBadPeerChan() chan<- interface{}
func (*ProtocolManager) SendDKGPrivateShare ¶
func (pm *ProtocolManager) SendDKGPrivateShare( pub coreCrypto.PublicKey, privateShare *dkgTypes.PrivateShare)
func (*ProtocolManager) SetReceiveCoreMessage ¶
func (pm *ProtocolManager) SetReceiveCoreMessage(enabled bool)
func (*ProtocolManager) Start ¶
func (pm *ProtocolManager) Start(srvr p2pServer, maxPeers int)
func (*ProtocolManager) Stop ¶
func (pm *ProtocolManager) Stop()
type PublicDebugAPI ¶
type PublicDebugAPI struct {
// contains filtered or unexported fields
}
PublicDebugAPI is the collection of Ethereum full node APIs exposed over the public debugging endpoint.
func NewPublicDebugAPI ¶
func NewPublicDebugAPI(dex *Tangerine) *PublicDebugAPI
NewPublicDebugAPI creates a new API definition for the full node- related public debug methods of the Ethereum 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 PublicEthereumAPI ¶
type PublicEthereumAPI struct {
// contains filtered or unexported fields
}
PublicEthereumAPI provides an API to access Ethereum full node-related information.
func NewPublicEthereumAPI ¶
func NewPublicEthereumAPI(e *Tangerine) *PublicEthereumAPI
NewPublicEthereumAPI creates a new Ethereum protocol API for full nodes.
func (*PublicEthereumAPI) ChainId ¶
func (api *PublicEthereumAPI) ChainId() hexutil.Uint64
ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
type Recovery ¶
type Recovery struct {
// contains filtered or unexported fields
}
func NewRecovery ¶
func NewRecovery(config *params.RecoveryConfig, networkRPC string, gov *DexconGovernance, privKey *ecdsa.PrivateKey) *Recovery
func (*Recovery) ProposeSkipBlock ¶
type StdTraceConfig ¶
StdTraceConfig holds extra parameters to standard-json trace functions.
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 Tangerine ¶
type Tangerine struct { APIBackend *DexAPIBackend // contains filtered or unexported fields }
Tangerine implements the DEXON fullnode service.
func (*Tangerine) AccountManager ¶
func (*Tangerine) BlockChain ¶
func (d *Tangerine) BlockChain() *core.BlockChain
func (*Tangerine) DexVersion ¶
func (*Tangerine) Downloader ¶
func (d *Tangerine) Downloader() ethapi.Downloader
func (*Tangerine) IsCoreSyncing ¶
func (*Tangerine) IsProposing ¶
func (*Tangerine) NetVersion ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package downloader contains the manual full chain synchronisation.
|
Package downloader contains the manual full chain synchronisation. |
Package fetcher contains the block announcement based synchronisation.
|
Package fetcher contains the block announcement based synchronisation. |