Documentation ΒΆ
Index ΒΆ
- Variables
- type Lightnode
- type Options
- func (opts Options) WithBootstrapAddrs(bootstrapAddrs []wire.Address) Options
- func (opts Options) WithCap(cap int) Options
- func (opts Options) WithChains(chains map[multichain.Chain]binding.ChainOptions) Options
- func (opts Options) WithClientTimeout(clientTimeout time.Duration) Options
- func (opts Options) WithConfirmerPollRate(confirmerPollRate time.Duration) Options
- func (opts Options) WithDistPubKey(distPubKey *id.PubKey) Options
- func (opts Options) WithLimiterGlobalRates(rates map[string]rate.Limit) Options
- func (opts Options) WithLimiterIPRates(rates map[string]rate.Limit) Options
- func (opts Options) WithLimiterMaxClients(maxClients int) Options
- func (opts Options) WithLimiterTTL(ttl time.Duration) Options
- func (opts Options) WithMaxBatchSize(maxBatchSize int) Options
- func (opts Options) WithMaxGatewayCount(maxGatewayCount int) Options
- func (opts Options) WithMaxPageSize(maxPageSize int) Options
- func (opts Options) WithNetwork(network multichain.Network) Options
- func (opts Options) WithPort(port string) Options
- func (opts Options) WithServerTimeout(serverTimeout time.Duration) Options
- func (opts Options) WithTTL(ttl time.Duration) Options
- func (opts Options) WithTransactionExpiry(transactionExpiry time.Duration) Options
- func (opts Options) WithUpdaterPollRate(updaterPollRate time.Duration) Options
- func (opts Options) WithWatcherConfidenceInterval(watcherConfidenceInterval uint64) Options
- func (opts Options) WithWatcherMaxBlockAdvance(watcherMaxBlockAdvance uint64) Options
- func (opts Options) WithWatcherPollRate(watcherPollRate time.Duration) Options
- func (opts Options) WithWhitelist(whitelist []tx.Selector) Options
Constants ΒΆ
This section is empty.
Variables ΒΆ
var ( DefaultPort = "5000" DefaultCap = 128 DefaultMaxBatchSize = 10 DefaultMaxPageSize = 10 DefaultMaxGatewayCount = 10000 DefaultServerTimeout = 15 * time.Second DefaultClientTimeout = 15 * time.Second DefaultTTL = 3 * time.Second DefaultUpdaterPollRate = 5 * time.Minute DefaultConfirmerPollRate = confirmer.DefaultPollInterval DefaultWatcherPollRate = 15 * time.Second DefaultWatcherMaxBlockAdvance = uint64(1000) DefaultWatcherConfidenceInterval = uint64(6) DefaultTransactionExpiry = confirmer.DefaultExpiry DefaultBootstrapAddrs = []wire.Address{} DefaultLimiterIPRates = map[string]rate.Limit{"fallback": resolver.LimiterDefaultIPRate} DefaultLimiterGlobalRates = map[string]rate.Limit{"fallback": resolver.LimiterDefaultGlobalRate} DefaultLimiterTTL = resolver.LimiterDefaultTTL DefaultLimiterMaxClients = resolver.LimiterDefaultMaxClients )
Enumerate default options.
Functions ΒΆ
This section is empty.
Types ΒΆ
type Lightnode ΒΆ
type Lightnode struct {
// contains filtered or unexported fields
}
Lightnode is the top level container that encapsulates the functionality of the lightnode.
type Options ΒΆ
type Options struct { Network multichain.Network DistPubKey *id.PubKey Port string Cap int MaxBatchSize int MaxPageSize int MaxGatewayCount int ServerTimeout time.Duration ClientTimeout time.Duration TTL time.Duration UpdaterPollRate time.Duration ConfirmerPollRate time.Duration WatcherPollRate time.Duration WatcherMaxBlockAdvance uint64 WatcherConfidenceInterval uint64 TransactionExpiry time.Duration BootstrapAddrs []wire.Address Chains map[multichain.Chain]binding.ChainOptions Whitelist []tx.Selector LimiterGlobalRates map[string]rate.Limit LimiterIPRates map[string]rate.Limit LimiterTTL time.Duration LimiterMaxClients int }
Options to configure the precise behaviour of the Lightnode.
func DefaultOptions ΒΆ
func DefaultOptions() Options
DefaultOptions returns new options with default configurations that should work for the majority of use cases.
func (Options) WithBootstrapAddrs ΒΆ
WithBootstrapAddrs makes an initial list of nodes known to the node. These nodes will be used to bootstrap into the P2P network.
func (Options) WithChains ΒΆ
func (opts Options) WithChains(chains map[multichain.Chain]binding.ChainOptions) Options
WithChains is used to specify the chain options for a the supported chains.
func (Options) WithClientTimeout ΒΆ
WithClientTimeout updates the client timeout.
func (Options) WithConfirmerPollRate ΒΆ
WithConfirmerPollRate updates the confirmer poll rate.
func (Options) WithDistPubKey ΒΆ
WithDistPubKey updates the distributed public key.
func (Options) WithLimiterGlobalRates ΒΆ
WithLimiterGlobalRate is used to set global rate limits for specific methods
func (Options) WithLimiterIPRates ΒΆ
WithLimiterIpRate is used to set per-ip rate limits for specific methods
func (Options) WithLimiterMaxClients ΒΆ
WithLimiterMaxClients used to whitelist certain selectors inside the Darknode.
func (Options) WithLimiterTTL ΒΆ
WithLimiterTTL used to whitelist certain selectors inside the Darknode.
func (Options) WithMaxBatchSize ΒΆ
WithMaxBatchSize updates the maximum batch size when submitting requests.
func (Options) WithMaxGatewayCount ΒΆ
WithMaxGatewayCount is used to set the max number of gateways that can be persisted
func (Options) WithMaxPageSize ΒΆ
WithMaxPageSize updates the maximum page size when querying transactions.
func (Options) WithNetwork ΒΆ
func (opts Options) WithNetwork(network multichain.Network) Options
WithNetwork updates the network.
func (Options) WithServerTimeout ΒΆ
WithServerTimeout updates the server timeout.
func (Options) WithTransactionExpiry ΒΆ
WithTransactionExpiry updates the transaction expiry.
func (Options) WithUpdaterPollRate ΒΆ
WithUpdaterPollRate updates the updater poll rate.
func (Options) WithWatcherConfidenceInterval ΒΆ
WithWatcherPollRate updates the watcher poll rate.
func (Options) WithWatcherMaxBlockAdvance ΒΆ
WithWatcherPollRate updates the watcher poll rate.
func (Options) WithWatcherPollRate ΒΆ
WithWatcherPollRate updates the watcher poll rate.