Skip to content

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

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

feat(scripts): ETHGlobal faucet 每日自動領取機器人#13
jhfnetboy wants to merge 4 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

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