Skip to main content

Crate ton_net_lite

Crate ton_net_lite 

Source
Expand description

Liteserver read client for ton-net.

LiteClient speaks the liteserver query protocol over an ADNL connection and decodes the read responses into the domain types this crate defines. Nothing here checks anything: a read comes back as a ServerReported value, and the proof bytes travel with it for the layer above to verify.

LiteClient::masterchain_info reads the current masterchain head, LiteClient::account_state reads an account’s raw state at a given block, and LiteClient::block_proof asks for the links between two blocks. The facade above this crate wraps a LiteClient over a TCP transport and adds address parsing and a bundled config.

This crate maps the wire types from ton-net-tl into cleaner domain types: block sequence numbers become unsigned, and a response keeps only what a reader needs. The block-proof types are the exception and are re-exported as they come off the wire, because their reader is a verifier rather than a person. It is an internal crate of the ton-net client.

Structs§

AccountId
An account identifier: a workchain and a 256-bit account id.
AccountState
An account’s state as a liteserver reports it.
BlockIdExt
A full block identifier: the id and its shard coordinates plus hashes.
LiteClient
A read client for one liteserver.
MasterchainInfo
A masterchain head as a liteserver reports it.
PartialBlockProof
The block-proof types LiteClient::block_proof answers with, re-exported from ton-net-tl so a caller need not name that crate to read a chain. The liteServer.partialBlockProof response: as much of a proof chain as the server chose to send at once.
ServerReported
A value a liteserver returned without a checked proof.
Signature
The block-proof types LiteClient::block_proof answers with, re-exported from ton-net-tl so a caller need not name that crate to read a chain. One validator’s signature, in the liteServer.signature bare form.

Enums§

BlockLink
The block-proof types LiteClient::block_proof answers with, re-exported from ton-net-tl so a caller need not name that crate to read a chain. A liteServer.BlockLink: one step of a block proof chain.
LiteError
A failure reading from a liteserver.
SignatureSet
The block-proof types LiteClient::block_proof answers with, re-exported from ton-net-tl so a caller need not name that crate to read a chain. A liteServer.SignatureSet: what a set of validator signatures covers.