mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
parent
1efacaa8d3
commit
fbd1e79465
15
lite/doc.go
15
lite/doc.go
@ -15,9 +15,7 @@ for you, so you can just build nice applications.
|
|||||||
We design for clients who have no strong trust relationship with any Tendermint
|
We design for clients who have no strong trust relationship with any Tendermint
|
||||||
node, just the blockchain and validator set as a whole.
|
node, just the blockchain and validator set as a whole.
|
||||||
|
|
||||||
# Data structures
|
SignedHeader
|
||||||
|
|
||||||
## SignedHeader
|
|
||||||
|
|
||||||
SignedHeader is a block header along with a commit -- enough validator
|
SignedHeader is a block header along with a commit -- enough validator
|
||||||
precommit-vote signatures to prove its validity (> 2/3 of the voting power)
|
precommit-vote signatures to prove its validity (> 2/3 of the voting power)
|
||||||
@ -42,7 +40,7 @@ The FullCommit is also declared in this package as a convenience structure,
|
|||||||
which includes the SignedHeader along with the full current and next
|
which includes the SignedHeader along with the full current and next
|
||||||
ValidatorSets.
|
ValidatorSets.
|
||||||
|
|
||||||
## Verifier
|
Verifier
|
||||||
|
|
||||||
A Verifier validates a new SignedHeader given the currently known state. There
|
A Verifier validates a new SignedHeader given the currently known state. There
|
||||||
are two different types of Verifiers provided.
|
are two different types of Verifiers provided.
|
||||||
@ -56,11 +54,10 @@ greater).
|
|||||||
DynamicVerifier - this Verifier implements an auto-update and persistence
|
DynamicVerifier - this Verifier implements an auto-update and persistence
|
||||||
strategy to verify any SignedHeader of the blockchain.
|
strategy to verify any SignedHeader of the blockchain.
|
||||||
|
|
||||||
## Provider and PersistentProvider
|
Provider and PersistentProvider
|
||||||
|
|
||||||
A Provider allows us to store and retrieve the FullCommits.
|
A Provider allows us to store and retrieve the FullCommits.
|
||||||
|
|
||||||
```go
|
|
||||||
type Provider interface {
|
type Provider interface {
|
||||||
// LatestFullCommit returns the latest commit with
|
// LatestFullCommit returns the latest commit with
|
||||||
// minHeight <= height <= maxHeight.
|
// minHeight <= height <= maxHeight.
|
||||||
@ -68,23 +65,21 @@ type Provider interface {
|
|||||||
// minHeight <= height.
|
// minHeight <= height.
|
||||||
LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error)
|
LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error)
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
|
||||||
* client.NewHTTPProvider - query Tendermint rpc.
|
* client.NewHTTPProvider - query Tendermint rpc.
|
||||||
|
|
||||||
A PersistentProvider is a Provider that also allows for saving state. This is
|
A PersistentProvider is a Provider that also allows for saving state. This is
|
||||||
used by the DynamicVerifier for persistence.
|
used by the DynamicVerifier for persistence.
|
||||||
|
|
||||||
```go
|
|
||||||
type PersistentProvider interface {
|
type PersistentProvider interface {
|
||||||
Provider
|
Provider
|
||||||
|
|
||||||
// SaveFullCommit saves a FullCommit (without verification).
|
// SaveFullCommit saves a FullCommit (without verification).
|
||||||
SaveFullCommit(fc FullCommit) error
|
SaveFullCommit(fc FullCommit) error
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
|
||||||
* DBProvider - persistence provider for use with any libs/DB.
|
* DBProvider - persistence provider for use with any libs/DB.
|
||||||
|
|
||||||
* MultiProvider - combine multiple providers.
|
* MultiProvider - combine multiple providers.
|
||||||
|
|
||||||
The suggested use for local light clients is client.NewHTTPProvider(...) for
|
The suggested use for local light clients is client.NewHTTPProvider(...) for
|
||||||
@ -93,7 +88,7 @@ dbm.NewMemDB()), NewDBProvider("label", db.NewFileDB(...))) to store confirmed
|
|||||||
full commits (Trusted)
|
full commits (Trusted)
|
||||||
|
|
||||||
|
|
||||||
# How We Track Validators
|
How We Track Validators
|
||||||
|
|
||||||
Unless you want to blindly trust the node you talk with, you need to trace
|
Unless you want to blindly trust the node you talk with, you need to trace
|
||||||
every response back to a hash in a block header and validate the commit
|
every response back to a hash in a block header and validate the commit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user