/
subscribe_opts.go
32 lines (27 loc) · 1.37 KB
/
subscribe_opts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package ethutil
import "time"
const (
// DefaultSubscribeOptsTick is the default duration with which
// past events are pulled from the chain by the subscription monitoring
// mechanism if no other value is provided in SubscribeOpts when creating
// the subscription.
DefaultSubscribeOptsTick = 15 * time.Minute
// DefaultSubscribeOptsPastBlocks is the default number of past blocks
// pulled from the chain by the subscription monitoring mechanism if no
// other value is provided in SubscribeOpts when creating the subscription.
DefaultSubscribeOptsPastBlocks = 100
// SubscriptionBackoffMax is the maximum backoff time between event
// resubscription attempts.
SubscriptionBackoffMax = 2 * time.Minute
// SubscriptionAlertThreshold is time threshold below which event
// resubscription emits an error to the logs.
// WS connection can be dropped at any moment and event resubscription will
// follow. However, if WS connection for event subscription is getting
// dropped too often, it may indicate something is wrong with Ethereum
// client. This constant defines the minimum lifetime of an event
// subscription required before the subscription failure happens and
// resubscription follows so that the resubscription does not emit an error
// to the logs alerting about potential problems with Ethereum client
// connection.
SubscriptionAlertThreshold = 15 * time.Minute
)