Skip to content

Commit

Permalink
refactor(fuel-core-nats): improve fuel core nats dev script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Jun 17, 2024
1 parent ab5091b commit fe3a6e4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 40 deletions.
40 changes: 0 additions & 40 deletions scripts/run-node.sh

This file was deleted.

49 changes: 49 additions & 0 deletions scripts/start-fuel-core-nats.sh
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 \

0 comments on commit fe3a6e4

Please sign in to comment.