Skip to content

Commit

Permalink
Let system decide which port to use for PoET gRPC in standalone mode (#…
Browse files Browse the repository at this point in the history
…5172)

## Motivation
Follow up to #5165

Additionally to Windows not liking `0.0.0.0` as connection address, the Windows GH runners sometimes disallow to listen on port 50002 (default for PoET gRPC). It seems to be an issue with some of the windows runners, since no other test uses a standalone PoET (so nothing should be listening there already) and it only appears to happen on Windows. Assigning a random (free) port as listen address seems generally a good idea (for parallelisation, less likely to fail, etc.)

## Changes
- changed `RawRPCListener` to use a random port instead of the default one if node is launched in standalone mode

## Test Plan
n/a

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed
- [x] Update [changelog](../CHANGELOG.md) as needed
  • Loading branch information
fasmat committed Oct 19, 2023
1 parent 32d337c commit 63d95b3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ func (app *App) launchStandalone(ctx context.Context) error {
return err
}
cfg.RawRESTListener = parsed.Host
cfg.RawRPCListener = parsed.Hostname() + ":0"
cfg.Genesis.UnmarshalFlag(app.Config.Genesis.GenesisTime)
cfg.Round.EpochDuration = app.Config.LayerDuration * time.Duration(app.Config.LayersPerEpoch)
cfg.Round.CycleGap = app.Config.POET.CycleGap
Expand Down

0 comments on commit 63d95b3

Please sign in to comment.