Skip to content

Commit

Permalink
New translations define-subgraph-hosted.mdx (Chinese Simplified)
Browse files Browse the repository at this point in the history
  • Loading branch information
benface committed Jan 28, 2022
1 parent 6189f2a commit 28a1201
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pages/zh/developer/define-subgraph-hosted.mdx
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
title: Define a Subgraph
title: 定义子图
---

A subgraph defines which data The Graph will index from Ethereum, and how it will store it. Once deployed, it will form a part of a global graph of blockchain data.
子图定义了Graph从以太坊索引哪些数据,以及如何存储这些数据。 子图一旦部署,就成为区块链数据全局图的一部分。

![Define a Subgraph](/img/define-subgraph.png)
![定义子图](/img/define-subgraph.png)

The subgraph definition consists of a few files:
子图定义由几个文件组成:

- `subgraph.yaml`: a YAML file containing the subgraph manifest
- `subgraph.yaml`: 包含子图清单的 YAML 文件

- `schema.graphql`: a GraphQL schema that defines what data is stored for your subgraph, and how to query it via GraphQL
- `schema.graphql`: 一个 GraphQL 模式文件,它定义了为您的子图存储哪些数据,以及如何通过 GraphQL 查询这些数据

- `AssemblyScript Mappings`: [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) code that translates from the event data to the entities defined in your schema (e.g. `mapping.ts` in this tutorial)
- `AssemblyScript映射`: 将事件数据转换为模式中定义的实体(例如本教程中的`mapping.ts`)的 [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) 代码

Before you go into detail about the contents of the manifest file, you need to install the [Graph CLI](https://github.com/graphprotocol/graph-cli) which you will need to build and deploy a subgraph.
在详细了解清单文件的内容之前,您需要安装[Graph CLI](https://github.com/graphprotocol/graph-cli),以构建和部署子图。

## Install the Graph CLI
## 安装Graph CLI

The Graph CLI is written in JavaScript, and you will need to install either `yarn` or `npm` to use it; it is assumed that you have yarn in what follows.
Graph CLI是使用 JavaScript 编写的,您需要安装`yarn``npm`才能使用它;以下教程中假设您已经安装了yarn。

Once you have `yarn`, install the Graph CLI by running
一旦您安装了`yarn`,可以通过运行以下命令安装 Graph CLI

**Install with yarn:**
**使用yarn安装:**

```bash
yarn global add @graphprotocol/graph-cli
```

**Install with npm:**
**使用npm安装:**

```bash
npm install -g @graphprotocol/graph-cli
Expand Down

0 comments on commit 28a1201

Please sign in to comment.