feat: add network validation and deployer balance check to deploy script - #189
Merged
phertyameen merged 2 commits intoJun 25, 2026
Conversation
…gelet-org#83) - Accept --network flag (default: testnet); errors on unknown args - When NODE_ENV is set, validate it matches --network to prevent accidental cross-environment deployments (e.g. testnet shell → mainnet) - Emit a 5-second countdown warning when --network=mainnet is used - Pre-flight: resolve the 'deployer' Stellar CLI identity and confirm the account exists on the target network; print a friendbot URL if not - Pre-flight: parse native balance and require ≥ 5 XLM (50_000_000 stroops) to cover base reserves + transaction fees before attempting deployment - Pass $NETWORK variable through to stellar contract deploy so the script is no longer hard-coded to testnet Closes bridgelet-org#83
|
@BigBen-7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@ please resolve conflict |
Contributor
Author
|
@phertyameen resolved. |
phertyameen
approved these changes
Jun 25, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens
scripts/deploy-testnet.shwith three pre-flight guards before any deployment attempt:--networkflag — script now accepts--network testnet|mainnet|futurenet(default:testnet). The hard-codedtestnetstring is replaced with$NETWORKthroughout.NODE_ENVcross-check — whenNODE_ENVis set in the shell, the script validates it matches--network. Prevents accidentally deploying to mainnet from a testnet-configured shell.Mainnet countdown — a 5-second abort window is printed before any mainnet deployment.
Deployer account existence check — resolves the
deployerStellar CLI identity and confirms the account exists on the target network. Prints a Friendbot funding URL if not found.Minimum balance check — requires ≥ 5 XLM (50,000,000 stroops) to cover base reserves and transaction fees. Errors with human-readable balance if too low.
Test plan
bash -n scripts/deploy-testnet.sh— syntax check passesNODE_ENVexits with clear error message--network mainnettriggers the countdown warningdeployeridentity produces actionable errorCloses #83