Skip to content

Commit 8d30fe5

Browse files
feat(randomness): make .env backup
1 parent b006fd8 commit 8d30fe5

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

apps/randomness/start-local-randomness.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ fi
155155
rm -rf logs
156156
mkdir logs
157157

158+
if [[ -f ".env.bak" ]]; then
159+
echo "Error: Backup file '.env.bak' already exists. Refusing to overwrite your existing backup."
160+
exit 1
161+
else
162+
cp .env .env.bak
163+
echo "Backup created: '.env.bak'"
164+
fi
165+
158166
echo "Starting Anvil..."
159167
anvil --block-time $BLOCK_TIME --port $ANVIL_RPC_PORT > "$SCRIPT_DIR/logs/anvil.log" 2>&1 &
160168
ANVIL_PID=$!

contracts/src/Randomness/Random.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ contract Random is RandomCommitment, Drand {
1212
* will be posted on a block with timestamp T (even if such a block exists) because of network delays.
1313
*/
1414
uint256 public constant DRAND_DELAY_SECONDS = 2;
15+
1516
/**
1617
* The minimum amount of time (in seconds) that commitments to future Drand randomness must be made
1718
* in advance. This delay is relative to Drand timestamp (so DRAND_DELAY must also be added).

0 commit comments

Comments
 (0)