ong

package
v0.0.0-...-fb1a044 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: GPL-3.0 Imports: 48 Imported by: 0

Documentation

Overview

Package ong implements the Orange protocol.

Index

Constants

View Source
const AccountRangeMaxResults = 256

AccountRangeMaxResults is the maximum number of results to be returned per call

Variables

This section is empty.

Functions

This section is empty.

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 Config

type Config = ongconfig.Config

Config contains the configuration options of the ONG protocol. Deprecated: use ongconfig.Config instead.

type OngAPIBackend

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

OngAPIBackend implements ongapi.Backend for full nodes

func (*OngAPIBackend) AccountManager

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

func (*OngAPIBackend) BlockByHash

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

func (*OngAPIBackend) BlockByNumber

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

func (*OngAPIBackend) BlockByNumberOrHash

func (b *OngAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)

func (*OngAPIBackend) BloomStatus

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

func (*OngAPIBackend) ChainConfig

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

ChainConfig returns the active chain configuration.

func (*OngAPIBackend) ChainDb

func (b *OngAPIBackend) ChainDb() ongdb.Database

func (*OngAPIBackend) CurrentBlock

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

func (*OngAPIBackend) CurrentHeader

func (b *OngAPIBackend) CurrentHeader() *types.Header

func (*OngAPIBackend) Downloader

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

func (*OngAPIBackend) Engine

func (b *OngAPIBackend) Engine() consensus.Engine

func (*OngAPIBackend) EventMux

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

func (*OngAPIBackend) ExtRPCEnabled

func (b *OngAPIBackend) ExtRPCEnabled() bool

func (*OngAPIBackend) GetEVM

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

func (*OngAPIBackend) GetLogs

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

func (*OngAPIBackend) GetPoolNonce

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

func (*OngAPIBackend) GetPoolTransaction

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

func (*OngAPIBackend) GetPoolTransactions

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

func (*OngAPIBackend) GetReceipts

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

func (*OngAPIBackend) GetTd

