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

[BP: v7 <- #1090] fix: allow use of HostPortOverride with full nodes #1092

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,8 @@ func (tn *ChainNode) CreateNodeContainer(ctx context.Context) error {
usingPorts[k] = v
}

if tn.Index == 0 && chainCfg.HostPortOverride != nil {
// to prevent port binding conflicts, host port overrides are only exposed on the first validator node.
if tn.Validator && tn.Index == 0 && chainCfg.HostPortOverride != nil {
for intP, extP := range chainCfg.HostPortOverride {
usingPorts[nat.Port(fmt.Sprintf("%d/tcp", intP))] = []nat.PortBinding{
{
Expand Down
3 changes: 2 additions & 1 deletion ibc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ type ChainConfig struct {
SidecarConfigs []SidecarConfig
// CoinDecimals for the chains base micro/nano/atto token configuration.
CoinDecimals *int64
//HostPortOverride exposes ports to the host
// HostPortOverride exposes ports to the host.
// To avoid port binding conflicts, ports are only exposed on the 0th validator.
HostPortOverride map[int]int `yaml:"host-port-override"`
// Additional start command arguments
AdditionalStartArgs []string
Expand Down
Loading