-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(fuel-core-nats): automate running fuel-core-nats locally
- Loading branch information
1 parent
038fd41
commit adb8e9e
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
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,2 @@ | ||
INFURA_API_KEY=2d0fcc5e22... | ||
GENERATED_P2P_SECRET=930ge1d26cdd143e401923e69ca5d... |
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
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,42 @@ | ||
#!/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 | ||
|
||
check_env_var() { | ||
local var_name="$1" | ||
local var_value="${!var_name}" | ||
if [ -z "$var_value" ]; then | ||
echo "Environment variable $var_name is not set. Aborting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_env_var "INFURA_API_KEY" | ||
check_env_var "GENERATED_P2P_SECRET" | ||
|
||
ETH_RPC_ENDPOINT="https://sepolia.infura.io/v3/${INFURA_API_KEY}" | ||
P2P_SECRET="${GENERATED_P2P_SECRET}" | ||
|
||
cd ./crates/fuel-core-nats | ||
|
||
cargo run --all-features --bin fuel-core-nats -- \ | ||
--service-name "NATS Publisher Node" \ | ||
--ip 0.0.0.0 \ | ||
--port 4000 \ | ||
--peering-port 30333 \ | ||
--utxo-validation \ | ||
--poa-instant false \ | ||
--enable-p2p \ | ||
--keypair $P2P_SECRET \ | ||
--sync-header-batch-size=100 \ | ||
--enable-relayer \ | ||
--relayer ${ETH_RPC_ENDPOINT} \ | ||
--relayer-v2-listening-contracts=0x768f9459E3339A1F7d59CcF24C80Eb4A711a01FB \ | ||
--relayer-da-deploy-height=5791365 \ | ||
--relayer-log-page-size=2000 \ |