github.com/iotexproject/iotex-core@v1.14.1-rc1/api/config.go (about) 1 // Copyright (c) 2022 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability 3 // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed. 4 // This source code is governed by Apache License 2.0 that can be found in the LICENSE file. 5 6 package api 7 8 import ( 9 "github.com/iotexproject/iotex-core/gasstation" 10 "github.com/iotexproject/iotex-core/pkg/tracer" 11 ) 12 13 // Config is the api service config 14 type Config struct { 15 UseRDS bool `yaml:"useRDS"` 16 GRPCPort int `yaml:"port"` 17 HTTPPort int `yaml:"web3port"` 18 WebSocketPort int `yaml:"webSocketPort"` 19 RedisCacheURL string `yaml:"redisCacheURL"` 20 TpsWindow int `yaml:"tpsWindow"` 21 GasStation gasstation.Config `yaml:"gasStation"` 22 RangeQueryLimit uint64 `yaml:"rangeQueryLimit"` 23 Tracer tracer.Config `yaml:"tracer"` 24 // BatchRequestLimit is the maximum number of requests in a batch. 25 BatchRequestLimit int `yaml:"batchRequestLimit"` 26 // WebsocketRateLimit is the maximum number of messages per second per client. 27 WebsocketRateLimit int `yaml:"websocketRateLimit"` 28 } 29 30 // DefaultConfig is the default config 31 var DefaultConfig = Config{ 32 UseRDS: false, 33 GRPCPort: 14014, 34 HTTPPort: 15014, 35 WebSocketPort: 16014, 36 TpsWindow: 10, 37 GasStation: gasstation.DefaultConfig, 38 RangeQueryLimit: 1000, 39 BatchRequestLimit: _defaultBatchRequestLimit, 40 WebsocketRateLimit: 5, 41 }