-
Notifications
You must be signed in to change notification settings - Fork 0
/
scanner_config.go
39 lines (32 loc) · 994 Bytes
/
scanner_config.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
33
34
35
36
37
38
39
package scanner
import "time"
type ScannerOptions struct {
RpcURL string
BlockBatchSize uint64
MinimumConfirmationBlock uint64
PullInterval time.Duration
}
func DefaultScannerOptions() *ScannerOptions {
return &ScannerOptions{
RpcURL: "",
BlockBatchSize: 2000,
MinimumConfirmationBlock: 12,
PullInterval: 5 * time.Second,
}
}
func (opts *ScannerOptions) SetRpcURL(rpcUrl string) *ScannerOptions {
opts.RpcURL = rpcUrl
return opts
}
func (opts *ScannerOptions) SetBlockBatchSize(blockBatchSize uint64) *ScannerOptions {
opts.BlockBatchSize = blockBatchSize
return opts
}
func (opts *ScannerOptions) SetMinimumConfirmationBlock(minimumConfirmationBlock uint64) *ScannerOptions {
opts.MinimumConfirmationBlock = minimumConfirmationBlock
return opts
}
func (opts *ScannerOptions) SetPullInterval(pullInterval time.Duration) *ScannerOptions {
opts.PullInterval = pullInterval
return opts
}