Skip to content

Commit

Permalink
feat/api node for off oracle service [WIP] (#333)
Browse files Browse the repository at this point in the history
* Add new address field to `app.toml`

* Refactor typo

* Refactor naming

* Update oracle address port
  • Loading branch information
chungnicholas authored and yan-soon committed Sep 19, 2023
1 parent ec3b53b commit 2809888
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const (
// DefaultAPIAddress defines the default address to bind the API server to.
DefaultAPIAddress = "tcp://localhost:1317"

// DefaultOracleAPIAddress defines the default address for oracle service to bind the API server to.
DefaultOracleAPIAddress = "tcp://0.0.0.0:1328"

// DefaultGRPCAddress defines the default address to bind the gRPC server to.
DefaultGRPCAddress = "localhost:9090"

Expand Down Expand Up @@ -113,6 +116,9 @@ type APIConfig struct {
// Address defines the API server to listen on
Address string `mapstructure:"address"`

// OracleAddress defines if the API server to listen on for oracle service
OracleAddress string `mapstructure:"oracle-address"`

// MaxOpenConnections defines the number of maximum open connections
MaxOpenConnections uint `mapstructure:"max-open-connections"`

Expand Down Expand Up @@ -310,6 +316,7 @@ func DefaultConfig() *Config {
Enable: false,
Swagger: false,
Address: DefaultAPIAddress,
OracleAddress: DefaultOracleAPIAddress,
MaxOpenConnections: 1000,
RPCReadTimeout: 10,
RPCMaxBodyBytes: 1000000,
Expand Down
3 changes: 3 additions & 0 deletions server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ swagger = {{ .API.Swagger }}
# Address defines the API server to listen on.
address = "{{ .API.Address }}"
# Oracle-address defines the API server to listen on for oracle service.
oracle-address = "{{ .API.OracleAddress }}"
# MaxOpenConnections defines the number of maximum open connections.
max-open-connections = {{ .API.MaxOpenConnections }}
Expand Down

0 comments on commit 2809888

Please sign in to comment.