Skip to content

feat(scripts): ETHGlobal faucet 每日自動領取機器人#13

Open
jhfnetboy wants to merge 9 commits into
mainfrom
feat/ethglobal-faucet-bot
Open

feat(scripts): ETHGlobal faucet 每日自動領取機器人#13
jhfnetboy wants to merge 9 commits into
mainfrom
feat/ethglobal-faucet-bot

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

功能

每天自動從 ETHGlobal Faucet 領取 18 條測試鏈的測試幣。

setup.js (一次性登錄) ──► browser-profile/ (持久化 session) ◄── claim.js (每天 headless)

文件

文件 說明
setup.js 打開 Chrome → 手動登錄 → 保存 session(一次性)
claim.js headless 模式逐鏈 Claim,支援 --dry-run / --headed / --chain
daily-claim.sh cron wrapper + 日誌管理
README.md 完整使用說明

特性

  • Playwright persistent context 復用登錄態
  • 23.5h cooldown 追蹤(claim-log.json
  • 自動跳過 CD 未到的鏈
  • 登錄態過期時中斷並報錯
  • 日誌自動保留 30 天

使用

cd scripts/ethglobal-faucet
pnpm install
npx playwright install chromium
node setup.js          # 一次性登錄
node claim.js --dry-run # 測試
node claim.js           # 正式領取

Playwright + persistent browser context 自動化方案:
- setup.js: 一次性登錄設置(打開 Chrome → 手動登錄 → 保存 session)
- claim.js: 每日 headless 領取 18 條鏈的測試幣
- daily-claim.sh: cron 包裝腳本 + 日誌管理
- 支持 --dry-run / --headed / --chain 參數
- 23.5h cooldown 追蹤,自動跳過未到時間的鏈
- 登錄態過期時中斷並報告
@jhfnetboy jhfnetboy requested a review from clestons as a code owner June 24, 2026 12:25
Playwright + stealth plugin 自動化方案:
- setup.js: 完整複製 Chrome Profile → 驗證 ETHGlobal 登錄態
- claim.js: headless 每日掃描 18 條鏈 → 逐鏈 Claim
- daily-claim.sh: cron wrapper + 日誌管理
- 支持 --dry-run / --headed / --chain
- 23.5h cooldown 追蹤、Unavailable 過濾、Cloudflare 繞過
- .gitignore 排除 browser-profile/logs/node_modules

research/hyphae-training: FedLoRA 聯邦學習文檔

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clestons review — #13 [2-round, APPROVE]

feat(scripts): ETHGlobal faucet 每日自動領取機器人 — 1 file (+374/-0). Pure research notes.

Note: PR body describes a faucet bot (setup.js / claim.js / daily-claim.sh) but the actual diff contains only research/hyphae-training/FedLoRA.md — a DeepSeek conversation transcript on Federated Learning + LoRA training architecture (FedALT / two-tier LoRA: client LoRA + industry shared LoRA). No code, no credentials.

Secret scan clean.

APPROVE. Merge is the maintainer's call.

clestons
clestons previously approved these changes Jun 29, 2026

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — functional dev automation script; two Low findings.

Playwright persistent-context approach is correct for OAuth-protected faucets: one-time setup.js saves browser profile; claim.js reuses it headlessly. Cooldown tracking via local JSON log (claim-log.json) + canClaim check prevents redundant requests. Random inter-chain delay (2000 + Math.random()*2000ms) avoids rate-limiting. Login expiry detected and breaks the loop cleanly. --dry-run flag in place for safe testing.

[Low — F1] daily-claim.sh: set -e without set -o pipefail

node claim.js 2>&1 | tee -a "$LOG"

set -e exits on error from the last command in a pipeline (tee, which exits 0). If claim.js exits non-zero, the cron job silently continues. The ${PIPESTATUS[0]} in the trailing echo is logged but doesn't trigger exit. Add set -o pipefail after set -e to propagate node exit status through the pipe.

[Low — F2] Claim log not flushed before process exit

saveClaimLog is called synchronously only on r.status === 'success'. If the process is killed mid-run (SIGTERM from cron timeout, OOM, etc.) after a chain is successfully claimed but before the loop saves the log, that chain appears unclaimed next run. Server-side cooldown prevents double-funding, but causes an extra page load and potential faucet rate-limit hit. Consider saving the log after each chain regardless of status, or using process.on('exit', ...) as a flush hook.

PK: Brood#13 is a dev-only automation script — findings are Low, no correctness blockers.

PK Summary | 1 round · 2 Low findings · 0 missed

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Brood#13 — feat(scripts): ETHGlobal faucet 每日自動領取機器人

Playwright + 持久化浏览器 context 的工具脚本,用于每日自动从 ETHGlobal faucet 领取测试币。

功能正确性 ✓

  • setup.js:一次性手动登录保存 session;claim.js:headless 每日领取
  • 23.5h cooldown 追踪(JSON log),跳过未到时间的链 ✓
  • 登录态过期时中断报告(logged_out 状态),不会静默失败 ✓
  • --dry-run / --headed / --chain 参数支持 ✓
  • daily-claim.sh cron 包装 ✓

安全 ✓

  • 无硬编码凭据,用持久化浏览器 profile 保存 session
  • browser-profile/claim-log.json 为本地运行时产物,建议在 .gitignore 中排除(若尚未排除)

工具类脚本,无协议安全影响。

APPROVE

clestons
clestons previously approved these changes Jul 7, 2026

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Verdict: APPROVE — Pure documentation/changelog/version-bump PR. No production code changes. BUMP track.

jhfnetboy added 4 commits July 7, 2026 16:52
Progress chart:
- backlog/data/progress-history.json: 历史扫描数据存储(12次记录 2026-03-18→07-07)
- scripts/export-backlog.js: 构建时生成 dist/progress-chart.html + 注入浮动 📈 按钮

sync-context-reverse 2026-07-07:
Phase 1: SuperPaymaster/CLAUDE.md 补全 Mycelium @-include
Phase 2: PROFILE.md AirAccount v0.16.7→v0.27.3-Beta5; SuperPaymaster v4.4.0→v5.4.1-rc.1
         INTERFACES.md AirAccount/SuperPaymaster/aastar-sdk 版本全量更新
Phase 4: aastar depends_on 能力名 ai-inference→ai-agent-framework(修复名称不匹配)
         mycelium PROFILE.md 新增 nostr-relay 能力声明
Phase 5: ECOSYSTEM_MAP.md 时间戳全量刷新(65个 Active + 2个 Dormant); 新增 cos72-tour

Claude-Session: https://claude.ai/code/session_01NxHLuPR2gkpM5DTf5RR13v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants