Skip to content

Commit

Permalink
Update Sed to work on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
rzmahmood committed Dec 25, 2024
1 parent 6e2eaf8 commit b55e15c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ if [ "$FRESH_START" = true ]; then
cp networks/$EL_CHAIN_ID/app.toml $BEACON_CONFIG_DIR/config/app.toml
cp networks/$EL_CHAIN_ID/config.toml $BEACON_CONFIG_DIR/config/config.toml


# Rename the moniker in config.toml to the one configured in this script
sed -i '' "s/^moniker = \".*\"/moniker = \"$MONIKER_NAME\"/" "$BEACON_CONFIG_DIR/config/config.toml";
sed -i.bak "s/^moniker = \".*\"/moniker = \"$MONIKER_NAME\"/" "$BEACON_CONFIG_DIR/config/config.toml" && rm -f "$BEACON_CONFIG_DIR/config/config.toml.bak"

sed -i '' "s|^jwt-secret-path = \".*\"|jwt-secret-path = \"$JWT_PATH\"|" "$BEACON_CONFIG_DIR/config/app.toml";
# Update the jwt-secret-path in app.toml
sed -i.bak "s|^jwt-secret-path = \".*\"|jwt-secret-path = \"$JWT_PATH\"|" "$BEACON_CONFIG_DIR/config/app.toml" && rm -f "$BEACON_CONFIG_DIR/config/app.toml.bak"

# Add the CL seeds to the config.toml
seeds=$(cat networks/$EL_CHAIN_ID/cl-seeds.txt | tail -n +2 | tr '\n' ',' | sed 's/,$//');
sed -i '' "s/^seeds = \".*\"/seeds = \"$seeds\"/" "$BEACON_CONFIG_DIR/config/config.toml";
seeds=$(cat networks/$EL_CHAIN_ID/cl-seeds.txt | tail -n +2 | tr '\n' ',' | sed 's/,$//')
sed -i.bak "s/^seeds = \".*\"/seeds = \"$seeds\"/" "$BEACON_CONFIG_DIR/config/config.toml" && rm -f "$BEACON_CONFIG_DIR/config/config.toml.bak"

# Comma separated list of nodes to keep persistent connections to
sed -i '' "s/^persistent_peers = \".*\"/persistent_peers = \"$seeds\"/" "$BEACON_CONFIG_DIR/config/config.toml";
# Comma-separated list of nodes to keep persistent connections to
sed -i.bak "s/^persistent_peers = \".*\"/persistent_peers = \"$seeds\"/" "$BEACON_CONFIG_DIR/config/config.toml" && rm -f "$BEACON_CONFIG_DIR/config/config.toml.bak"

# Create JWT token for auth between Consensus Client and Execution Client
$BEACOND_BINARY jwt generate -o $JWT_PATH;
Expand Down

0 comments on commit b55e15c

Please sign in to comment.