Skip to content

Commit a331f73

Browse files
authored
Update README.md
1 parent 57d4caa commit a331f73

File tree

1 file changed

+112
-32
lines changed

1 file changed

+112
-32
lines changed

README.md

Lines changed: 112 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ⚡ Celo Wallet Simulator
22

3-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Node.js](https://img.shields.io/badge/node-%3E%3D18-green)](https://nodejs.org/) [![CI](https://github.com/CryptoExplor/Celo-Wallet-Simulator/actions/workflows/node.yml/badge.svg)](https://github.com/CryptoExplor/Celo-Wallet-Simulator/actions) [![GitHub stars](https://img.shields.io/github/stars/CryptoExplor/Celo-Wallet-Simulator?style=social)](https://github.com/CryptoExplor/Celo-Wallet-Simulator/stargazers)
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Node.js](https://img.shields.io/badge/node-%3E%3D18-green)](https://nodejs.org/) [![CI](https://github.com/CryptoExplor/Celo-Wallet-Simulator/actions/workflows/node.yml/badge.svg)](https://github.com/CryptoExplor/Celo-Wallet-Simulator/actions) [![GitHub stars](https://img.shields.io/github/stars/CryptoExplor/Celo-Wallet-Simulator?style=social)](https://github.com/CryptoExplor/Celo-Wallet-Simulator/stargazers)
44

55
A lightweight **wallet activity simulator** for the **Celo blockchain**, designed for:
66

@@ -13,11 +13,15 @@ A lightweight **wallet activity simulator** for the **Celo blockchain**, designe
1313

1414
## 📦 Features
1515

16-
✅ Persona-driven wallet behavior (`personas.json`)
17-
✅ Configurable wait logic (adaptive random spacing)
18-
✅ Multi-RPC rotation for Celo endpoints
19-
✅ Structured CSV logging for analysis
20-
✅ JSON-based configuration (no hardcoding)
16+
***In-memory encrypted private keys** (AES-256-GCM) — private keys are kept encrypted in memory and decrypted only when required for signing.
17+
***Multi-master key support & rotation**`MASTER_KEY` with optional `BACKUP_KEYS` for recovery and key rotation.
18+
***Persona-driven wallet behavior** (`personas.json`) — idleBias, pingBias, activeHours, avgWait, retryBias, maxNonce, and device-agent.
19+
***Device-agent support** — per-wallet `User-Agent` and simulated latency to diversify fingerprints.
20+
***Configurable wait logic** — adaptive/random spacing to mimic organic activity.
21+
***Multi-RPC rotation & proxy support** — automatic failover across Celo RPC endpoints; supports HTTP(S) and SOCKS proxies (`proxy.txt`).
22+
***Adaptive activity patterns** — dynamic idleBias based on recent success/failure history.
23+
***Structured CSV logging** — daily rotated `tx_log_YYYY-MM-DD.csv` with buffered flushes.
24+
***Graceful shutdown** — signal handlers flush logs and persist personas.
2125

2226
---
2327

@@ -31,54 +35,130 @@ A lightweight **wallet activity simulator** for the **Celo blockchain**, designe
3135
npm install
3236
```
3337

34-
2. **Add wallets**
38+
2. **Configure environment**
3539

36-
* Create a `key.txt` file in the root directory.
37-
* Put **one private key per line**.
40+
Create a local `.env` (for testing only — do NOT commit) with at minimum:
3841

39-
3. **Run the simulator**
42+
```bash
43+
PRIVATE_KEYS="0xabc...\n0xdef..." # one key per line
44+
MASTER_KEY="your_master_passphrase"
45+
BACKUP_KEYS="oldMaster1,oldMaster2" # optional
46+
```
47+
48+
Or set these as OS-level environment variables (recommended for production).
49+
50+
3. **(Optional) Add legacy key file**
51+
52+
If you prefer legacy workflow, create `key.txt` with one private key per line — but `index.js` reads `PRIVATE_KEYS` env by default.
53+
54+
4. **Run the simulator**
4055

4156
```bash
4257
node index.js
4358
```
4459

45-
4. **View logs**
60+
5. **Stop gracefully**
4661

47-
* Generated in `tx_log_YYYY-MM-DD.csv` (daily rotation).
62+
* Press `Ctrl+C` — the process will flush logs and save persona state before exit.
4863

4964
---
5065

5166
## 📘 Documentation
5267

53-
📄 [Usage Guide](./USAGE.md) – setup, personas, logging, workflow
54-
📄 [Architecture](./ARCHITECTURE.md) – system design & internals
68+
* 📄 [Usage Guide](./USAGE.md) – setup, personas, logging, workflow
69+
* 📄 [Architecture](./ARCHITECTURE.md) – system design & internals
5570

5671
---
5772

58-
## 📂 Project Structure
59-
60-
```
61-
Celo-Wallet-Simulator/
62-
│── index.js # Main loop engine
63-
│── personas.json # Wallet persona configs
64-
│── key.txt # Wallet private keys (user-supplied)
65-
│── tx_log_*.csv # Daily transaction logs
66-
│── USAGE.md # Usage documentation
67-
│── ARCHITECTURE.md # Architecture documentation
68-
│── package.json
73+
## 🧩 Configuration & Files
74+
75+
* `index.js` — main runtime engine (encryption, personas, RPC/proxy logic, tx loop).
76+
* `personas.json` — persona defaults (created automatically if missing). The simulator also supports encrypted persona storage.
77+
* `inactive.json` — stores addresses marked outside their active hours (can be encrypted on disk if enabled).
78+
* `proxy.txt` — optional: one proxy URL per line (`http(s)://host:port` or `socks5://host:port`).
79+
* `key.txt` — legacy: one private key per line (not required if using `PRIVATE_KEYS` env).
80+
* `tx_log_YYYY-MM-DD.csv` — daily CSV logs with header: `timestamp,wallet,tx_hash,nonce,gas_used,gas_price_gwei,fee_celo,status,action`.
81+
82+
### Persona format (example)
83+
84+
Personas are stored as an object keyed by wallet address. Example:
85+
86+
```json
87+
{
88+
"0xabc...": {
89+
"idleBias": 0.12,
90+
"pingBias": 0.06,
91+
"minAmount": 0.0001,
92+
"maxAmount": 0.01,
93+
"activeHours": [2, 22],
94+
"cooldownAfterFail": 90,
95+
"avgWait": 45,
96+
"retryBias": 0.2,
97+
"maxNonce": 560,
98+
"failCount": 0,
99+
"lastFailAt": null,
100+
"deviceAgent": { "userAgent": "Chrome/102.0 (Windows NT 10.0)", "latency": 120 }
101+
}
102+
}
69103
```
70104

71105
---
72106

73-
## ⚠️ Disclaimer
107+
## 🔒 Security Notes
74108

75-
This project is provided for **educational and development purposes only**.
76-
It is intended to support Celo developers and infrastructure teams in:
109+
* **MASTER\_KEY** encrypts private keys in memory and is required at process start. Provide it via OS-level secrets or a secure vault in production.
110+
* **BACKUP\_KEYS** allow decrypting older encrypted blobs after key rotation. The script attempts decryption with all provided master keys.
111+
* **Session salt** is used for stronger ephemeral key derivation. If you require persistent encrypted artifacts across runs, use per-key persistent salts stored with the ciphertext.
112+
* **Encrypted personas/inactive storage**: the simulator supports encrypting `personas.json` and `inactive.json` on write and decrypting on load — enable this to protect persona metadata at rest.
113+
* **Never commit** `.env`, `key.txt`, or any file containing real private keys to version control.
114+
* Consider using HashiCorp Vault, AWS Secrets Manager, or similar for production secrets.
77115

78-
* Testing RPC endpoints
79-
* Simulating transaction activity
80-
* Analyzing network performance
116+
---
117+
118+
## 🕵️ Device Agent & Fake Latency
81119

82-
It should **not** be used for spam, Sybil attacks, or any form of abuse.
120+
* Each persona can include a `deviceAgent` object containing a `userAgent` string and a `latency` value (ms). The simulator uses `userAgent` when making HTTP/RPC calls where custom headers are supported and applies `latency` as a simulated network delay before/after RPC calls to diversify network footprints.
121+
* Device agents are persisted in personas (and can be encrypted on disk) so wallets keep consistent fingerprinting unless rotated deliberately.
83122

84123
---
124+
125+
## ⚙️ Adaptive Activity Patterns
126+
127+
* The simulator keeps simple success/failure counters per persona (`txSuccessCount`, `txFailCount`) and uses those to **adjust `idleBias` dynamically**.
128+
* If a wallet experiences repeated failures, `idleBias` increases to reduce activity (saving gas and avoiding repeated failures). When success rate improves, `idleBias` lowers to resume normal activity.
129+
130+
---
131+
132+
## 📈 Logging & Observability
133+
134+
* Transaction logs are buffered and flushed to daily CSV files every 5 minutes (configurable).
135+
* Consider integrating metrics or a dashboard (Prometheus / Grafana) for real-time monitoring and alerts (RPC failures, wallet depletion, repeated tx failures).
136+
137+
---
138+
139+
## 🛠️ Extensibility & Next Steps
140+
141+
Suggested improvements:
142+
143+
* Encrypted persona & inactive storage (implemented/optional)
144+
* Persistent per-key salts for long-term encrypted artifacts
145+
* Dashboard & metrics for live monitoring
146+
* Stable proxy-per-wallet assignment to simulate consistent geolocation
147+
148+
---
149+
150+
## 🤝 Contributing
151+
152+
Contributions welcome. Fork → branch → PR. Include tests and documentation for runtime changes.
153+
154+
---
155+
156+
## ⚠️ Disclaimer
157+
158+
This tool is for research, testing, and education. Do **not** use it for spam, Sybil attacks, or behavior that violates network terms. Use testnets wherever possible.
159+
160+
---
161+
162+
## 📜 License
163+
164+
Licensed under the terms in the [LICENSE](LICENSE) file.

0 commit comments

Comments
 (0)