update examples

This commit is contained in:
Felipe Madero
2022-05-18 11:45:13 -03:00
parent 384c8e62ee
commit 6a93a04d65
2 changed files with 7 additions and 9 deletions
+3 -8
View File
@@ -68,9 +68,9 @@ func run(log logging.Logger, binaryPath string) error {
if err != nil {
return err
}
if err := nw.LoadConfig(context.Background(), local.NewDefaultConfig(binaryPath)); err != nil {
return err
}
if err := nw.LoadConfig(context.Background(), local.NewDefaultConfig(binaryPath)); err != nil {
return err
}
defer func() { // Stop the network when this function returns
if err := nw.Stop(context.Background()); err != nil {
log.Debug("error stopping network: %w", err)
@@ -95,11 +95,6 @@ func run(log logging.Logger, binaryPath string) error {
return err
}
err = nw.SaveSnapshot(context.Background(), "pepe")
if err != nil {
fmt.Printf("error saving snapshot %s\n", err)
}
log.Info("All nodes healthy. Network will run until you CTRL + C to exit...")
// Wait until done shutting down network after SIGINT/SIGTERM
<-closedOnShutdownCh
+4 -1
View File
@@ -68,10 +68,13 @@ func main() {
func run(log logging.Logger, binaryPath string) error {
// Create the network
nw, err := local.NewDefaultNetwork(log, binaryPath)
nw, err := local.NewNetwork(log, "", "")
if err != nil {
return err
}
if err := nw.LoadConfig(context.Background(), local.NewDefaultConfig(binaryPath)); err != nil {
return err
}
defer func() { // Stop the network when this function returns
if err := nw.Stop(context.Background()); err != nil {
log.Debug("error stopping network: %w", err)