# Functions
GetBlock retrieves an entire block corresponding to the hash, assembling it back from the stored header and body.
GetBlockLogs retrieves the logs generated by the transactions included in a block given by its hash.
GetBlockReceipts retrieves the receipts generated by the transactions included in a block given by its hash.
GetBloomBits retrieves a batch of compressed bloomBits vectors belonging to the given bit index and section indexes
GetBloomBits: 检索一批属于给 定位索引 <given bit index> 和 section索引的 压缩bloomBits 集合.
GetBloomTrieRoot reads the BloomTrie root assoctiated to the given section from the database.
GetBody retrieves the block body (transactons, uncles) corresponding to the hash.
GetBodyRLP retrieves the block body (transactions and uncles) in RLP encoding.
No description provided by the author
GetChtRoot reads the CHT root assoctiated to the given section from the database Note that sectionIdx is specified according to LES/1 CHT section size
*
GetChtRoot:
从 db 中读取分配给给定 section 的CHT root。
请注意,sectionIdx 是遵循 LES/1 CHT section 大小指定的
入参 :
sectionIdx: 第几个 section !? (从 0 开始 !?)
sectionHead: section的第一个 block header Hash !?
*/.
GetChtV2Root reads the CHT root assoctiated to the given section from the database Note that sectionIdx is specified according to LES/2 CHT section size
*
GetChtV2Root:
从数据库中读取分配给给定节的CHT根。请注意,sectionIdx是根据 LES/2 CHT section大小指定的
*/.
No description provided by the author
NewBloomTrieIndexer creates a BloomTrie chain indexer
NewBloomTrieIndexer: 创建一个BloomTrie链索引器.
No description provided by the author
NewLightChain returns a fully initialised light chain using information available in the database.
NewNodeSet creates an empty node set.
No description provided by the author
No description provided by the author
NewTxPool creates a new light transaction pool.
StateTrieID returns a TrieID for a state trie belonging to a certain block header.
StorageTrieID returns a TrieID for a contract storage trie at a given account of a given state trie.
StoreBloomTrieRoot writes the BloomTrie root assoctiated to the given section into the database.
StoreChtRoot writes the CHT root assoctiated to the given section into the database Note that sectionIdx is specified according to LES/1 CHT section size
todo 重要.
# Constants
这个是 Client 每隔 32768 组一个 BloomTrie.
todo 用于Client.
todo 用于 Server.
todo 主要用于 Client 端 !?.
todo 重要用于 Server 端?.
# Variables
No description provided by the author
todo 规范hash trie 的相关node 的key的prefix.
No description provided by the author
ErrNoPeers is returned if no peers capable of serving a queued request are available.
No description provided by the author
No description provided by the author
NoOdr is the default context passed to an ODR capable function when the ODR service is not required.
# Structs
BlockRequest is the ODR request type for retrieving block bodies.
BloomRequest is the ODR request type for retrieving bloom filters from a CHT structure
BloomRequest: 是ODR请求类型,用于从CHT结构中检索的 Bloom过滤器.
BloomTrieIndexerBackend implements core.ChainIndexerBackend
todo 块分为固定长度的部分(LES BloomBits Trie的部分大小为32768块), BloomBits[bitIdx][sectionIdx]是一个32768位(4096字节)长的位向量, 其中包含来自块范围的每个Bloom过滤器的单个位 sectionIdx*SectionSize ..
ChtIndexerBackend implements core.ChainIndexerBackend.
ChtNode structures are stored in the Canonical Hash Trie in an RLP encoded format.
ChtRequest is the ODR request type for state/storage trie entries
*
ChtRequest:
是 state/storage Trie条目的ODR req类型
*/.
CodeRequest is the ODR request type for retrieving contract code.
LightChain represents a canonical chain that by default only handles block headers, downloading block bodies and receipts on demand through an ODR interface.
NodeSet stores a set of trie nodes.
ReceiptsRequest is the ODR request type for retrieving block bodies.
TrieID identifies a state or account storage trie.
TrieRequest is the ODR request type for state/storage trie entries.
TrustedCheckpoint represents a set of post-processed trie roots (CHT and BloomTrie) associated with the appropriate section index and head hash.
TxPool implements the transaction pool for light clients, which keeps track of the status of locally created transactions, detecting if they are included in a block (mined) or rolled back.
# Interfaces
OdrBackend is an interface to a backend service that handles ODR retrievals type
OdrBackend是处理ODR检索类型的后端服务的接口.
OdrRequest is an interface for retrieval requests.
TxRelayBackend provides an interface to the mechanism that forwards transacions to the ETH network.
# Type aliases
NodeList stores an ordered list of trie nodes.