-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(fuel-core-nats): improve fuel core nats dev script
- Loading branch information
1 parent
ab5091b
commit fe3a6e4
Showing
2 changed files
with
49 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
# Load environment variables from .env file | ||
if [ -f .env ]; then | ||
export $(grep -v '^#' .env | xargs) | ||
else | ||
echo ".env file not found. Please create a .env file using the '.env.sample' template and try again." | ||
exit 1 | ||
fi | ||
|
||
# Function to check if environment variables are set | ||
check_env_vars() { | ||
local missing_vars=0 | ||
|
||
while IFS= read -r line; do | ||
# Skip empty lines and comments | ||
[[ -z "$line" || "$line" == \#* ]] && continue | ||
|
||
# Extract the key | ||
key=$(echo "$line" | cut -d '=' -f 1) | ||
|
||
# Check if the key is set in the environment | ||
if [ -z "${!key}" ]; then | ||
echo "Environment variable $key is not set." | ||
missing_vars=$((missing_vars + 1)) | ||
fi | ||
done < ".env.sample" | ||
|
||
return $missing_vars | ||
} | ||
|
||
check_env_vars | ||
|
||
cargo run -p fuel-core-nats -- \ | ||
--service-name "NATS Publisher Node" \ | ||
--ip 0.0.0.0 \ | ||
--port 4000 \ | ||
--peering-port 30333 \ | ||
--db-path .dev/node-db \ | ||
--utxo-validation \ | ||
--poa-instant false \ | ||
--enable-p2p \ | ||
--keypair $KEYPAIR \ | ||
--sync-header-batch-size 100 \ | ||
--enable-relayer \ | ||
--relayer $RELAYER \ | ||
--relayer-v2-listening-contracts 0x768f9459E3339A1F7d59CcF24C80Eb4A711a01FB \ | ||
--relayer-da-deploy-height 5791365 \ | ||
--relayer-log-page-size 2000 \ |