Operator hub

Send a request to a specific miner

devnet · next · development

Last updated 2026-11-26

Send a request to a specific miner

Use a direct session when you know the miner's SS58 account and can reach its session endpoint. Run on the miner host at http://127.0.0.1:8645, or use a miner's opted-in public HTTPS endpoint. A miner host cannot reach another miner through the devnet's private network. This flow does not change network access. Public agents without a reachable endpoint need the gateway's separate miner-pin path.

Gateway-funded access has separate quota, model scope and expiry; faucet money does not replenish it. See gateway allowance and wallet funds.

CLI

Check flop --network devnet network status first. The public RPC is wss://rpc.devnet.flop.network; compare its genesis with https://faucet.flop.network/chain. Use the same existing wallet when requesting test funds. A 503 from /fund is a refused or unconfirmed request, not a reason to create another wallet. Follow Retry-After when present and inspect dependency readiness at /health; older faucet releases expose only signer health, so also check https://explorer.devnet.flop.network/api/health for indexer lag. A healthy catalog at https://api.flop.network/v1/models does not prove a serving miner is available. Obtain a calibrated, opted-in endpoint before signing.

This is a direct compute-channel flow. flop chat in CLI 0.4.0 instead uses HTLCs and needs a registered EconomicCritical appraisal profile; it is not an interchangeable command for this procedure. A local HTTP/crypto regression test does not qualify public GPU inference or paid settlement.

Use a CLI image built from the implementation of this command; the devnet operator supplies its immutable digest in the miner pack. No repository checkout is needed on the host.

flop --network devnet --keystore agent.json --password-env FLOP_KEY_PASSWORD session run \
  --miner '<miner-ss58>' --model qwen/qwen2.5-0.5b-instruct \
  --prompt 'Say hello.' --max-flop 0.01 --via auto \
  --endpoint http://127.0.0.1:8645 --json

--max-flop is the channel escrow in FLOP, and it is what the session costs. Cooperative settlement pays the miner the whole escrow and refunds no unused capacity (D-0403), so a larger --max-flop is a larger payment, not a larger allowance. Transaction fees are additional.

The smallest escrow the chain accepts depends on the open path:

The escrow must also cover the turn tariff, computeChannel.basePerTurn × turns + price × ΣG_n. price is the model's modelRegistry.marketStates(model).epochPricePerGflop, pinned at open, and the SDK refuses a turn whose tariff exceeds the escrow. For example, a miner calibrated at 193 G_n/s on a 900-block force channel needs at least 193 × 900 × 41,335,978,835 base units, about 0.0072 FLOP. --new-wallet replaces the keystore options on devnet: it saves an unencrypted, owner-only test wallet in ~/.flop/session-wallets/ and requests faucet funding after comparing faucet and RPC genesis hashes. Keep that wallet until settlement or refund is finalized. Use an encrypted keystore for valuable funds.

On an older worker, add --auth-token-env SESSION_AUTH_TOKEN with the token in the local environment. Current workers also accept channel-key signatures, so a direct caller does not need the shared miner bearer. The bearer continues to work for broker requests and /session/info.

auto uses a live signed spot offer for this miner and model, then falls back to force_open when none is available. offer requires a matching offer; force always requests an acknowledgement. Set FLOP_INDEXER_URL for CLI offer discovery outside the default devnet or local indexer. The force path waits through the chain's AckWindow. On this runtime the ack emits ChannelOpened, and the key is read from finalized channel storage; there is no separate ForceAcked event.

The result names the reply, serving miner, channel, verified turn count and settlement transaction. A forced settlement posts a claim; it still needs permissionless finalize after its challenge window. The named miner must serve the exact registered model hash, measured root, precision and decode policy. Without bearer discovery the slug's model name must resolve to exactly one verified registry identity; ambiguous precision, policy or model versions are refused before escrowing.

SDK and local MCP

import { runDirectSession } from '@flop-labs/sdk';

const result = await runDirectSession({
  api, signer, miner: minerAddress, model: 'qwen/qwen2.5-0.5b-instruct',
  messages: [{ role: 'user', content: 'Say hello.' }],
  maxFlop: 10_000_000_000_000_000n, // 0.01 FLOP in raw units
  via: 'auto', endpoint: 'http://127.0.0.1:8645',
  indexerUrl: 'https://explorer.devnet.flop.network',
});

The SDK accepts either prompt or a message history and verifies every receipt before accepting output or signing payment. It cross-checks /session/info against the finalized channel key and registry identity. It attempts cooperative settlement and falls back to forceSettle.

Local write-enabled stdio MCP provides flop_run_session with miner, model, prompt, max_flop (a decimal FLOP string), via, endpoint and optional auth_token_env. The hosted MCP never exposes this tool. flop_list_session_offers already accepts a miner filter.

Operator test and optional offers

The pack includes session-test.sh. On the miner host, with miner.env beside the script:

FLOP_CLI='<operator-supplied CLI image@sha256:digest>' \
  ./session-test.sh '<miner-ss58>' 0.01

It runs the CLI image against loopback, uses the host's token when set, and keeps fresh faucet-funded test wallets under session-wallets/. It does not mount the miner's signing seed. MINER_ENV_FILE selects a different env file. Repeat against a non-serving miner account to verify the expiry refund. Check the finalized ChannelOpened acknowledgement, verified turn, Settled.minerPaid, and explorer compute-channel row all refer to the requested miner. Retain the channel ID when diagnosing failure.

Offer publication is disabled by default. Set SESSION_OFFER_INDEXER_URL on the worker to publish signed offers every five minutes; SESSION_OFFER_INTERVAL_MINUTES may shorten that interval. Each offer uses the current enclave key and chain-derived BasePerTurn + G_n tariff floor. Only calibrated workers publish or force-ack, and force-ack refuses any other model identity. With offers enabled, the worker refuses to start unless its backend is provider-ready and both SESSION_CHAIN and TOPLOC capture are on, so every advertised offer can be served and settled. Offers expire after ten minutes and are single-use. Revoking publication does not revoke an already signed offer; wait for its on-chain expiry before treating it as unavailable.

Public HTTPS remains an operator opt-in. Keep the session bearer private and configure a reverse proxy with connection/body/rate limits. Signed requests cover channel, method, path, body, timestamp, nonce and server challenge. The worker rejects replay, including signatures from an earlier process, and bounds authenticated direct traffic to 120 requests per channel per minute.

Recovery and rollback

The calling wallet owner owns escrow recovery; the miner operator owns the worker and endpoint. A live CLI waits for expire_force_open after an unacknowledged request and for timeout after a zero-output open reaches its SLA deadline. Both refund the channel escrow; fees remain spent. If the process or RPC connection fails, inspect finalized channel state before retrying: call expire_force_open for expired PendingAck, timeout for an expired zero-turn Open, or finalize for a force-settled channel after its challenge window. These extrinsics are permissionless. A DirectSessionError includes the channel ID when automatic recovery fails.

To undo the client change, return to the previous SDK/CLI/MCP build. To undo the worker change, disable offer publication and restore its previous image, keeping the session key and bearer. Confirm broker /session/info still accepts its bearer and inspect every affected channel at finality. Code rollback cannot reverse paid settlements, fees, failed-ack counters or already published offers.