Documentation ¶
Index ¶
- func New(chainID, remote string) (provider.Provider, error)
- func NewWithClient(chainID string, client rpcclient.RemoteClient) provider.Provider
- func NewWithClientAndOptions(chainID string, client rpcclient.RemoteClient, options Options) provider.Provider
- func NewWithOptions(chainID, remote string, options Options) (provider.Provider, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a HTTP provider, which is using the rpchttp.HTTP client under the hood. If no scheme is provided in the remote URL, http will be used by default. The 5s timeout is used for all requests.
func NewWithClient ¶
func NewWithClient(chainID string, client rpcclient.RemoteClient) provider.Provider
func NewWithClientAndOptions ¶ added in v0.35.0
func NewWithClientAndOptions(chainID string, client rpcclient.RemoteClient, options Options) provider.Provider
NewWithClient allows you to provide a custom client.
Types ¶
type Options ¶ added in v0.35.0
type Options struct { // 0 means no retries MaxRetryAttempts uint16 // 0 means no timeout. Timeout time.Duration // The amount of requests that a client doesn't have the block // for before the provider deems the client unreliable NoBlockThreshold uint16 // The amount of requests that a client doesn't respond to // before the provider deems the client unreliable NoResponseThreshold uint16 }
Click to show internal directories.
Click to hide internal directories.