Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: Listen on unused TCP port selected at random #387

Merged
merged 5 commits into from
Jun 10, 2019

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Jun 10, 2019

Relates to issue #144

Overview

  • The cardano-wallet server --port command-line argument is optional.
  • If no port is supplied, then an unused port will be selected at random.
  • The selected port will be logged.
  • Server listens on localhost only, not on all interfaces.
  • Integration tests still use fixed port 1337. It will need some refactoring for them to use any unused port.

Copy link
Member

@jonathanknowles jonathanknowles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! There are a couple of minor points that I've addressed in comments.

exe/wallet/Main.hs Show resolved Hide resolved
lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
Server.start settings wallet
let logStartup port = TIO.hPutStrLn stderr $
"Wallet backend server listening on: " <> toText port
Server.start logStartup walletPort wallet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it wouldn't be slightly "cleaner" to let start takes a Warp.Settings as a parameter. But no strong feeling on that.

@KtorZ KtorZ dismissed jonathanknowles’s stale review June 10, 2019 15:39

Points addressed 👍

@KtorZ
Copy link
Member

KtorZ commented Jun 10, 2019

Not sure why the CI check isn't reported to Github but CI has completed for a while already (and is green). Merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants