Documentation ¶
Index ¶
- Variables
- type ChainHighestBlock
- type ChainStateReader
- type ConnHandler
- type DownloaderFinishEvent
- type DownloaderStartEvent
- type GasPool
- type IBlockChain
- type IDownloader
- type IHeaderChain
- type IMiner
- type INetwork
- type IPeer
- type IPubSub
- type IStateDB
- type ITxsPool
- type MinedEntireEvent
- type NewLocalTxsEvent
- type NewLogsEvent
- type NewPendingLogsEvent
- type NewTxsEvent
- type Peer
- type PeerDropEvent
- type PeerJoinEvent
- type PeerMap
- type PeerSet
- type PrettyAge
- type PrettyDuration
- type ProtocolHandshakeFn
- type ProtocolHandshakeInfo
- type RemovedLogsEvent
- type Service
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ChainHighestBlock ¶
type ChainStateReader ¶
type ChainStateReader interface { BalanceAt(ctx context.Context, account types.Address, blockNumber uint256.Int) (uint256.Int, error) StorageAt(ctx context.Context, account types.Address, key types.Hash, blockNumber uint256.Int) ([]byte, error) CodeAt(ctx context.Context, account types.Address, blockNumber uint256.Int) ([]byte, error) NonceAt(ctx context.Context, account types.Address, blockNumber uint256.Int) (uint64, error) }
type DownloaderFinishEvent ¶
type DownloaderFinishEvent struct{}
DownloaderFinishEvent finish download
type GasPool ¶
type GasPool uint64
GasPool tracks the amount of gas available during execution of the transactions in a block. The zero value is a pool with zero gas available.
type IBlockChain ¶
type IBlockChain interface { IHeaderChain Config() *params.ChainConfig CurrentBlock() block.IBlock Blocks() []block.IBlock Start() error GenesisBlock() block.IBlock NewBlockHandler(payload []byte, peer peer.ID) error InsertChain(blocks []block.IBlock) (int, error) InsertBlock(blocks []block.IBlock, isSync bool) (int, error) SetEngine(engine consensus.Engine) GetBlocksFromHash(hash types.Hash, n int) (blocks []block.IBlock) SealedBlock(b block.IBlock) error Engine() consensus.Engine GetReceipts(blockHash types.Hash) (block.Receipts, error) GetLogs(blockHash types.Hash) ([][]*block.Log, error) SetHead(head uint64) error AddFutureBlock(block block.IBlock) error GetHeader(types.Hash, *uint256.Int) block.IHeader // alias for GetBlocksFromHash? GetBlock(hash types.Hash, number uint64) block.IBlock StateAt(tx kv.Tx, blockNr uint64) *state.IntraBlockState GetTd(hash types.Hash, number *uint256.Int) *uint256.Int HasBlock(hash types.Hash, number uint64) bool DB() kv.RwDB Quit() <-chan struct{} Close() error WriteBlockWithState(block block.IBlock, receipts []*block.Receipt, ibs *state.IntraBlockState, nopay map[types.Address]*uint256.Int) error GetDepositInfo(address types.Address) (*uint256.Int, *uint256.Int) GetAccountRewardUnpaid(account types.Address) (*uint256.Int, error) }
type IDownloader ¶
type IHeaderChain ¶
type INetwork ¶
type INetwork interface { WriterMessage(messageType message.MessageType, payload []byte, peer peer.ID) error //BroadcastMessage(messageType message.MessageType, payload []byte) (int, error) SetHandler(message.MessageType, ConnHandler) error ClosePeer(id peer.ID) error Start() error Host() host.Host PeerCount() int Bootstrapped() bool }
type IPeer ¶
type IPeer interface { ID() peer.ID Write(msg message.IMessage) error WriteMsg(messageType message.MessageType, payload []byte) error SetHandler(message.MessageType, ConnHandler) error ClearHandler(message.MessageType) error Close() error }
type IStateDB ¶
type IStateDB interface { CreateAccount(types.Address) SubBalance(addr types.Address, amount uint256.Int) AddBalance(addr types.Address, amount uint256.Int) GetBalance(addr types.Address) uint256.Int GetNonce(addr types.Address) uint64 SetNonce(addr types.Address, nonce uint64) GetCodeHash(addr types.Address) types.Hash GetCode(addr types.Address) []byte SetCode(addr types.Address, code []byte) GetCodeSize(addr types.Address) int AddRefund(uint64) SubRefund(uint64) GetRefund() uint64 GetCommittedState(types.Address, types.Hash) types.Hash GetState(types.Address, types.Hash) types.Hash SetState(types.Address, types.Hash, types.Hash) Suicide(types.Address) bool HasSuicided(types.Address) bool Exist(types.Address) bool Empty(types.Address) bool PrepareAccessList(sender types.Address, dest *types.Address, precompiles []types.Address, list transaction.AccessList) AddressInAccessList(addr types.Address) bool SlotInAccessList(addr types.Address, slot types.Hash) (addressOk bool, slotOk bool) AddAddressToAccessList(addr types.Address) AddSlotToAccessList(addr types.Address, slot types.Hash) RevertToSnapshot(int) Snapshot() int AddLog(*block.Log) GetLogs(hash types.Hash, blockHash types.Hash) []*block.Log TxIndex() int Prepare(thash types.Hash, ti int) Error() error }
type ITxsPool ¶
type ITxsPool interface { Service Has(hash types.Hash) bool Pending(enforceTips bool) map[types.Address][]*transaction.Transaction GetTransaction() ([]*transaction.Transaction, error) GetTx(hash types.Hash) *transaction.Transaction AddRemotes(txs []*transaction.Transaction) []error AddLocal(tx *transaction.Transaction) error Stats() (int, int, int, int) Nonce(addr types.Address) uint64 Content() (map[types.Address][]*transaction.Transaction, map[types.Address][]*transaction.Transaction) }
type MinedEntireEvent ¶
type MinedEntireEvent struct {
Entire state.EntireCode
}
type NewLocalTxsEvent ¶
type NewLocalTxsEvent struct{ Txs []*transaction.Transaction }
NewLocalTxsEvent local txs
type NewPendingLogsEvent ¶
NewPendingLogsEvent is posted when a reorg happens // todo miner v2
type PrettyAge ¶
PrettyAge is a pretty printed version of a time.Duration value that rounds the values up to a single most significant unit, days/weeks/years included.
type PrettyDuration ¶
PrettyDuration is a pretty printed version of a time.Duration value that cuts the unnecessary precision off from the formatted textual representation.
func (PrettyDuration) String ¶
func (d PrettyDuration) String() string
String implements the Stringer interface, allowing pretty printing of duration values rounded to three decimals.
type ProtocolHandshakeFn ¶
type RemovedLogsEvent ¶
RemovedLogsEvent is posted when a reorg happens // todo blockchain v2
type Service ¶
type Service interface { // Start spawns any goroutines required by the service. //Start() // Stop terminates all goroutines belonging to the service, // blocking until they are all terminated. Stop() error }
Service is a struct that can be registered into a ServiceRegistry for easy dependency management.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
blake2b
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
|
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb. |
bls
Package bls implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme.
|
Package bls implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme. |
bls/blst
Package blst implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme.
|
Package blst implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme. |
bls/common
Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
|
Package common provides the BLS interfaces that are implemented by the various BLS wrappers. |
bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
|
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. |
bn256/cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
|
Package bn256 implements a particular bilinear group at the 128-bit security level. |
bn256/google
Package bn256 implements a particular bilinear group.
|
Package bn256 implements a particular bilinear group. |
csidh
Package csidh implements commutative supersingular isogeny-based Diffie-Hellman key exchange algorithm (CSIDH) resulting from the group action.
|
Package csidh implements commutative supersingular isogeny-based Diffie-Hellman key exchange algorithm (CSIDH) resulting from the group action. |
dilithium
dilithium implements the CRYSTALS-Dilithium signature schemes as submitted to round3 of the NIST PQC competition and described in
|
dilithium implements the CRYSTALS-Dilithium signature schemes as submitted to round3 of the NIST PQC competition and described in |
dilithium/mode2
mode2 implements the CRYSTALS-Dilithium signature scheme Dilithium2 as submitted to round3 of the NIST PQC competition and described in
|
mode2 implements the CRYSTALS-Dilithium signature scheme Dilithium2 as submitted to round3 of the NIST PQC competition and described in |
dilithium/mode2aes
mode2aes implements the CRYSTALS-Dilithium signature scheme Dilithium2-AES as submitted to round3 of the NIST PQC competition and described in
|
mode2aes implements the CRYSTALS-Dilithium signature scheme Dilithium2-AES as submitted to round3 of the NIST PQC competition and described in |
dilithium/mode3
mode3 implements the CRYSTALS-Dilithium signature scheme Dilithium3 as submitted to round3 of the NIST PQC competition and described in
|
mode3 implements the CRYSTALS-Dilithium signature scheme Dilithium3 as submitted to round3 of the NIST PQC competition and described in |
dilithium/mode3aes
mode3aes implements the CRYSTALS-Dilithium signature scheme Dilithium3-AES as submitted to round3 of the NIST PQC competition and described in
|
mode3aes implements the CRYSTALS-Dilithium signature scheme Dilithium3-AES as submitted to round3 of the NIST PQC competition and described in |
dilithium/mode5
mode5 implements the CRYSTALS-Dilithium signature scheme Dilithium5 as submitted to round3 of the NIST PQC competition and described in
|
mode5 implements the CRYSTALS-Dilithium signature scheme Dilithium5 as submitted to round3 of the NIST PQC competition and described in |
dilithium/mode5aes
mode5aes implements the CRYSTALS-Dilithium signature scheme Dilithium5-AES as submitted to round3 of the NIST PQC competition and described in
|
mode5aes implements the CRYSTALS-Dilithium signature scheme Dilithium5-AES as submitted to round3 of the NIST PQC competition and described in |
keccakf1600
Package keccakf1600 provides a two and four-way Keccak-f[1600] permutation in parallel.
|
Package keccakf1600 provides a two and four-way Keccak-f[1600] permutation in parallel. |
kem
Package kem provides a unified interface for KEM schemes.
|
Package kem provides a unified interface for KEM schemes. |
kem/frodo
Package frodo provides the key encapsulation mechanism FrodoKEM.
|
Package frodo provides the key encapsulation mechanism FrodoKEM. |
kem/frodo/frodo640shake
Package frodo640shake implements the variant FrodoKEM-640 with SHAKE.
|
Package frodo640shake implements the variant FrodoKEM-640 with SHAKE. |
kem/kyber
Package kyber implements the CRYSTALS-Kyber.CCAKEM IND-CCA2 secure key encapsulation mechanism (KEM) as submitted to round 3 of the NIST PQC competition and described in
|
Package kyber implements the CRYSTALS-Kyber.CCAKEM IND-CCA2 secure key encapsulation mechanism (KEM) as submitted to round 3 of the NIST PQC competition and described in |
kem/kyber/kyber1024
Package kyber1024 implements the IND-CCA2 secure key encapsulation mechanism Kyber1024.CCAKEM as submitted to round 3 of the NIST PQC competition and described in
|
Package kyber1024 implements the IND-CCA2 secure key encapsulation mechanism Kyber1024.CCAKEM as submitted to round 3 of the NIST PQC competition and described in |
kem/kyber/kyber512
Package kyber512 implements the IND-CCA2 secure key encapsulation mechanism Kyber512.CCAKEM as submitted to round 3 of the NIST PQC competition and described in
|
Package kyber512 implements the IND-CCA2 secure key encapsulation mechanism Kyber512.CCAKEM as submitted to round 3 of the NIST PQC competition and described in |
kem/kyber/kyber768
Package kyber768 implements the IND-CCA2 secure key encapsulation mechanism Kyber768.CCAKEM as submitted to round 3 of the NIST PQC competition and described in
|
Package kyber768 implements the IND-CCA2 secure key encapsulation mechanism Kyber768.CCAKEM as submitted to round 3 of the NIST PQC competition and described in |
kyber/kyber512
kyber512 implements the IND-CPA-secure Public Key Encryption scheme Kyber512.CPAPKE as submitted to round 3 of the NIST PQC competition and described in
|
kyber512 implements the IND-CPA-secure Public Key Encryption scheme Kyber512.CPAPKE as submitted to round 3 of the NIST PQC competition and described in |
pke
Package pke provides a variety of public key encryption mechanisms.
|
Package pke provides a variety of public key encryption mechanisms. |
pke/kyber
Package kyber implements the CRYSTALS-Kyber.CPAPKE public key encryption as submitted to round 3 of the NIST PQC competition and described in
|
Package kyber implements the CRYSTALS-Kyber.CPAPKE public key encryption as submitted to round 3 of the NIST PQC competition and described in |
pke/kyber/kyber1024
kyber1024 implements the IND-CPA-secure Public Key Encryption scheme Kyber1024.CPAPKE as submitted to round 3 of the NIST PQC competition and described in
|
kyber1024 implements the IND-CPA-secure Public Key Encryption scheme Kyber1024.CPAPKE as submitted to round 3 of the NIST PQC competition and described in |
pke/kyber/kyber512
kyber512 implements the IND-CPA-secure Public Key Encryption scheme Kyber512.CPAPKE as submitted to round 3 of the NIST PQC competition and described in
|
kyber512 implements the IND-CPA-secure Public Key Encryption scheme Kyber512.CPAPKE as submitted to round 3 of the NIST PQC competition and described in |
pke/kyber/kyber768
kyber768 implements the IND-CPA-secure Public Key Encryption scheme Kyber768.CPAPKE as submitted to round 3 of the NIST PQC competition and described in
|
kyber768 implements the IND-CPA-secure Public Key Encryption scheme Kyber768.CPAPKE as submitted to round 3 of the NIST PQC competition and described in |
rand
Package rand defines methods of obtaining random number generators.
|
Package rand defines methods of obtaining random number generators. |
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |
keccakf1600/internal/asm
Module
|
|
kyber/internal/common/asm
Module
|
|
Package hexutil implements hex encoding with 0x prefix.
|
Package hexutil implements hex encoding with 0x prefix. |
Package math provides integer math utilities.
|
Package math provides integer math utilities. |
Package mclock is a wrapper for a monotonic clock source
|
Package mclock is a wrapper for a monotonic clock source |
Package prque implements a priority queue data structure supporting arbitrary value types and int64 priorities.
|
Package prque implements a priority queue data structure supporting arbitrary value types and int64 priorities. |