-
Notifications
You must be signed in to change notification settings - Fork 113
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
fix(Docker): Set default RPC_PORT
#7162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Let's make sure it works with --target runtime too.
The `runtime-entrypoint.sh` uses the `RPC_PORT` env var when the user specifies the `getblocktemplate-rpc` feature, but this env var is unset unless the user sets it. This commit sets the default values for `RPC_PORT` depending on `NETWORK`.
f50331b
to
a81c309
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
runtime-entrypoint.sh
uses theRPC_PORT
env var when the user
specifies thegetblocktemplate-rpc
feature
Some users might want to use the Docker image with lightwalletd
, but without configuring getblocktemplate-rpcs
. So let's work out how to do that in another ticket.
Previously, the Dockerfile only activated the RPC port when it was set, but I agree that doesn't make sense with getblocktemplate-rpcs
:
8c90f65#diff-5b838857fc3410c2438196effdbdcffae6548bdba431a4a938e76a0be62d008eL49
So we might want logic like:
- If
getblocktemplate-rpcs
is activated, activate the default RPC port if it is unset - If there aren't any active RPC features, activate the RPC port only if it is set
- Otherwise, don't activate the RPC port
This covers the 3 different use cases of mining, light wallet, and no RPCs.
Motivation
I noticed we were using an unset
RPC_PORT
in the runtime entry point.Solution
The
runtime-entrypoint.sh
uses theRPC_PORT
env var when the userspecifies the
getblocktemplate-rpc
feature, but this env var is unsetunless the user sets it. This commit sets the default values for
RPC_PORT
depending onNETWORK
.Reviewer Checklist