feat: add local Monad exact and upto examples - #48
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
问题
本地要把 o402 + facilitator 在 Monad 主网(
eip155:143)和测试网(eip155:10143)上跑通 exact 和 upto。已有chat_evm.py/chat_upto.py:base_url是生产https://llm.qntx.org/v1。prefer_network,会付 402 的第一条(主网)。x402的 default assets 没有 Monad 测试网 USDC。默认 spend controls 丢掉测试网 accept 后,prefer_network("eip155:10143")passthrough,测试网请求实际 settle 在主网。POST /v1/chat/completions记 upto;exact 要走/v1/images/generations。127.0.0.1会RemoteProtocolError。必须NO_PROXY=127.0.0.1,localhost,::1。为什么要改
需要和 TS 包对称的本地矩阵。测试网 USDC 必须写进
spend_controls.allowed_assets。EvmConfig.rpc_url按网切换。密钥只从.env/ 环境变量读。改动
examples/local_monad_upto.pyexamples/local_monad_exact.py(images.generate→ exact)examples/local_monad_matrix.pysetdefaultNO_PROXY。用法
.env已被 gitignore,不要提交私钥。English
Problem
Local o402 + facilitator must exercise exact and upto on Monad mainnet (
eip155:143) and testnet (eip155:10143). Existingchat_evm.py/chat_upto.py:base_urlis productionhttps://llm.qntx.org/v1.prefer_network, soaccepts[0](mainnet) wins.x402default assets omit Monad testnet USDC. Spend controls drop it;prefer_network("eip155:10143")passthrough-pays mainnet./v1/images/generations.127.0.0.1raiseRemoteProtocolError.NO_PROXY=127.0.0.1,localhost,::1is required.Why this change
Parity with the TS package: two nets × two schemes, keys from env, testnet USDC in
spend_controls.allowed_assets, per-netEvmConfig.rpc_url.Changes
examples/local_monad_upto.pyexamples/local_monad_exact.py(images.generate→ exact)examples/local_monad_matrix.pysetdefaultNO_PROXYin the examples.Usage
.envis gitignored. Do not commit keys.