Skip to content

Conversation

@graham-chainlink
Copy link
Contributor

@graham-chainlink graham-chainlink commented Aug 13, 2025

Allow a different port other than 9000 for sui to be mapped on the host since 9000 can be consumed by other apps.

Also updated the docker image used by ton smoke as the existing one no longer working

=== RUN   TestTonSmoke/setup:connect
    smoke_ton_test.go:35: 
        	Error Trace:	/home/runner/work/chainlink-testing-framework/chainlink-testing-framework/framework/examples/myproject/smoke_ton_test.go:35
        	Error:      	Received unexpected error:
        	            	Get "http://localhost:8000/localhost.global.config.json": read tcp [::1]:44428->[::1]:8000: read: connection reset by peer
        	Test:       	TestTonSmoke/setup:connect
        	Messages:   	Failed to get config from URL

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-500


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes ensure that Sui blockchain components correctly manage default and user-specified ports, improving usability and flexibility. The update in the example project aims to align with development standards by using a development image version.

What

  • framework/components/blockchain/sui.go
    • Added an import for "github.com/docker/go-connections/nat" to handle NAT port mappings more effectively.
    • Modified the defaultSui function to set in.Port to DefaultSuiNodePort if it's empty, ensuring a default port is always used if not specified by the user.
    • Updated newSui function to define containerPort as the Sui container's internal default port (DefaultSuiNodePort) and use it for container port mappings. This change allows mapping the user-specified host port to the container's internal port.
    • Adjusted HostConfigModifier in testcontainers.ContainerRequest to use nat.PortMap for port bindings, ensuring the correct external to internal port mappings.
    • Changed ExternalHTTPUrl and InternalHTTPUrl to use DefaultSuiNodePort for the internal URL, providing consistency with how the container is accessed internally.
  • framework/examples/myproject/smoke_ton.toml
    • Updated the image configuration for blockchain_a from ghcr.io/neodix42/mylocalton-docker:latest to ghcr.io/neodix42/mylocalton-docker:dev, aligning with development practices by using a development image.

Allow a different port other than 9000 for sui to be mapped on the host since 9000 can be consumed by other apps.

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-500
The latest image for ton is no longer working as it cant be started up, dev still works
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-500/custom-port-mapping-sui branch from 492ea81 to 39f30e4 Compare August 13, 2025 06:04
@graham-chainlink graham-chainlink marked this pull request as ready for review August 13, 2025 06:16
@graham-chainlink graham-chainlink requested a review from a team as a code owner August 13, 2025 06:16
[blockchain_a]
type = "ton"
image = "ghcr.io/neodix42/mylocalton-docker:latest"
image = "ghcr.io/neodix42/mylocalton-docker:dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

curious: why? also, don't they have a more stable tag?

Copy link
Contributor Author

@graham-chainlink graham-chainlink Aug 13, 2025

Choose a reason for hiding this comment

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

if we look https://github.com/neodix42/mylocalton-docker/pkgs/container/mylocalton-docker, i think dev is more stable, last change is 3 months ago, but latest is released few days ago and it is broken.

@graham-chainlink graham-chainlink merged commit dfe2ae0 into main Aug 13, 2025
81 of 88 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/cld-500/custom-port-mapping-sui branch August 13, 2025 08:32
github-merge-queue bot pushed a commit to smartcontractkit/chainlink-deployments-framework that referenced this pull request Aug 14, 2025
Previously sui node always occupy port 9000 on the host because there
was no way to customize it. Since then i have made [a change in
CTF](smartcontractkit/chainlink-testing-framework#2044)
to allow that ability.

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-500
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.

2 participants