Skip to content

Commit 7ce3b24

Browse files
committed
fix: use PLATFORM_PUBLIC_URL for validator challenge containers
Validators need to reach the owner's platform-server at chain.platform.network, not a local container. Add PLATFORM_PUBLIC_URL env var support. Validators should set: PLATFORM_PUBLIC_URL=https://chain.platform.network
1 parent 60c3078 commit 7ce3b24

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

crates/challenge-orchestrator/src/docker.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,18 +577,23 @@ impl DockerClient {
577577
env.push(format!("DATABASE_URL={}/{}", db_url, challenge_db_name));
578578
}
579579
}
580-
// Pass Platform URL for metagraph verification
581-
// Use VALIDATOR_NAME to determine if we're server or validator
580+
// Local hostname for broker (always local)
582581
let platform_host = std::env::var("VALIDATOR_NAME")
583582
.map(|name| format!("platform-{}", name))
584583
.unwrap_or_else(|_| {
585584
std::env::var("VALIDATOR_CONTAINER_NAME")
586585
.unwrap_or_else(|_| "platform-server".to_string())
587586
});
588-
env.push(format!("PLATFORM_URL=http://{}:8080", platform_host));
587+
588+
// Pass Platform URL for metagraph verification and API calls
589+
// Priority: PLATFORM_PUBLIC_URL (for validators to reach owner's server) > local
590+
let platform_url = std::env::var("PLATFORM_PUBLIC_URL")
591+
.unwrap_or_else(|_| format!("http://{}:8080", platform_host));
592+
env.push(format!("PLATFORM_URL={}", platform_url));
589593

590594
// Pass Container Broker WebSocket URL for secure container spawning
591595
// Challenges connect to this broker instead of using Docker socket directly
596+
// Note: Broker is always local, not affected by PLATFORM_PUBLIC_URL
592597
let broker_port = std::env::var("BROKER_WS_PORT").unwrap_or_else(|_| "8090".to_string());
593598
env.push(format!(
594599
"CONTAINER_BROKER_WS_URL=ws://{}:{}",

0 commit comments

Comments
 (0)