Skip to content

Commit

Permalink
Merge branch 'main' into version-to-1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemadero authored Jul 21, 2023
2 parents 9525f07 + c0b94d3 commit 278181c
Show file tree
Hide file tree
Showing 6 changed files with 807 additions and 772 deletions.
12 changes: 12 additions & 0 deletions local/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,18 @@ func (ln *localNetwork) loadConfig(ctx context.Context, networkConfig network.Co
return nil
}

// See network.Network
func (ln *localNetwork) GetNetworkID() (uint32, error) {
ln.lock.Lock()
defer ln.lock.Unlock()

if ln.stopCalled() {
return 0, network.ErrStopped
}

return ln.networkID, nil
}

// See network.Network
func (ln *localNetwork) AddNode(nodeConfig node.Config) (node.Node, error) {
ln.lock.Lock()
Expand Down
3 changes: 3 additions & 0 deletions network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ type BlockchainSpec struct {

// Network is an abstraction of an Avalanche network
type Network interface {
// Returns the network ID for the currently running network
// Returns ErrStopped if Stop() was previously called.
GetNetworkID() (uint32, error)
// Returns nil if all the nodes in the network are healthy.
// A stopped network is considered unhealthy.
// Timeout is given by the context parameter.
Expand Down
Loading

0 comments on commit 278181c

Please sign in to comment.