diff --git a/cmd/serve.go b/cmd/serve.go index a9f1d577..646fbc82 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -113,7 +113,6 @@ func serve() { pm.Start(wg) defer pm.Stop() - rpcPort := nitroConfig.InProcessNode.RpcPort tlsCertFilepath := nitroConfig.InProcessNode.TlsCertFilepath 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 { logWithCommand.Fatal(err) } @@ -513,18 +512,24 @@ func initNitroRpcServer(node *nitroNode.Node, pm paymentsmanager.PaymentsManager } 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) defer jsonFile.Close() if err != nil { 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 nil, err } - var result map[string]*big.Int decoder := json.NewDecoder(jsonFile) err = decoder.Decode(&result) if err != nil { diff --git a/environments/example.toml b/environments/example.toml index 2c7e4b39..d5f2f603 100644 --- a/environments/example.toml +++ b/environments/example.toml @@ -45,12 +45,12 @@ caAddress = "" # NITRO_CA_ADDRESS useDurableStore = true # NITRO_USE_DURABLE_STORE durableStoreFolder = "./data/nitronode" # NITRO_DURABLE_STORE_FOLDER - msgPort = 3005 - rpcPort = 4005 - wsMsgPort = 5005 - chainStartBlock = 0 - tlsCertFilepath = "" - tlsKeyFilepath = "" + msgPort = 3005 # NITRO_MSG_PORT + rpcPort = 4005 # NITRO_RPC_PORT + wsMsgPort = 5005 # NITRO_WS_MSG_PORT + chainStartBlock = 0 # NITRO_CHAIN_START_BLOCK + tlsCertFilepath = "" # NITRO_TLS_CERT_FILEPATH + tlsKeyFilepath = "" # NITRO_TLS_KEY_FILEPATH [nitro.remoteNode] nitroEndpoint = "127.0.0.1:4005/api/v1" # NITRO_ENDPOINT diff --git a/environments/rates.json b/environments/rpcQueryRates.json similarity index 100% rename from environments/rates.json rename to environments/rpcQueryRates.json