forked from cerc-io/ipld-eth-server
Handle review changes
This commit is contained in:
parent
71c028435d
commit
f2f951f7b8
13
cmd/serve.go
13
cmd/serve.go
@ -113,7 +113,6 @@ func serve() {
|
|||||||
pm.Start(wg)
|
pm.Start(wg)
|
||||||
defer pm.Stop()
|
defer pm.Stop()
|
||||||
|
|
||||||
rpcPort := nitroConfig.InProcessNode.RpcPort
|
|
||||||
tlsCertFilepath := nitroConfig.InProcessNode.TlsCertFilepath
|
tlsCertFilepath := nitroConfig.InProcessNode.TlsCertFilepath
|
||||||
tlsKeyFilepath := nitroConfig.InProcessNode.TlsKeyFilepath
|
tlsKeyFilepath := nitroConfig.InProcessNode.TlsKeyFilepath
|
||||||
|
|
||||||
@ -125,7 +124,7 @@ func serve() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, cert, rpcPort)
|
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, cert, nitroConfig.InProcessNode.RpcPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logWithCommand.Fatal(err)
|
logWithCommand.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -513,18 +512,24 @@ func initNitroRpcServer(node *nitroNode.Node, pm paymentsmanager.PaymentsManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readRpcQueryRates(filepath string) (map[string]*big.Int, error) {
|
func readRpcQueryRates(filepath string) (map[string]*big.Int, error) {
|
||||||
|
result := make(map[string]*big.Int)
|
||||||
|
|
||||||
|
if filepath == "" {
|
||||||
|
logWithCommand.Warn("RPC query rates file path not provided")
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
|
||||||
jsonFile, err := os.Open(filepath)
|
jsonFile, err := os.Open(filepath)
|
||||||
defer jsonFile.Close()
|
defer jsonFile.Close()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, fs.ErrNotExist) {
|
if errors.Is(err, fs.ErrNotExist) {
|
||||||
result := make(map[string]*big.Int)
|
logWithCommand.Warn("RPC query rates file does not exist")
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var result map[string]*big.Int
|
|
||||||
decoder := json.NewDecoder(jsonFile)
|
decoder := json.NewDecoder(jsonFile)
|
||||||
err = decoder.Decode(&result)
|
err = decoder.Decode(&result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -45,12 +45,12 @@
|
|||||||
caAddress = "" # NITRO_CA_ADDRESS
|
caAddress = "" # NITRO_CA_ADDRESS
|
||||||
useDurableStore = true # NITRO_USE_DURABLE_STORE
|
useDurableStore = true # NITRO_USE_DURABLE_STORE
|
||||||
durableStoreFolder = "./data/nitronode" # NITRO_DURABLE_STORE_FOLDER
|
durableStoreFolder = "./data/nitronode" # NITRO_DURABLE_STORE_FOLDER
|
||||||
msgPort = 3005
|
msgPort = 3005 # NITRO_MSG_PORT
|
||||||
rpcPort = 4005
|
rpcPort = 4005 # NITRO_RPC_PORT
|
||||||
wsMsgPort = 5005
|
wsMsgPort = 5005 # NITRO_WS_MSG_PORT
|
||||||
chainStartBlock = 0
|
chainStartBlock = 0 # NITRO_CHAIN_START_BLOCK
|
||||||
tlsCertFilepath = ""
|
tlsCertFilepath = "" # NITRO_TLS_CERT_FILEPATH
|
||||||
tlsKeyFilepath = ""
|
tlsKeyFilepath = "" # NITRO_TLS_KEY_FILEPATH
|
||||||
|
|
||||||
[nitro.remoteNode]
|
[nitro.remoteNode]
|
||||||
nitroEndpoint = "127.0.0.1:4005/api/v1" # NITRO_ENDPOINT
|
nitroEndpoint = "127.0.0.1:4005/api/v1" # NITRO_ENDPOINT
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user