Handling secrets
Security and GitHub Preparation
Before pushing changes to GitHub or any public repository, ensure all sensitive information is properly secured:
Security Checklist
Environment Variables:
Never commit
.envfiles containing real API keys or private keysUse
.env.examplefiles with placeholder values insteadCheck that all
.envfiles are properly listed in.gitignore
Wallet Data:
All wallet files (JSON, keystore, etc.) should be excluded via
.gitignoreVerify no private keys or mnemonics are hardcoded in any files
API Keys:
Remove any hardcoded API keys from the codebase
Use environment variables or secure key management solutions
Test Data:
Sanitize test data to remove any sensitive information
Use mock data for tests rather than real account information
Before Commits:
Run
git statusto check which files will be committedReview changes with
git diffto ensure no secrets are includedConsider using a pre-commit hook to scan for sensitive information
Handling Secrets
For local development, secrets should be managed securely:
# Copy the example environment file
cp .env.example .env
# Edit the file with your actual credentials
nano .env # or use any text editorThe .gitignore file is configured to exclude sensitive files including:
.envfiles in all directoriesWallet data in
data/wallets/Secret keys in
data/secrets/Any files matching patterns like
*wallet*.json,*key*, etc.
Last updated


