-
Notifications
You must be signed in to change notification settings - Fork 658
/
config.go
53 lines (39 loc) · 2.05 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package jsonrpc
import "github.com/0xPolygonHermez/zkevm-node/config/types"
// Config represents the configuration of the json rpc
type Config struct {
// Host defines the network adapter that will be used to serve the HTTP requests
Host string `mapstructure:"Host"`
// Port defines the port to serve the endpoints via HTTP
Port int `mapstructure:"Port"`
// ReadTimeout is the HTTP server read timeout
// check net/http.server.ReadTimeout and net/http.server.ReadHeaderTimeout
ReadTimeout types.Duration `mapstructure:"ReadTimeout"`
// WriteTimeout is the HTTP server write timeout
// check net/http.server.WriteTimeout
WriteTimeout types.Duration `mapstructure:"WriteTimeout"`
// MaxRequestsPerIPAndSecond defines how much requests a single IP can
// send within a single second
MaxRequestsPerIPAndSecond float64 `mapstructure:"MaxRequestsPerIPAndSecond"`
// SequencerNodeURI is used allow Non-Sequencer nodes
// to relay transactions to the Sequencer node
SequencerNodeURI string `mapstructure:"SequencerNodeURI"`
// MaxCumulativeGasUsed is the max gas allowed per batch
MaxCumulativeGasUsed uint64
// WebSockets configuration
WebSockets WebSocketsConfig `mapstructure:"WebSockets"`
// EnableL2SuggestedGasPricePolling enables polling of the L2 gas price to block tx in the RPC with lower gas price.
EnableL2SuggestedGasPricePolling bool `mapstructure:"EnableL2SuggestedGasPricePolling"`
// TraceBatchUseHTTPS enables, in the debug_traceBatchByNum endpoint, the use of the HTTPS protocol (instead of HTTP)
// to do the parallel requests to RPC.debug_traceTransaction endpoint
TraceBatchUseHTTPS bool `mapstructure:"TraceBatchUseHTTPS"`
}
// WebSocketsConfig has parameters to config the rpc websocket support
type WebSocketsConfig struct {
// Enabled defines if the WebSocket requests are enabled or disabled
Enabled bool `mapstructure:"Enabled"`
// Host defines the network adapter that will be used to serve the WS requests
Host string `mapstructure:"Host"`
// Port defines the port to serve the endpoints via WS
Port int `mapstructure:"Port"`
}