func (b *OngAPIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int

func (*OngAPIBackend) GetTransaction

func (b *OngAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)

func (*OngAPIBackend) HeaderByHash

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

func (*OngAPIBackend) HeaderByNumber

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

func (*OngAPIBackend) HeaderByNumberOrHash

func (b *OngAPIBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)

func (*OngAPIBackend) Miner

func (b *OngAPIBackend) Miner() *miner.Miner

func (*OngAPIBackend) RPCGasCap

func (b *OngAPIBackend) RPCGasCap() uint64

func (*OngAPIBackend) RPCTxFeeCap

func (b *OngAPIBackend) RPCTxFeeCap() float64

func (*OngAPIBackend) SendTx

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

func (*OngAPIBackend) ServiceFilter

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

func (*OngAPIBackend) SetHead

func (b *OngAPIBackend) SetHead(number uint64)

func (*OngAPIBackend) StartMining

func (b *OngAPIBackend) StartMining(threads int) error

func (*OngAPIBackend) StateAndHeaderByNumber

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

func (*OngAPIBackend) StateAndHeaderByNumberOrHash

func (b *OngAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)

func (*OngAPIBackend) StateAtBlock

func (b *OngAPIBackend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64) (*state.StateDB, func(), error)

func (*OngAPIBackend) StateAtTransaction

func (b *OngAPIBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, func(), error)

func (*OngAPIBackend) StatesInRange

func (b *OngAPIBackend) StatesInRange(ctx context.Context, fromBlock *types.Block, toBlock *types.Block, reexec uint64) ([]*state.StateDB, func(), error)

func (*OngAPIBackend) Stats

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

func (*OngAPIBackend) SubscribeChainEvent

func (b *OngAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription

func (*OngAPIBackend) SubscribeChainHeadEvent

func (b *OngAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription

func (*OngAPIBackend) SubscribeChainSideEvent

func (b *OngAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription

func (*OngAPIBackend) SubscribeLogsEvent

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

func (*OngAPIBackend) SubscribeNewTxsEvent

func (b *OngAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription

func (*OngAPIBackend) SubscribePendingLogsEvent

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

func (*OngAPIBackend) SubscribeRemovedLogsEvent

func (b *OngAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription

func (*OngAPIBackend) SuggestPrice

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

func (*OngAPIBackend) TxPool

func (b *OngAPIBackend) TxPool() *core.TxPool

func (*OngAPIBackend) TxPoolContent

func (*OngAPIBackend) UnprotectedAllowed

func (b *OngAPIBackend) UnprotectedAllowed() bool

type Orange

type Orange struct {
	APIBackend *OngAPIBackend
	// contains filtered or unexported fields
}

Orange implements the Orange full node service.

func New

func New(stack *node.Node, config *ongconfig.Config) (*Orange, error)

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

func (*Orange) APIs

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

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

func (*Orange) AccountManager

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

func (*Orange) ArchiveMode

func (s *Orange) ArchiveMode() bool

func (*Orange) BlockChain

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

func (*Orange) BloomIndexer

func (s *Orange) BloomIndexer() *core.ChainIndexer

func (*Orange) ChainDb

func (s *Orange) ChainDb() ongdb.Database

func (*Orange) Downloader

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

func (*Orange) Engine

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

func (*Orange) EventMux

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

func (*Orange) IsListening

func (s *Orange) IsListening() bool

func (*Orange) IsMining

func (s *Orange) IsMining() bool

func (*Orange) Miner

func (s *Orange) Miner() *miner.Miner

func (*Orange) Orangerbase

func (s *Orange) Orangerbase() (eb common.Address, err error)

func (*Orange) Protocols

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

Protocols returns all the currently configured network protocols to start.

func (*Orange) ResetWithGenesisBlock

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

func (*Orange) SetOrangerbase

func (s *Orange) SetOrangerbase(ongerbase common.Address)

SetOrangerbase sets the mining reward address.

func (*Orange) Start

func (s *Orange) Start() error

Start implements node.Lifecycle, starting all internal goroutines needed by the Orange protocol implementation.

func (*Orange) StartMining

func (s *Orange) StartMining(threads int) error

StartMining starts the miner with the given number of CPU threads. If mining is already running, this Method adjust the number of threads allowed to use and updates the minimum price required by the transaction pool.

func (*Orange) Stop

func (s *Orange) Stop() error

Stop implements node.Lifecycle, terminating all internal goroutines used by the Orange protocol.

func (*Orange) StopMining

func (s *Orange) StopMining()

StopMining terminates the miner, both at the consensus engine level as well as at the block creation level.

func (*Orange) Synced

func (s *Orange) Synced() bool

func (*Orange) TxPool

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

type PrivateAdminAPI

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

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

func NewPrivateAdminAPI

func NewPrivateAdminAPI(ong *Orange) *PrivateAdminAPI

NewPrivateAdminAPI creates a new API definition for the full node private admin Methods of the Orange service.

func (*PrivateAdminAPI) ExportChain

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

ExportChain exports the current blockchain into a local file, or a range of blocks if first and last are non-nil

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 Orange full node APIs exposed over the private debugging endpoint.

func NewPrivateDebugAPI

func NewPrivateDebugAPI(ong *Orange) *PrivateDebugAPI

NewPrivateDebugAPI creates a new API definition for the full node-related private debug Methods of the Orange 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(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.

type PrivateMinerAPI

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

PrivateMinerAPI provides private RPC Methods to control the miner. These Methods can be abused by external users and must be considered insecure for use by untrusted users.

func NewPrivateMinerAPI

func NewPrivateMinerAPI(e *Orange) *PrivateMinerAPI

NewPrivateMinerAPI create a new RPC service which controls the miner of this node.

func (*PrivateMinerAPI) GetHashrate

func (api *PrivateMinerAPI) GetHashrate() uint64

GetHashrate returns the current hashrate of the miner.

func (*PrivateMinerAPI) SetExtra

func (api *PrivateMinerAPI) SetExtra(extra string) (bool, error)

SetExtra sets the extra data string that is included when this miner mines a block.

func (*PrivateMinerAPI) SetGasPrice

func (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool

SetGasPrice sets the minimum accepted gas price for the miner.

func (*PrivateMinerAPI) SetOrangerbase

func (api *PrivateMinerAPI) SetOrangerbase(ongerbase common.Address) bool

SetOrangerbase sets the ongerbase of the miner

func (*PrivateMinerAPI) SetRecommitInterval

func (api *PrivateMinerAPI) SetRecommitInterval(interval int)

SetRecommitInterval updates the interval for miner sealing work recommitting.

func (*PrivateMinerAPI) Start

func (api *PrivateMinerAPI) Start(threads *int) error

Start starts the miner with the given number of threads. If threads is nil, the number of workers started is equal to the number of logical CPUs that are usable by this process. If mining is already running, this Method adjust the number of threads allowed to use and updates the minimum price required by the transaction pool.

func (*PrivateMinerAPI) Stop

func (api *PrivateMinerAPI) Stop()

Stop terminates the miner, both at the consensus engine level as well as at the block creation level.

type PublicDebugAPI

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

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

func NewPublicDebugAPI

func NewPublicDebugAPI(ong *Orange) *PublicDebugAPI

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

func (*PublicDebugAPI) AccountRange

func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, start []byte, maxResults int, nocode, nostorage, incompletes bool) (state.IteratorDump, error)

AccountRange enumerates all accounts in the given block and start point in paging request

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 PublicMinerAPI

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

PublicMinerAPI provides an API to control the miner. It offers only Methods that operate on data that pose no security risk when it is publicly accessible.

func NewPublicMinerAPI

func NewPublicMinerAPI(e *Orange) *PublicMinerAPI

NewPublicMinerAPI create a new PublicMinerAPI instance.

func (*PublicMinerAPI) Mining

func (api *PublicMinerAPI) Mining() bool

Mining returns an indication if this node is currently mining.

type PublicOrangeAPI

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

PublicOrangeAPI provides an API to access Orange full node-related information.

func NewPublicOrangeAPI

func NewPublicOrangeAPI(e *Orange) *PublicOrangeAPI

NewPublicOrangeAPI creates a new Orange protocol API for full nodes.

func (*PublicOrangeAPI) ChainId

func (api *PublicOrangeAPI) ChainId() (hexutil.Uint64, error)

ChainId is the EIP-155 replay-protection chain id for the current orange chain config.

func (*PublicOrangeAPI) Coinbase

func (api *PublicOrangeAPI) Coinbase() (common.Address, error)

Coinbase is the address that mining rewards will be send to (alias for Orangerbase)

func (*PublicOrangeAPI) Hashrate

func (api *PublicOrangeAPI) Hashrate() hexutil.Uint64

Hashrate returns the POW hashrate

func (*PublicOrangeAPI) Orangerbase

func (api *PublicOrangeAPI) Orangerbase() (common.Address, error)

Orangerbase is the address that mining rewards will be send to

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.

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 header, blocks or transaction synchronisation.
Package fetcher contains the announcement based header, blocks or transaction synchronisation.
Package filters implements an orange filtering system for block, transactions and log events.
Package filters implements an orange filtering system for block, transactions and log events.
Package ongconfig contains the configuration of the ONG and LES protocols.
Package ongconfig contains the configuration of the ONG and LES protocols.
protocols
ong
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