mirror of
https://github.com/luxfi/netrunner.git
synced 2026-07-27 00:04:23 +00:00
update examples
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user