
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
ocean-subgraph是Ocean Protocol的子图实现,用于索引和查询Ocean Protocol在***上的相关数据。该子图已部署在Ocean Protocol合约所支持的所有网络中,提供GraphQL接口供开发者和用户查询数据NFT、订单、用户等实体信息。
该子图已部署在以下网络,可直接通过GraphQL接口访问:
所有数据NFT
graphql{ nfts(orderBy: createdTimestamp, orderDirection: desc, first: 1000) { id symbol name creator createdTimestamp } }
注意:子图最多可返回1000条数据
每个用户的总订单数
graphql{ users(first: 1000) { id totalOrders } }
特定用户的总订单数
graphql{ user(id: $user) { id totalOrders } }
注意:所有ETH地址(如上述示例中的
$user)需以小写字符串形式传入
所有订单
graphql{ orders(orderBy: createdTimestamp, orderDirection: desc, first: 1000){ amount datatoken { id } consumer { id } payer { id } } }
注意:子图最多可返回1000条数据
bashgit clone https://github.com/oceanprotocol/barge.git cd barge ./start_ocean.sh --with-thegraph
如果之前已克隆Barge,请通过git pull确保使用最新版本。
bashgit clone https://github.com/oceanprotocol/ocean-subgraph/ cd ocean-subgraph npm i
bashexport ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json"
bashnode ./scripts/generatenetworkssubgraphs.js barge npm run codegen
bashnpm run create:local npm run deploy:local
npm run quickstart:barge快速启动,该命令会合并步骤4-5。本地graph-node将运行在:[***]
bashgit clone https://github.com/oceanprotocol/ocean-subgraph/ cd ocean-subgraph npm i
bashnpm run quickstart:rinkeby
注意:
npm run test命令当前因https://github.com/***/graph-ts/issues/113%E6%97%A0%E6%B3%95%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C%E3%80%82
要在本地运行集成测试,先按照上述说明启动Barge,然后在ocean-subgraph文件夹中运行:
bashexport ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" npm run test-integration
可从项目根目录使用以下命令进行代码检查和格式化:
bash# 使用eslint检查所有js文件 npm run lint # 使用prettier自动格式化所有js和css文件 npm run format
发布采用半自动化管理,从干净的main分支运行以下命令,根据语义化版本控制更新版本:
bashnpm run release
该命令将:
package.json和package-lock.json中的项目版本执行GitHub发布步骤需要导出GitHub个人访问令牌为
GITHUB_TOKEN,https://github.com/release-it/release-it#github-releases
部署ocean-subgraph到本地运行的graph-node(指向主网):
bashnpm run codegen # 部署 npm run create:local npm run deploy:local
要部署到Rinkeby或Ropsten测试网:
bash# Rinkeby npm run create:local-rinkeby npm run deploy:local-rinkeby # Ropsten npm run create:local-ropsten npm run deploy:local-ropsten
编辑事件处理程序代码后运行npm run deploy:local时需注意:
docker-compose down或Ctrl+C)/docker/data中的ipfs和postgres文件夹(rm -rf ./docker/data/*)docker-compose up重启graph-node、ipfs和postgresnpm run create:local创建ocean-subgraphnpm run deploy:local部署ocean-subgraph要部署到Ocean运行的远程节点之一,可进行端口转发,上述
:local命令将照常工作。
Copyright ((C)) 2023 Ocean Protocol Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [***] Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务