|
| 1 | +# 📘 Usage Guide – Celo Wallet Activity Simulator |
| 2 | + |
| 3 | +This document explains how to set up and use the **Celo Wallet Activity Simulator**, along with details of the **persona system** and log formats. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 🛠️ Setup |
| 8 | + |
| 9 | +1. **Clone the repo** |
| 10 | + |
| 11 | + ```bash |
| 12 | + git clone https://github.com/your-username/celo-wallet-simulator.git |
| 13 | + cd celo-wallet-simulator |
| 14 | + npm install |
| 15 | + ``` |
| 16 | + |
| 17 | +2. **Add wallet keys** |
| 18 | + |
| 19 | + * Create a file named `key.txt` in the root directory. |
| 20 | + * Place **one private key per line**: |
| 21 | + |
| 22 | + ``` |
| 23 | + 0xabc123... |
| 24 | + 0xdef456... |
| 25 | + ``` |
| 26 | +
|
| 27 | +3. **Run the simulator** |
| 28 | +
|
| 29 | + ```bash |
| 30 | + node index.js |
| 31 | + ``` |
| 32 | + |
| 33 | +4. **Check logs** |
| 34 | + |
| 35 | + * Transaction logs are saved as CSV files: |
| 36 | + |
| 37 | + ``` |
| 38 | + tx_log_2025-09-07.csv |
| 39 | + ``` |
| 40 | +
|
| 41 | +--- |
| 42 | +
|
| 43 | +## 🎭 Persona System |
| 44 | +
|
| 45 | +Each wallet is assigned a **persona** stored in `personas.json`. |
| 46 | +A persona defines how that wallet behaves over time. |
| 47 | +
|
| 48 | +### Fields |
| 49 | +
|
| 50 | +| Field | Description | Example | |
| 51 | +| ------------------- | ----------------------------------------------------------- | ------------------------ | |
| 52 | +| `idleBias` | Probability of skipping a cycle (wallet “rests”). | `0.12` (12% chance) | |
| 53 | +| `pingBias` | Probability of sending a **zero-value tx** (gas burn only). | `0.18` | |
| 54 | +| `minAmount` | Minimum CELO per normal tx. | `0.00007` | |
| 55 | +| `maxAmount` | Maximum CELO per normal tx. | `0.019` | |
| 56 | +| `activeHours` | Time window (UTC) when the wallet is “awake.” | `[8, 22]` | |
| 57 | +| `cooldownAfterFail` | Seconds to sleep after a failed tx. | `180` | |
| 58 | +| `avgWait` | Base wait time between tx (randomized ±20%). | `120` | |
| 59 | +| `retryBias` | Probability of retrying after a failure. | `0.4` | |
| 60 | +| `maxNonce` | Maximum nonce allowed for this wallet before retirement. | `590` | |
| 61 | +| `failCount` | Internal counter for failures. | `2` | |
| 62 | +| `lastFailAt` | Last failure timestamp. | `"2025-09-07T20:15:00Z"` | |
| 63 | +
|
| 64 | +> Personas evolve naturally as they’re saved/updated over multiple runs. |
| 65 | +
|
| 66 | +--- |
| 67 | +
|
| 68 | +## 📝 Log Format |
| 69 | +
|
| 70 | +Transactions are written to **daily CSV logs**. |
| 71 | +
|
| 72 | +### Example log line |
| 73 | +
|
| 74 | +```csv |
| 75 | +timestamp,wallet,tx_hash,nonce,gas_used,gas_price_gwei,fee_celo,status,action |
| 76 | +2025-09-07T20:30:25Z,0x1234...,0xabcd...,42,21000,2.5,0.0000525,confirmed,normal |
| 77 | +``` |
| 78 | + |
| 79 | +### Fields |
| 80 | + |
| 81 | +* **timestamp** – ISO UTC time of the tx |
| 82 | +* **wallet** – wallet address |
| 83 | +* **tx\_hash** – hash of the sent tx |
| 84 | +* **nonce** – wallet nonce at tx time |
| 85 | +* **gas\_used** – gas consumed (usually 21000 for transfers) |
| 86 | +* **gas\_price\_gwei** – gas price in gwei |
| 87 | +* **fee\_celo** – total fee paid in CELO |
| 88 | +* **status** – `confirmed`, `timeout`, `error`, `pending` |
| 89 | +* **action** – `normal` (value tx), `ping` (0-value), or other custom actions |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## 📌 Example Workflow |
| 94 | + |
| 95 | +* Wallet wakes up at 08:00 UTC. |
| 96 | +* Skips 10% of cycles due to `idleBias`. |
| 97 | +* Sends mostly small transfers (0.0001–0.01 CELO). |
| 98 | +* Occasionally sends 0 CELO pings (`pingBias`). |
| 99 | +* If a tx fails, waits 3–5 minutes before retrying. |
| 100 | +* Stops sending tx when nonce > `maxNonce`. |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## 🚀 Advanced Options |
| 105 | + |
| 106 | +* **Custom RPCs** |
| 107 | + Add or replace RPC URLs in `index.js` under `RPCS`. |
| 108 | +* **Persona Tweaks** |
| 109 | + Manually edit `personas.json` to fine-tune wallet behavior. |
| 110 | +* **Log Analysis** |
| 111 | + Import CSV logs into Excel, Python, or Grafana for visualization. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## ⚠️ Disclaimer |
| 116 | + |
| 117 | +This simulator is for **educational and development purposes only**. |
| 118 | +It is intended to help Celo developers and infrastructure teams test **RPC reliability, wallet activity patterns, and logging pipelines**. |
0 commit comments