From fbd1e79465bbb258ac85178e0073b42fec67b512 Mon Sep 17 00:00:00 2001 From: Infinytum <43315617+infinytum@users.noreply.github.com> Date: Thu, 24 Jan 2019 09:10:34 +0100 Subject: [PATCH] docs: fix lite client formatting (#3198) Closes #3180 --- lite/doc.go | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/lite/doc.go b/lite/doc.go index 429b096e2..c02b50214 100644 --- a/lite/doc.go +++ b/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 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 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 ValidatorSets. -## Verifier +Verifier A Verifier validates a new SignedHeader given the currently known state. There are two different types of Verifiers provided. @@ -56,35 +54,32 @@ greater). DynamicVerifier - this Verifier implements an auto-update and persistence strategy to verify any SignedHeader of the blockchain. -## Provider and PersistentProvider +Provider and PersistentProvider A Provider allows us to store and retrieve the FullCommits. -```go -type Provider interface { - // LatestFullCommit returns the latest commit with - // minHeight <= height <= maxHeight. - // If maxHeight is zero, returns the latest where - // minHeight <= height. - LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error) -} -``` + type Provider interface { + // LatestFullCommit returns the latest commit with + // minHeight <= height <= maxHeight. + // If maxHeight is zero, returns the latest where + // minHeight <= height. + LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error) + } * client.NewHTTPProvider - query Tendermint rpc. A PersistentProvider is a Provider that also allows for saving state. This is used by the DynamicVerifier for persistence. -```go -type PersistentProvider interface { - Provider + type PersistentProvider interface { + Provider - // SaveFullCommit saves a FullCommit (without verification). - SaveFullCommit(fc FullCommit) error -} -``` + // SaveFullCommit saves a FullCommit (without verification). + SaveFullCommit(fc FullCommit) error + } * DBProvider - persistence provider for use with any libs/DB. + * MultiProvider - combine multiple providers. 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) -# How We Track Validators +How We Track Validators 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