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
.env
files containing real API keys or private keysUse
.env.example
files with placeholder values insteadCheck that all
.env
files are properly listed in.gitignore
Wallet Data:
All wallet files (JSON, keystore, etc.) should be excluded via
.gitignore
Verify 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 status
to check which files will be committedReview changes with
git diff
to 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:
The .gitignore
file is configured to exclude sensitive files including:
.env
files in all directoriesWallet data in
data/wallets/
Secret keys in
data/secrets/
Any files matching patterns like
*wallet*.json
,*key*
, etc.
Last updated