osnm-z README

项目的 README,来自 github.com/zunmax/osnm-z。合并为一个 markdown 文件:README.md。

OSNM-Z Mint Bot logo

OSNM-Z

Single-wallet Python CLI for OpenSea NFT mints

A Python CLI tool for minting ERC-721 NFTs from OpenSea SeaDrop collections. Each run uses one wallet and one selected phase, supporting public sales, signed allowlists, and Merkle allowlists. The configured wallet pays for the mint and gas and receives the NFTs.

Installation

The sections below cover the major operating systems and commonly used terminals: Windows with PowerShell or Command Prompt, Linux with Bash, and macOS with Zsh or Bash. Follow the section for your operating system and terminal, completing each step in order.

Windows

PowerShell

  1. Open Windows PowerShell 5.1 or PowerShell 7 and check whether Git is installed:

    git --version
    
  2. If Git is unavailable, install it with WinGet:

    winget install --id Git.Git -e --source winget
    

    For manual installation, download and run the official Git for Windows installer. Close and reopen PowerShell after installing Git, then run git --version again.

  3. Install uv:

    powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
    
  4. Close and reopen PowerShell, then confirm that uv is available:

    uv --version
    
  5. Clone the repository:

    git clone https://github.com/zunmax/osnm-z.git
    
  6. Enter the cloned project directory:

    Set-Location -LiteralPath '.\osnm-z'
    
  7. Install Python 3.12 through uv:

    uv python install 3.12
    
  8. Create the project environment from the locked dependencies:

    uv sync --frozen --python 3.12
    
  9. Create your private configuration file:

    Copy-Item -LiteralPath '.env.example' -Destination '.env'
    
  10. Open the configuration file in Notepad:

    notepad.exe .env
    

    Follow Wallet setup to fill in the required values and save the file.

Command Prompt (CMD)

  1. Open Command Prompt and check whether Git is installed:

    git --version
    
  2. If Git is unavailable, install it with WinGet:

    winget install --id Git.Git -e --source winget
    

    For manual installation, download and run the official Git for Windows installer. Close and reopen Command Prompt after installing Git, then run git --version again.

  3. Install uv through Windows PowerShell:

    powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
    
  4. Close and reopen Command Prompt, then confirm that uv is available:

    uv --version
    
  5. Clone the repository:

    git clone https://github.com/zunmax/osnm-z.git
    
  6. Enter the cloned project directory:

    cd /d "osnm-z"
    
  7. Install Python 3.12 through uv:

    uv python install 3.12
    
  8. Create the project environment from the locked dependencies:

    uv sync --frozen --python 3.12
    
  9. Create your private configuration file:

    copy ".env.example" ".env"
    
  10. Open the configuration file in Notepad:

    notepad.exe .env
    

    Follow Wallet setup to fill in the required values and save the file.

Linux

  1. Open a Bash terminal and check whether Git is installed:

    git --version
    
  2. If Git is unavailable, follow the instructions for your distribution.

    On Debian or Ubuntu, update the package index:

    sudo apt update
    

    Then install Git:

    sudo apt install git
    

    On Fedora, install Git with DNF instead:

    sudo dnf install git
    

    For other distributions or manual installation, follow the official Git for Linux instructions. After installing Git, run git --version again.

  3. Install uv:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

    If curl is unavailable, install uv with wget instead:

    wget -qO- https://astral.sh/uv/install.sh | sh
    
  4. Close and reopen the terminal, then confirm that uv is available:

    uv --version
    
  5. Clone the repository:

    git clone https://github.com/zunmax/osnm-z.git
    
  6. Enter the cloned project directory:

    cd osnm-z
    
  7. Install Python 3.12 through uv:

    uv python install 3.12
    
  8. Create the project environment from the locked dependencies:

    uv sync --frozen --python 3.12
    
  9. Create your private configuration file:

    cp .env.example .env
    
  10. Open .env in your preferred plain-text editor, then follow Wallet setup.

macOS

  1. Open Terminal using Zsh or Bash and check whether Git is installed:

    git --version
    
  2. If Git is unavailable, install Apple's Command Line Tools, which include Git:

    xcode-select --install
    

    For manual installation or other package-manager options, follow the official Git for macOS instructions. After installing Git, run git --version again.

  3. Install uv:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  4. Close and reopen Terminal, then confirm that uv is available:

    uv --version
    
  5. Clone the repository:

    git clone https://github.com/zunmax/osnm-z.git
    
  6. Enter the cloned project directory:

    cd osnm-z
    
  7. Install Python 3.12 through uv:

    uv python install 3.12
    
  8. Create the project environment from the locked dependencies:

    uv sync --frozen --python 3.12
    
  9. Create your private configuration file:

    cp .env.example .env
    
  10. Open .env in your preferred plain-text editor and follow Wallet setup.

Wallet setup

The setup commands copy .env.example to .env. Run the copy command only during first-time setup so an existing .env is not overwritten. Edit .env, set the required values, and save it before running the tool:

WALLET_KEY=0x<64-hex-character-private-key>
RPC_URL=https://your-chain-rpc.example
FEE_AUTOMATIC=true
GAS_LIMIT=300000

Replace the wallet and RPC placeholders. Keep your private key and .env private. GAS_LIMIT=300000 is an example; choose a limit suitable for the mint. The tool does not estimate gas during submission.

Usage

These commands work in Windows PowerShell 5.1, PowerShell 7, Command Prompt, Linux Bash, and macOS Zsh or Bash. Run them from the osnm-z directory. uv run uses the project's environment; manual activation is not required.

Check configuration, wallet signer loading, and RPC readiness:

uv run --frozen osnm-z doctor

