Add a PaymentsManager with Nitro node initialization

This commit is contained in:
2023-10-13 13:55:41 +05:30
parent 2708d02558
commit 76aba989e7
5 changed files with 197 additions and 58 deletions
+4 -9
View File
@@ -26,7 +26,7 @@ import (
"time"
"github.com/cerc-io/ipld-eth-server/v5/pkg/log"
"github.com/cerc-io/ipld-eth-server/v5/pkg/nitro"
"github.com/cerc-io/ipld-eth-server/v5/pkg/payments"
"github.com/ethereum/go-ethereum/rpc"
"github.com/mailgun/groupcache/v2"
"github.com/spf13/cobra"
@@ -98,11 +98,8 @@ func serve() {
// TODO: Create required config for Nitro node
// TODO: Create a new Nitro node using the config
nitro, _ := nitro.NewNitroNode()
// TODO: Start the Nitro node, pass wg
nitro.Start(wg)
paymentsManager, _ := payments.NewPaymentsManager(true)
paymentsManager.Start(wg)
shutdown := make(chan os.Signal, 1)
signal.Notify(shutdown, os.Interrupt)
@@ -111,9 +108,7 @@ func serve() {
graphQL.Stop()
}
server.Stop()
// TODO: Stop nitro node
nitro.Stop()
paymentsManager.Stop()
wg.Wait()
}