Documentation ¶
Overview ¶
Copyright 2018 The sphinx Authors Modified based on go-ethereum, which Copyright (C) 2014 The go-ethereum Authors.
The sphinx is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The sphinx is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the sphinx. If not, see <http://www.gnu.org/licenses/>.
Copyright 2018 The sphinx Authors Modified based on go-ethereum, which Copyright (C) 2014 The go-ethereum Authors.
The sphinx is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The sphinx is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the sphinx. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- func DupDetect(tx *types.Transaction) bool
- func RoutineTxDupDetect(from chan *types.Transaction, to chan *types.Transaction, ...)
- func RoutineTxVarify(from chan *types.Transaction, to chan *types.Transaction, ...)
- func VerifyTx(tx *types.Transaction) bool
- type API
- type Prometheus
- func (c *Prometheus) APIs(chain consensus.ChainReader) []rpc.API
- func (c *Prometheus) Author(header *types.Header) (common.Address, error)
- func (c *Prometheus) Authorize(signer common.Address, signFn SignerFn)
- func (c *Prometheus) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (c *Prometheus) GenBlockWithSig(chain consensus.ChainReader, block *types.Block) (*types.Block, error)
- func (c *Prometheus) GenerateProof(chain consensus.ChainReader, header *types.Header, parent *types.Header, ...) (*types.WorkProof, error)
- func (c *Prometheus) GetSinger() common.Address
- func (c *Prometheus) MixHash(first, second common.Hash) (h common.Hash)
- func (c *Prometheus) PrepareBlockHeader(chain consensus.ChainReader, header *types.Header, state *state.StateDB) error
- func (c *Prometheus) RecoverSender(data []byte, signature []byte) (common.Address, error)
- func (c *Prometheus) SignData(data []byte) ([]byte, error)
- func (c *Prometheus) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool, ...) error
- func (c *Prometheus) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool, ...) (chan<- struct{}, <-chan error)
- func (c *Prometheus) VerifyProof(addr common.Address, lastHash common.Hash, proof *types.WorkProof) (common.Hash, error)
- func (c *Prometheus) VerifyProofQuick(lasthash common.Hash, txroot common.Hash, newHash common.Hash) error
- func (c *Prometheus) VerifyState(coinbase common.Address, history *set.Set, proof *types.WorkProof) bool
- type SignerFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DupDetect ¶
func DupDetect(tx *types.Transaction) bool
func RoutineTxDupDetect ¶
func RoutineTxDupDetect(from chan *types.Transaction, to chan *types.Transaction, dupCh chan interface{})
func RoutineTxVarify ¶
func RoutineTxVarify(from chan *types.Transaction, to chan *types.Transaction, errCh chan interface{})
func VerifyTx ¶
func VerifyTx(tx *types.Transaction) bool
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetLatestBlockHeader ¶
func (api *API) GetLatestBlockHeader(number *rpc.BlockNumber) (header *types.Header)
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
func InstancePrometheus ¶
func InstancePrometheus() *Prometheus
InstanceBlockChain returns the singleton of BlockChain.
func New ¶
func New(config *config.PrometheusConfig, db shxdb.Database) *Prometheus
func (*Prometheus) APIs ¶
func (c *Prometheus) APIs(chain consensus.ChainReader) []rpc.API
API for the terminal
func (*Prometheus) Authorize ¶
func (c *Prometheus) Authorize(signer common.Address, signFn SignerFn)
Authorize injects a private key into the consensus engine to mint new blocks with.
func (*Prometheus) Finalize ¶
func (c *Prometheus) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, proofs []*types.ProofState, receipts []*types.Receipt) (*types.Block, error)
func (*Prometheus) GenBlockWithSig ¶
func (c *Prometheus) GenBlockWithSig(chain consensus.ChainReader, block *types.Block) (*types.Block, error)
generate blocks by giving the signature
func (*Prometheus) GenerateProof ¶
func (c *Prometheus) GenerateProof(chain consensus.ChainReader, header *types.Header, parent *types.Header, txs types.Transactions, proofs types.ProofStates) (*types.WorkProof, error)
GenerateProof
func (*Prometheus) GetSinger ¶
func (c *Prometheus) GetSinger() common.Address
func (*Prometheus) MixHash ¶
func (c *Prometheus) MixHash(first, second common.Hash) (h common.Hash)
func (*Prometheus) PrepareBlockHeader ¶
func (c *Prometheus) PrepareBlockHeader(chain consensus.ChainReader, header *types.Header, state *state.StateDB) error
Prepare function for Block
func (*Prometheus) RecoverSender ¶
func (*Prometheus) VerifyHeader ¶
func (c *Prometheus) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool, mode config.SyncMode) error
Verify one header
func (*Prometheus) VerifyHeaders ¶
func (c *Prometheus) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool, mode config.SyncMode) (chan<- struct{}, <-chan error)
Verify the headers
func (*Prometheus) VerifyProof ¶
func (c *Prometheus) VerifyProof(addr common.Address, lastHash common.Hash, proof *types.WorkProof) (common.Hash, error)
VerifyProof
func (*Prometheus) VerifyProofQuick ¶
func (*Prometheus) VerifyState ¶
func (c *Prometheus) VerifyState(coinbase common.Address, history *set.Set, proof *types.WorkProof) bool
VerifyState