doctor does not submit a transaction. OpenSea wallet authentication and collection eligibility are checked during mint setup.

Start an interactive mint:

uv run --frozen osnm-z mint
  1. Enter an OpenSea collection slug, collection or mint URL, or NFT contract address.
  2. Choose one eligible phase using its displayed option number. If the collection has only one phase and it is selectable, the tool selects it automatically.
  3. Enter the quantity, or press Enter for one NFT.
  4. Keep the tool running while it prepares, waits for the selected phase if needed, submits, and checks the transaction receipt.

During scheduled waits, the terminal shows a live Mint starts in 1h 23m 45s countdown to the selected phase's start. Preparation and early requests can finish their waits before it reaches zero. Redirected logs record the remaining time once per wait instead of printing repeated countdown updates.

Keep your system clock synchronized and avoid other transactions from the same wallet while minting. If the result is uncertain or unconfirmed, check the printed transaction hash before trying again; the tool does not automatically resend it.

Show command help:

uv run --frozen osnm-z --help

Show version information:

uv run --frozen osnm-z --version

Configuration

The tool reads its settings from .env. Unknown and duplicate keys are rejected. .env.example lists all supported settings.

Wallet and transaction settings

Setting Default Description
WALLET_KEY Required One private key, optionally prefixed with 0x.
RPC_URL Required Endpoint for chain reads, submission, and receipt tracking. HTTPS is required except for HTTP loopback testing.
FEE_AUTOMATIC Required true for automatic fees or false for manual fees.
GAS_LIMIT Required Positive transaction gas limit; the example uses 300000.
MAX_FEE_PER_GAS_GWEI Manual mode only Positive maximum fee per gas, in gwei.
MAX_PRIORITY_FEE_PER_GAS_GWEI Manual mode only Nonnegative priority fee, in gwei; must not exceed the maximum fee.
RPC_REQUEST_TIMEOUT_MS 10000 RPC request timeout; 100–120000 ms.
PUBLIC_MINT_BROADCAST_OFFSET_MS 0 Public submission lead time; 0–60000 ms. Positive values send early and can cause a revert if mined before the phase opens.
PENDING_TIMEOUT_SECONDS 20 Receipt-tracking timeout; 1–86400 seconds.
RECEIPT_POLL_INTERVAL_MS 250 Wait between receipt checks; 50–60000 ms.

Automatic fees apply a 1.25× multiplier for an active phase and 2.5× for a scheduled phase. Remove or comment out both manual fee settings when automatic fees are enabled. For manual fees, set FEE_AUTOMATIC=false and supply both fee values.

OpenSea request settings

Setting Default Description
OPENSEA_REQUEST_TIMEOUT_MS 10000 General request timeout; 100–120000 ms.
ELIGIBILITY_REQUEST_TIMEOUT_MS 5000 Eligibility request timeout; 100–120000 ms.
OPENSEA_ACTION_REQUEST_TIMEOUT_MS 3000 Mint action request timeout; 100–120000 ms.
OPENSEA_ATTEMPTS 6 Request attempt limit; clamped to 6–10.
OPENSEA_RETRY_INTERVAL_MS 250 Request retry interval; 50–30000 ms.
OPENSEA_CALLDATA_ATTEMPTS 15 Private mint calldata attempt limit; clamped to 15–1000 and subject to timing and phase-expiry limits.

OPENSEA_ATTEMPTS and OPENSEA_RETRY_INTERVAL_MS also govern RPC wallet preparation and public settings recovery. Scheduled recovery uses its time window instead of the attempt limit. Final wallet refresh and endpoint warm-up have separate retry policies; these settings never cause a transaction to be resent.

osnm-z (zunmax/osnm-z)

正在搜索数据库…

这是什么?OSNM-Z 是一个跨平台的 Rust 命令行工具,可自动铸造 OpenSea 托管的 SeaDrop 系列在各大 EVM 链上的 NFT,处理钱包认证、资格检查以及 allowlist/FCFS/公售等铸造阶段。
这是一个简单脚本,还是完整的 CLI 应用?它是一个编译好的 Rust CLI(“opensea-mint” 二进制文件),带有 “doctor”、“mint”、“deploy-executor” 和 “wallets create” 等子命令,会打开交互式会话,引导你依次选择系列、资格、阶段和数量,然后才广播交易。
怎么安装和运行它?克隆仓库并在将要运行它的操作系统上编译(Windows 需要 Visual Studio Build Tools 和 Git for Windows;Linux/WSL 需要发行版的构建工具;macOS 需要 Xcode 命令行工具),安装 Rust,然后配置 .env 文件和可选的 wallets.json,再运行 “opensea-mint mint”。
铸造前我需要准备什么——RPC URL、有余额的钱包?每次运行都需要一个 EVM RPC 端点(RPCURL)和一个钱包来源(单个 WALLETKEY 或 wallets.json 清单);代付模式还需要一个有余额的 SPONSORKEY 钱包来支付批量交易的 gas。
把它指向真实的铸造安全吗?作者明确警告:它依赖 OpenSea 私有且不稳定的 Web API,并信任其返回的不透明数据,整套做法属于实验性质、风险很高,因此建议只使用专门为该次铸造充值的钱包。
一次运行最多能用多少个钱包铸造?自付模式最多支持 10 个并发钱包,而 EIP-7702 代付模式每个 executor 批次最多允许 25 个钱包。
这个 CLI 能帮我给钱包充值或提款吗?可以:“mint --fund” 会向清单中的每个钱包发送指定数量的原生代币,“mint --withdraw” 会把每个自付钱包可安全签名的余额转回配置的收款地址。
作者
zunmax
大小
0.3 MB
星标
266
更新
提交Sep 27
时长
3个月
提交 · 90 天