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

Function NewHTTPClient

light/setup.go:18–40  ·  view source on GitHub ↗

NewHTTPClient initiates an instance of a light client using HTTP addresses for both the primary provider and witnesses of the light client. A trusted header and hash must be passed to initialize the client. See all Option(s) for the additional configuration. See NewClient.

(
	ctx context.Context,
	chainID string,
	trustOptions TrustOptions,
	primaryAddress string,
	witnessesAddresses []string,
	trustedStore store.Store,
	options ...Option)

Source from the content-addressed store, hash-verified

16// See all Option(s) for the additional configuration.
17// See NewClient.
18func NewHTTPClient(
19 ctx context.Context,
20 chainID string,
21 trustOptions TrustOptions,
22 primaryAddress string,
23 witnessesAddresses []string,
24 trustedStore store.Store,
25 options ...Option) (*Client, error) {
26
27 providers, err := providersFromAddresses(append(witnessesAddresses, primaryAddress), chainID)
28 if err != nil {
29 return nil, err
30 }
31
32 return NewClient(
33 ctx,
34 chainID,
35 trustOptions,
36 providers[len(providers)-1],
37 providers[:len(providers)-1],
38 trustedStore,
39 options...)
40}
41
42// NewHTTPClientFromTrustedStore initiates an instance of a light client using
43// HTTP addresses for both the primary provider and witnesses and uses a

Callers 2

startLightNodeFunction · 0.92
runProxyFunction · 0.92

Calls 2

providersFromAddressesFunction · 0.85
NewClientFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…