Skip to content

Commit

Permalink
fix: respect custom registry and explorer ports (#561)
Browse files Browse the repository at this point in the history
- if custom ports are provided in config.yaml, the port-forward script did not recognize them

Co-authored-by: Anmol <[email protected]>
  • Loading branch information
0xpatrickdev and Anmol1696 authored Oct 9, 2024
1 parent ec9d0ee commit e4e2a78
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 64 deletions.
22 changes: 13 additions & 9 deletions examples/cosmos-simapp-multi/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,21 @@ done

echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi
22 changes: 13 additions & 9 deletions examples/getting-started/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@ done

echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi
22 changes: 13 additions & 9 deletions examples/injective/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@ done

echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi
22 changes: 13 additions & 9 deletions examples/multi-chain/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@ done

echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi
22 changes: 13 additions & 9 deletions examples/neutron/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,21 @@ done

echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi
22 changes: 13 additions & 9 deletions examples/osmojs/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,21 @@ done

echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi
23 changes: 13 additions & 10 deletions starship/scripts/port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,23 @@ fi


echo "Port forward services"

if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/registry 8081:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry 9091:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".registry.enabled" $CONFIGFILE) == "true" ]]; then
registry_lcd_port=$(yq -r ".registry.ports.rest" $CONFIGFILE)
registry_grpc_port=$(yq -r ".registry.ports.grpc" $CONFIGFILE)
registry_lcd_port=${registry_lcd_port:-$REGISTRY_LCD_PORT}
registry_grpc_port=${registry_grpc_port:-$REGISTRY_GRPC_PORT}
kubectl port-forward service/registry ${registry_lcd_port}:$REGISTRY_LCD_PORT > /dev/null 2>&1 &
kubectl port-forward service/registry ${registry_grpc_port}:$REGISTRY_GRPC_PORT > /dev/null 2>&1 &
sleep 1
color yellow "registry: forwarded registry lcd to grpc http://localhost:8081, to http://localhost:9091"
color yellow "registry: forwarded registry lcd to http://localhost:${registry_lcd_port}, grpc to http://localhost:${registry_grpc_port}"
fi

if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]];
then
kubectl port-forward service/explorer 8080:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
if [[ $(yq -r ".explorer.enabled" $CONFIGFILE) == "true" ]]; then
explorer_port=$(yq -r ".explorer.ports.rest" $CONFIGFILE)
explorer_port=${explorer_port:-$EXPLORER_LCD_PORT}
kubectl port-forward service/explorer ${explorer_port}:$EXPLORER_LCD_PORT > /dev/null 2>&1 &
sleep 1
color green "Open the explorer to get started.... http://localhost:8080"
color green "Open the explorer to get started.... http://localhost:${explorer_port}"
fi

if [[ $(yq -r ".monitoring.enabled" $CONFIGFILE) == "true" ]];
Expand Down

0 comments on commit e4e2a78

Please sign in to comment.