MCPcopy Create free account
hub / github.com/tendermint/tendermint / NewHTTPClientFromTrustedStore

Function NewHTTPClientFromTrustedStore

light/setup.go:48–68  ·  view source on GitHub ↗

NewHTTPClientFromTrustedStore initiates an instance of a light client using HTTP addresses for both the primary provider and witnesses and uses a trusted store as the root of trust. See all Option(s) for the additional configuration. See NewClientFromTrustedStore.

(
	chainID string,
	trustingPeriod time.Duration,
	primaryAddress string,
	witnessesAddresses []string,
	trustedStore store.Store,
	options ...Option)

Source from the content-addressed store, hash-verified

46// See all Option(s) for the additional configuration.
47// See NewClientFromTrustedStore.
48func NewHTTPClientFromTrustedStore(
49 chainID string,
50 trustingPeriod time.Duration,
51 primaryAddress string,
52 witnessesAddresses []string,
53 trustedStore store.Store,
54 options ...Option) (*Client, error) {
55
56 providers, err := providersFromAddresses(append(witnessesAddresses, primaryAddress), chainID)
57 if err != nil {
58 return nil, err
59 }
60
61 return NewClientFromTrustedStore(
62 chainID,
63 trustingPeriod,
64 providers[len(providers)-1],
65 providers[:len(providers)-1],
66 trustedStore,
67 options...)
68}
69
70func providersFromAddresses(addrs []string, chainID string) ([]provider.Provider, error) {
71 providers := make([]provider.Provider, len(addrs))

Callers

nothing calls this directly

Calls 2

providersFromAddressesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…