Sepolia Faucet 요청 (Google Cloud Web3 / Chainstack)
Ethereum Sepolia 테스트넷 ETH를 매일 받기 위한 스크립트입니다.
- Google Cloud Web3 Faucet: Ethereum Sepolia Faucet — 브라우저 자동화(Puppeteer). 로그인 필요.
- Chainstack API: 공개 API가 있는 대안. API 키 필요.
1. Google Cloud Web3 Faucet (Puppeteer)
설치
cd scripts/faucet-sepolia-daily
npm install
환경 변수
| 변수 | 필수 | 설명 |
|---|---|---|
ETH_WALLET_ADDRESS |
✅ | 받을 Sepolia 주소 (0x + 40자 hex) |
HEADED |
true 면 브라우저 표시 (첫 로그인·디버깅 시) |
|
USER_DATA_DIR |
Chrome 프로필 경로. 설정 시 로그인 유지. |
.env 예시:
ETH_WALLET_ADDRESS=0x1234567890123456789012345678901234567890
# HEADED=true
# USER_DATA_DIR=./chrome-profile
실행
# 첫 실행: 브라우저 뜨면 Google 로그인 후 요청 버튼까지 진행. 이후에는 프로필로 자동화 가능.
HEADED=true ETH_WALLET_ADDRESS=0x... node request-google-faucet.mjs
# 자동 실행 (headless)
ETH_WALLET_ADDRESS=0x... node request-google-faucet.mjs
# 또는
npm run google
- Google 계정 로그인이 필요합니다. 첫 번째 실행 시
HEADED=true로 한 번 로그인한 뒤,USER_DATA_DIR을 지정해 두면 다음부터는 headless로 실행할 수 있습니다. - 페이지 구조가 바뀌면 스크립트의 selector를 수정해야 할 수 있습니다. 실패 시
faucet-google-screenshot.png/faucet-google-error.png를 확인하세요.
2. Chainstack API (대안)
Chainstack Faucet API를 사용하면 브라우저 없이 요청할 수 있습니다.
환경 변수
| 변수 | 필수 | 설명 |
|---|---|---|
ETH_WALLET_ADDRESS |
✅ | 받을 Sepolia 주소 |
CHAINSTACK_API_KEY |
✅ | Chainstack 대시보드에서 발급한 API 키 |
실행
ETH_WALLET_ADDRESS=0x... CHAINSTACK_API_KEY=your_key node request-chainstack-api.mjs
# 또는
npm run chainstack
3. 매일 자동 실행 (cron)
매일 같은 시간에 한 번 실행하려면 crontab을 사용하세요.
crontab -e
예: 매일 오전 9시에 실행 (경로는 실제 경로로 바꾸세요)
0 9 * * * cd /path/to/faucet4Testing/scripts/faucet-sepolia-daily && ETH_WALLET_ADDRESS=0x... node request-google-faucet.mjs >> /tmp/faucet-sepolia.log 2>&1
Chainstack 사용 시:
0 9 * * * cd /path/to/faucet4Testing/scripts/faucet-sepolia-daily && ETH_WALLET_ADDRESS=0x... CHAINSTACK_API_KEY=xxx node request-chainstack-api.mjs >> /tmp/faucet-sepolia.log 2>&1