genlayer-cli
Skill này làm gì
Skill này giải thích cách dùng công cụ dòng lệnh genlayer để triển khai và tương tác với contract thông minh. Nó bao gồm chuyển đổi giữa các mạng và kiểm tra giao dịch, dành cho lập trình viên làm việc với GenLayer Studio hoặc các testnet GenLayer.
Khi nào nên dùng
- ✓Khi bạn muốn triển khai một contract GenLayer từ dòng lệnh.
- ✓Khi bạn cần chuyển đổi giữa các mạng local, studio hoặc testnet của GenLayer.
- ✓Khi một giao dịch gửi đến contract GenLayer thất bại và bạn muốn kiểm tra nó.
Liên kết skill
https://github.com/internet-court/internet-court-skill/blob/main/vendored/genlayer/genlayer-cli/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi muốn triển khai contract GenLayer lên testnet Bradbury và xem kết quả giao dịch.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent cài công cụ, chọn mạng bạn cần, rồi chạy các lệnh để triển khai, gọi và kiểm tra contract. Skill khuyên chọn một mạng có sẵn thay vì nhập địa chỉ tùy chỉnh, vì cài đặt có sẵn giữ cấu hình chuỗi đúng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
GenLayer CLI
The genlayer CLI manages contract deployment, interaction, transaction inspection, and network configuration. Works with GenLayer Studio (local), studio.genlayer.com, and Testnet Bradbury.
Setup
npm install -g genlayer
Network Configuration
genlayer network set # Interactive selector
genlayer network set testnet-bradbury # Direct
genlayer network info # Show current network config
genlayer network list # List all networks
Networks: localnet, studionet, testnet-asimov, testnet-bradbury
Note: studionet is gasless — no tokens are required to deploy or interact with contracts. A 0 GEN balance is expected and does not prevent any operations.
Note: studionet is rate-limited per IP — 60 req/min, 1000 req/hr, 10000 req/day. Limits aren't permanent — batching many deploy/write calls trips -32429 / HTTP 429 and further requests are rejected until the window resets (next minute / hour / day cycle). -32028 signals the pending-queue cap — up to 32 in-flight txs per sender; a separate cap also applies per contract. Throttle batch scripts, wait for receipts between submissions, or use localnet for heavy batches.
Always use genlayer network set instead of --rpc for built-in networks. The --rpc flag bypasses the chain configuration (consensus contract ABI, isStudio flag, etc.) and will cause transaction polling failures. Only use --rpc for custom/private networks not in the built-in list.
Account Management
genlayer account # Show active account (address, balance, network)
genlayer account list # List all accounts
genlayer account create --name dev1 # Create new account
genlayer account use dev1 # Set active account
genlayer account unlock # Cache key in OS keychain (no password prompts)
genlayer account lock # Remove from keychain
# Import from private key or keystore
genlayer account import --name imported --private-key 0x...
genlayer account import --name imported --keystore ./keystore.json
# Send tokens
genlayer account send 0x123...abc 10gen
Amount formats: "10gen", "0.5gen", or raw wei "1000000000000000000"
Non-interactive usage (CI/CD, containers, agents)
account create, account import, and account send accept --password <password> to skip interactive prompts:
genlayer account create --name dev1 --password "mypassword"
genlayer account import --name imported --private-key 0x... --password "mypassword"
account unlock requires an OS keychain (macOS Keychain, GNOME Keyring, etc.) and will fail in headless containers. When the account is locked, commands that sign transactions (deploy, write, appeal, account send) will prompt for the keystore password. To automate these, pipe the password via stdin:
echo "mypassword" | genlayer deploy --contract contracts/my_contract.py --args "arg1"
Funding Accounts
New accounts start with 0 GEN. Funding requirements depend on the network:
StudioNet is gasless — accounts with 0 GEN can deploy and interact with contracts without any funding. A zero balance on StudioNet is expected and normal. Skip funding entirely when using StudioNet.
For testnets (Bradbury, Asimov), fund the account before deploying or writing.
Faucet: https://testnet-faucet.genlayer.foundation/
- Get your address:
genlayer account-> copy theaddressfield - Go to the faucet URL, paste the address, and claim 100 GEN (once per 24 hours)
- Verify:
genlayer accountshould show the updated balance
The faucet uses Cloudflare Turnstile and cannot be automated from CLI -- the user must claim manually in a browser. Works for both Testnet Bradbury and Testnet Asimov.
Contract Deployment
# Deploy a specific contract
genlayer deploy --contract contracts/my_contract.py
genlayer deploy --contract contracts/my_contract.py --args "arg1" 42
# Run all deploy scripts in deploy/ folder
genlayer deploy
Contract Interaction
Read (no transaction)
genlayer call <address> <method>
genlayer call 0x123...abc get_data --args "key1"
Write (sends transaction)
genlayer write <address> <method>
genlayer write 0x123...abc set_data --args "hello"
Inspect contract
genlayer schema <address
Câu hỏi thường gặp
Tôi có cần token để triển khai trên studionet không?
Không. Skill nói studionet không tốn gas, nên số dư bằng không không chặn việc triển khai hoặc gọi contract.
Vì sao một loạt triển khai có thể bị từ chối?
Studionet giới hạn số yêu cầu mỗi phút, mỗi giờ và mỗi ngày cho mỗi địa chỉ IP, nên lô lớn có thể chạm giới hạn. Skill gợi ý điều tiết tốc độ hoặc dùng localnet.
Có những mạng nào?
Localnet, studionet, testnet-asimov và testnet-bradbury.
Chi tiết
Mô tả gốc của tác giả
Use the GenLayer CLI to deploy, interact with, and debug intelligent contracts.
Độ phổ biến
- Sao GitHub
- 7.0k
- Vị trí xếp hạng
- #13627
- Giấy phép
- —
- Cập nhật
- 26/10/2026
Bình luận
- …
Thêm skill từ kho mã này
internet-court
7.0kGiúp agent của bạn thanh toán, thuê hoặc giao dịch an toàn với một agent AI khác hoặc dịch vụ trả phí, và chỉ đến hướng dẫn chuyên sâu phù hợp.
genlayer-erc7710-connector
7.0kGiúp agent của bạn kết nối kết quả đánh giá AI với hệ thống quyền hạn, để một đánh giá xấu có thể hạn chế hoặc hủy quyền của agent.
genlayer-intelligent-contracts
7.0kGiúp agent của bạn xác định quy tắc, bằng chứng và đầu ra của một AI judge kiểm tra xem agent khác có làm đúng nhiệm vụ được ủy quyền hay không.
x402-erc7710
7.0kGiúp agent của bạn trả tiền cho dịch vụ web theo từng yêu cầu, và thiết lập chi tiêu định kỳ nằm trong ngân sách quyền hạn.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.