Remove placeholder BOT_PRIVATE_KEY= in .env.example

#1
by vruuu - opened

while running docker compose exec fly fly-trader wallet new, I encountered issue :
File "/app/fly_trader/chain/keys.py", line 99, in create_wallet
raise WalletExists(f"{path} already contains {ENV_NAME}; refusing to overwrite")
fly_trader.chain.keys.WalletExists: /app/.env already contains BOT_PRIVATE_KEY; refusing to overwrite

.env.example ships with a 'BOT_PRIVATE_KEY=' line present but empty. It looks like 'env_file_has_key()' only checks whether the variable name exists in the file, not whether it actually holds a value.
As per the create wallet code, it will append the .env file.

My fix was to change the .env and remove BOT_PRIVATE_KEY= line, run the command again and it's now in the .env, added on the last line.

Thanks β€” confirmed: env_file_has_key matches the empty placeholder, so wallet new refused on a fresh copy of .env.example. Merged.

bryceweiner changed pull request status to merged

Sign up or log in to comment