prometheus

package
v0.0.0-...-dee6c83 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: GPL-3.0, LGPL-3.0 Imports: 21 Imported by: 0

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

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) Author

func (c *Prometheus) Author(header *types.Header) (common.Address, error)

retrieve the signer from the signature

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 (c *Prometheus) RecoverSender(data []byte, signature []byte) (common.Address, error)

func (*Prometheus) SignData

func (c *Prometheus) SignData(data []byte) ([]byte, error)

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 (c *Prometheus) VerifyProofQuick(lasthash common.Hash, txroot common.Hash, newHash common.Hash) error

func (*Prometheus) VerifyState

func (c *Prometheus) VerifyState(coinbase common.Address, history *set.Set, proof *types.WorkProof) bool

VerifyState

type SignerFn

type SignerFn func(accounts.Account, []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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