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.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。






探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务