Skip to content

Commit f56e521

Browse files
committed
fix make port a dynamic variable
1 parent bdd00ce commit f56e521

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
PROVER_NODE_PORT=
3+
STREAMR_CLIENT_PORT=
4+
25
NETWORK_RPC_URL=https://rpc.mainnet.succinct.xyz
36
RPC_URL=https://eth-sepolia.g.alchemy.com/v2/URjQnzNCUHumxPFL8VDoFBmpX4uqL6X8
47
PRIVATE_KEY=

node/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ async fn main() {
147147
}
148148
});
149149

150+
let port = env::var("PROVER_NODE_PORT").unwrap_or_else(|_| "8080".to_string());
151+
let addr = format!("127.0.0.1:{}", port);
152+
150153
let app = Router::new()
151154
.route("/", get(root))
152155
.route("/health", get(health))
@@ -158,8 +161,8 @@ async fn main() {
158161
)
159162
.with_state(db_state);
160163

161-
println!("Starting server on http://localhost:8080");
162-
let listener = tokio::net::TcpListener::bind("127.0.0.1:8080")
164+
println!("Starting server on http://localhost:{}", port);
165+
let listener = tokio::net::TcpListener::bind(addr)
163166
.await
164167
.unwrap();
165168
axum::serve::serve(listener, app)

streamr-client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ initializeDatabase().then(async db => {
3030

3131
events.setMaxListeners(20)
3232
const app = express()
33-
const port = process.env.PORT || 3000
33+
const port = process.env.STREAMR_CLIENT_PORT || 3000
3434

3535
app.get('/health', res => {
3636
res.status(200).json({ status: 'ok' })

0 commit comments

Comments
 (0)