diff --git a/website/pages/ar/cookbook/arweave.mdx b/website/pages/ar/cookbook/arweave.mdx index 621077fd974a..d8876009af1c 100644 --- a/website/pages/ar/cookbook/arweave.mdx +++ b/website/pages/ar/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## الأسئلة الشائعة diff --git a/website/pages/ar/cookbook/cosmos.mdx b/website/pages/ar/cookbook/cosmos.mdx index a8aae5522179..bbd67fcff9c6 100644 --- a/website/pages/ar/cookbook/cosmos.mdx +++ b/website/pages/ar/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. فيما يلي بعض الأمثلة على الـ subgraphs للرجوع إليها: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/ar/cookbook/near.mdx b/website/pages/ar/cookbook/near.mdx index 1821abfeab87..dc3c7f9b857e 100644 --- a/website/pages/ar/cookbook/near.mdx +++ b/website/pages/ar/cookbook/near.mdx @@ -29,13 +29,13 @@ title: بناء Subgraphs على NEAR `graphprotocol/graph-ts@` هي مكتبة لأنواع خاصة بـ subgraph. -تطوير NEAR subgraph يتطلب `graph-cli` بإصدار أعلى من `0.23.0` و `graph-ts` بإصدار أعلى من `0.23.0`. +تطوير NEAR subgraph يتطلب `graph-cli` بإصدار أعلى من ` 0.23.0 ` و `graph-ts` بإصدار أعلى من ` 0.23.0 `. > Building a NEAR subgraph is very similar to building a subgraph that indexes Ethereum. هناك ثلاثة جوانب لتعريف الـ subgraph: -**subgraph.yaml:** الـ subgraph manifest ، وتحديد مصادر البيانات ذات الأهمية ، وكيف يجب أن تتم معالجتها.علما أن NEAR هو `نوع` جديد لمصدر البيانات. +**subgraph.yaml:** الـ subgraph manifest ، وتحديد مصادر البيانات ذات الأهمية ، وكيف يجب أن تتم معالجتها.علما أن NEAR هو ` نوع ` جديد لمصدر البيانات. **schema.graphql:** a schema file that defines what data is stored for your subgraph, and how to query it via GraphQL. The requirements for NEAR subgraphs are covered by [the existing documentation](/developing/creating-a-subgraph#the-graphql-schema). @@ -73,7 +73,7 @@ dataSources: ``` - NEAR subgraphs يقدم `نوعا ` جديدا من مصدر بيانات (`near`) -- يجب أن يتوافق الـ `network` مع شبكة على Graph Node المضيفة. في الخدمة المستضافة ، الشبكة الرئيسية لـ NEAR هي `near-mainnet` ، وشبكة NEAR's testnet هي `near-testnet` +- يجب أن يتوافق الـ `network` مع شبكة على Graph Node المضيفة. في الخدمة المستضافة ، الشبكة الرئيسية لـ NEAR هي ` near-mainnet ` ، وشبكة NEAR's testnet هي ` near-testnet ` - NEAR data sources introduce an optional `source.account` field, which is a human-readable ID corresponding to a [NEAR account](https://docs.near.org/docs/concepts/account). This can be an account or a sub-account. - NEAR data sources introduce an alternative optional `source.accounts` field, which contains optional suffixes and prefixes. At least prefix or suffix must be specified, they will match the any account starting or ending with the list of values respectively. The example below would match: `[app|good].*[morning.near|morning.testnet]`. If only a list of prefixes or suffixes is necessary the other field can be omitted. @@ -165,7 +165,7 @@ class ReceiptWithOutcome { These types are passed to block & receipt handlers: - معالجات الكتلة ستتلقى`Block` -- معالجات الاستلام ستتلقى`ReceiptWithOutcome` +- معالجات الاستلام ستتلقى` ReceiptWithOutcome ` Otherwise, the rest of the [AssemblyScript API](/developing/assemblyscript-api) is available to NEAR subgraph developers during mapping execution. @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, فيما يلي بعض الأمثلة على الـ subgraphs للرجوع إليها: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## الأسئلة الشائعة diff --git a/website/pages/ar/cookbook/subgraph-debug-forking.mdx b/website/pages/ar/cookbook/subgraph-debug-forking.mdx index d4f49169a530..202b13a497c6 100644 --- a/website/pages/ar/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/ar/cookbook/subgraph-debug-forking.mdx @@ -14,11 +14,11 @@ title: Quick and Easy Subgraph Debugging Using Forks عندما تنشر subgraph إلى Graph node بعيدة للقيام بالفهرسة ويفشل عند الكتلة _ X _ ، فإن الخبر الجيد هو أن Graph node ستظل تقدم استعلامات GraphQL باستخدام مخزنها(store)، والذي تمت مزامنته للكتلة(block) _ X _. هذا عظيم! هذا يعني أنه يمكننا الاستفادة من هذا المخزن "المحدث" لإصلاح الأخطاء التي تظهر عند فهرسة الكتلة _ X _. -باختصار ، سنقوم _ بتفريع (fork) الـ subgraph الفاشل _ من Graph node بعيدة والتي تضمن فهرسة الـ subgraph للكتلة _ X _ وذلك من أجل توفير الـ subgraph المنشور محليًا والذي يتم تصحيحه عندالكتلة*X* مع عرض محدث لحالة الفهرسة. +باختصار ، سنقوم _ بتفريع (fork) الـ subgraph الفاشل _ من Graph node بعيدة والتي تضمن فهرسة الـ subgraph للكتلة * X * وذلك من أجل توفير الـ subgraph المنشور محليًا والذي يتم تصحيحه عندالكتلة_X_ مع عرض محدث لحالة الفهرسة. ## من فضلك ، أرني بعض الأكواد! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. فيما يلي المعالجات المعرفة لفهرسة `Gravatar` ، بدون أخطاء على الإطلاق: @@ -69,14 +69,14 @@ Oops, how unfortunate, when I deploy my perfect looking subgraph to the [Hosted وأنا أجيب: -1. `fork-base` هو عنوان URL "الأساسي" ،فمثلا عند إلحاق _subgraph id_ ، يكون عنوان URL الناتج (`/`) هو GraphQL endpoint صالح لمخزن الـ subgraph. +1. ` fork-base ` هو عنوان URL "الأساسي" ،فمثلا عند إلحاق _subgraph id_ ، يكون عنوان URL الناتج (`/`) هو GraphQL endpoint صالح لمخزن الـ subgraph. 2. الـتفريع سهل ، فلا داعي للقلق: ```bash $ graph deploy --debug-fork --ipfs http://localhost:5001 --node http://localhost:8020 ``` -أيضًا ، لا تنس تعيين حقل `dataSources.source.startBlock` في subgraph manifest لرقم الكتلة(block) التي بها المشكلة، حتى تتمكن من تخطي فهرسة الكتل الغير ضرورية والاستفادة من التفريع! +أيضًا ، لا تنس تعيين حقل ` dataSources.source.startBlock ` في subgraph manifest لرقم الكتلة(block) التي بها المشكلة، حتى تتمكن من تخطي فهرسة الكتل الغير ضرورية والاستفادة من التفريع! لذلك ، هذا ما أفعله: @@ -90,7 +90,7 @@ $ cargo run -p graph-node --release -- \ --fork-base https://api.thegraph.com/subgraphs/id/ ``` -1. بعد فحص دقيق ، لاحظت أن هناك عدم تطابق في تمثيلات الـ `id` المستخدمة عند فهرسة `Gravatar` في المعالجين الخاصين بي. بينما `handleNewGravatar` يحول (`event.params.id.toHex()`) إلى سداسي ، `handleUpdatedGravatar` يستخدم int32 (`event.params.id.toI32()`) مما يجعل `handleUpdatedGravatar` قلقا من "Gravatar not found!". أنا أجعلهم كلاهما يحولان `id` إلى سداسي. +1. بعد فحص دقيق ، لاحظت أن هناك عدم تطابق في تمثيلات الـ ` id ` المستخدمة عند فهرسة ` Gravatar ` في المعالجين الخاصين بي. بينما ` handleNewGravatar ` يحول (`event.params.id.toHex()`) إلى سداسي ، `handleUpdatedGravatar` يستخدم int32 (`event.params.id.toI32()`) مما يجعل ` handleUpdatedGravatar ` قلقا من "Gravatar not found!". أنا أجعلهم كلاهما يحولان ` id ` إلى سداسي. 2. بعد إجراء التغييرات ، قمت بنشر الـ subgraph الخاص بي على Graph node المحلية **_وتفريع الـsubgraph الفاشل_** وضبط `dataSources.source.startBlock` إلى `6190343` في `subgraph.yaml`: ```bash diff --git a/website/pages/ar/developing/creating-a-subgraph.mdx b/website/pages/ar/developing/creating-a-subgraph.mdx index 36182c1508d7..750c6dab0218 100644 --- a/website/pages/ar/developing/creating-a-subgraph.mdx +++ b/website/pages/ar/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ Subgraph manifest `subgraph.yaml` تحدد العقود الذكية لفهار ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| النوع | الوصف | -| --- | --- | -| `Bytes` | مصفوفة Byte ، ممثلة كسلسلة سداسية عشرية. يشيع استخدامها في Ethereum hashes وعناوينه. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| النوع | الوصف | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | مصفوفة Byte ، ممثلة كسلسلة سداسية عشرية. يشيع استخدامها في Ethereum hashes وعناوينه. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **ملاحظة:** مصدر البيانات الجديد سيعالج فقط الاستدعاءات والأحداث للكتلة التي تم إنشاؤها فيه وجميع الكتل التالية ، ولكنه لن يعالج البيانات التاريخية ، أي البيانات الموجودة في الكتل السابقة. -> +> > إذا كانت الكتل السابقة تحتوي على بيانات ذات صلة بمصدر البيانات الجديد ، فمن الأفضل فهرسة تلك البيانات من خلال قراءة الحالة الحالية للعقد وإنشاء كيانات تمثل تلك الحالة في وقت إنشاء مصدر البيانات الجديد. ### سياق مصدر البيانات @@ -703,7 +703,7 @@ dataSources: ``` > **ملاحظة:** يمكن البحث عن كتلة إنشاء العقد بسرعة على Etherscan: -> +> > 1. ابحث عن العقد بإدخال عنوانه في شريط البحث. > 2. انقر فوق hash إجراء الإنشاء في قسم `Contract Creator`. > 3. قم بتحميل صفحة تفاصيل الإجراء(transaction) حيث ستجد كتلة البدء لذلك العقد. diff --git a/website/pages/ar/glossary.mdx b/website/pages/ar/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/ar/glossary.mdx +++ b/website/pages/ar/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/ar/network/explorer.mdx b/website/pages/ar/network/explorer.mdx index 6fadebb1d922..ecd2f2798a6a 100644 --- a/website/pages/ar/network/explorer.mdx +++ b/website/pages/ar/network/explorer.mdx @@ -87,7 +87,7 @@ If you want to learn more about the Curator role, you can do so by visiting the - كمية ال GRT التي يمتلكونها حاليا في البروتوكول - تاريخ آخر تفويض لهم -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/ar/substreams/[[...slug]].mdx b/website/pages/ar/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/ar/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/de/cookbook/arweave.mdx b/website/pages/de/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/de/cookbook/arweave.mdx +++ b/website/pages/de/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/de/cookbook/cosmos.mdx b/website/pages/de/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/de/cookbook/cosmos.mdx +++ b/website/pages/de/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/de/cookbook/near.mdx b/website/pages/de/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/de/cookbook/near.mdx +++ b/website/pages/de/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/de/cookbook/subgraph-debug-forking.mdx b/website/pages/de/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/de/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/de/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/de/developing/creating-a-subgraph.mdx b/website/pages/de/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/de/developing/creating-a-subgraph.mdx +++ b/website/pages/de/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/de/glossary.mdx b/website/pages/de/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/de/glossary.mdx +++ b/website/pages/de/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/de/network/explorer.mdx b/website/pages/de/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/de/network/explorer.mdx +++ b/website/pages/de/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/de/substreams/[[...slug]].mdx b/website/pages/de/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/de/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/es/cookbook/arweave.mdx b/website/pages/es/cookbook/arweave.mdx index d91be92da856..b2e398ec8e9b 100644 --- a/website/pages/es/cookbook/arweave.mdx +++ b/website/pages/es/cookbook/arweave.mdx @@ -166,7 +166,7 @@ El endpoint de GraphQL para los subgrafos de Arweave está determinado por la de A continuación se muestra un ejemplo de subgrafo como referencia: -- [Ejemplo de subgrafo para Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Ejemplo de subgrafo para Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## Preguntas frecuentes diff --git a/website/pages/es/cookbook/base-testnet.mdx b/website/pages/es/cookbook/base-testnet.mdx index 0fdff9325e9e..383ed1cc7db1 100644 --- a/website/pages/es/cookbook/base-testnet.mdx +++ b/website/pages/es/cookbook/base-testnet.mdx @@ -6,12 +6,12 @@ Esta guía te conducirá rápidamente a través de cómo iniciar, crear e deploy Lo que necesitarás: -- Una dirección de contrato de Base testnet -- Una wallet cripto (por ejemplo, MetaMask o Coinbase Wallet) +- Una dirección de contrato de Base testnet +- Una wallet cripto (por ejemplo, MetaMask o Coinbase Wallet) ## Subgraph Studio -### 1. Instala The Graph CLI +### 1. Instala The Graph CLI La CLI de The Graph (>=v0.41.0) está escrita en JavaScript y necesitarás tener instalado `npm` o `yarn` para usarlo. @@ -23,7 +23,7 @@ npm install -g @graphprotocol/graph-cli yarn global add @graphprotocol/graph-cli ``` -### 2. Crea tu subgrafo en Subgraph Studio +### 2. Crea tu subgrafo en Subgraph Studio Ve a [Subgraph Studio](https://thegraph.com/studio/) y conecta tu wallet crypto. @@ -31,7 +31,7 @@ Una vez conectado, haz clic en "Crear un subgrafo" e ingresa un nombre para tu s Selecciona "Base (testnet)" como la cadena de bloques indexada y haz clic en Crear subgrafo. -### 3. Inicia tu subgrafo +### 3. Inicia tu subgrafo > Puedes encontrar comandos específicos para su subgrafo en Subgraph Studio. @@ -49,29 +49,29 @@ graph init --studio Tu slug de subgrafo es un identificador para tu subgrafo. La herramienta CLI te guiará a través de los pasos para crear un subgrafo, que incluyen: -- Protocolo: ethereum -- Slug de subgrafo: `` -- Directorio para crear el subgrafo en: `` -- Red Ethereum: base-testnet \_ Dirección del contrato: `` -- Bloque de inicio (opcional) -- Nombre del contrato: `` -- Sí/no a los eventos de indexación (sí significa que tu subgrafo se iniciará con entidades en el esquema y asignaciones simples para eventos emitidos) +- Protocolo: ethereum +- Slug de subgrafo: `` +- Directorio para crear el subgrafo en: `` +- Red Ethereum: base-testnet \_ Dirección del contrato: `` +- Bloque de inicio (opcional) +- Nombre del contrato: `` +- Sí/no a los eventos de indexación (sí significa que tu subgrafo se iniciará con entidades en el esquema y asignaciones simples para eventos emitidos) -### 3. Escribe tu subgrafo +### 3. Escribe tu subgrafo > Si los eventos emitidos son lo único que deseas indexar, entonces no se requiere trabajo adicional y puedes pasar al siguiente paso. El comando anterior crea un subgrafo de andamio que puedes usar como punto de partida para construir tu subgrafo. Al realizar cambios en el subgrafo, trabajarás principalmente con tres archivos: -- Manifiesto (subgraph.yaml): el manifiesto define qué fuentes de datos indexarán tus subgrafos. Asegúrate de agregar `base-testnet` como el nombre de la red en el archivo de manifiesto para implementar tu subgrafo en Base testnet. -- Schema (schema.graphql) - El esquema GraphQL define los datos que deseas recuperar del subgrafo. -- AssemblyScript Mappings (mapping.ts) - Este es el código que traduce los datos de tus fuentes de datos a las entidades definidas en el esquema. +- Manifiesto (subgraph.yaml): el manifiesto define qué fuentes de datos indexarán tus subgrafos. Asegúrate de agregar `base-testnet` como el nombre de la red en el archivo de manifiesto para implementar tu subgrafo en Base testnet. +- Schema (schema.graphql) - El esquema GraphQL define los datos que deseas recuperar del subgrafo. +- AssemblyScript Mappings (mapping.ts) - Este es el código que traduce los datos de tus fuentes de datos a las entidades definidas en el esquema. Si deseas indexar datos adicionales, deberás ampliar el manifiesto, el esquema y los mappings. Para obtener más información sobre cómo escribir tu subgrafo, consulta [Crear un subgrafo](/developing/creating-a-subgraph). -### 4. Deploy en Subgraph Studio +### 4. Deploy en Subgraph Studio Antes de que puedas deployar tu subgraph, deberás autenticarte con Subgraph Studio. Puedes hacer esto ejecutando el siguiente comando: @@ -103,7 +103,7 @@ graph deploy --studio ``` ```` -### 5. Consulta tu subgrafo +### 5. Consulta tu subgrafo Una vez que se deploya tu subgrafo, puedes consultarlo desde tu dapp utilizando la "URL de consulta de desarrollo" en Subgraph Studio. diff --git a/website/pages/es/cookbook/cosmos.mdx b/website/pages/es/cookbook/cosmos.mdx index 49debaec9cb7..7c9752513d96 100644 --- a/website/pages/es/cookbook/cosmos.mdx +++ b/website/pages/es/cookbook/cosmos.mdx @@ -170,7 +170,7 @@ Cada tipo de handler viene con su propia estructura de datos que se pasa como ar - Los handlers de transacciones reciben el tipo `TransactionData`. - Los handlers de mensajes reciben el tipo `MessageData`. -Como parte de `MessageData`, el message handler recibe un contexto de transacción, que contiene la información más importante sobre una transacción que abarca un mensaje. El contexto de transacción también está disponible en el tipo `EventData`, pero solo cuando el evento correspondiente está asociado con una transacción. Además, todos los controladores reciben una referencia a un bloque (`HeaderOnlyBlock`). +Como parte de `MessageData`, el message handler recibe un contexto de transacción, que contiene la información más importante sobre una transacción que abarca un mensaje. El contexto de transacción también está disponible en el tipo ` EventData `, pero solo cuando el evento correspondiente está asociado con una transacción. Además, todos los controladores reciben una referencia a un bloque (` HeaderOnlyBlock `). Puedes encontrar una lista completa de los tipos para la integración Cosmos aquí [here](https://github.com/graphprotocol/graph-ts/blob/4c064a8118dff43b110de22c7756e5d47fcbc8df/chain/cosmos.ts). @@ -178,7 +178,7 @@ Puedes encontrar una lista completa de los tipos para la integración Cosmos aqu Es importante tener en cuenta que los mensajes de Cosmos son específicos de la cadena y se pasan a un subgrafo en forma de una carga de Protocol Buffers serializada [Protocol Buffers](https://developers.google.com/protocol-buffers/) Como resultado, los datos del mensaje deben decodificarse en una función de mapeo antes de que puedan ser procesados. Un ejemplo de cómo decodificar los datos de un mensaje en un subgrafo se puede encontrar aquí. -Un ejemplo de cómo decodificar los datos de un mensaje en un subgrafo se puede encontrar aquí [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Crear y construir un subgrafo de Cosmos @@ -250,10 +250,10 @@ La red principal de Osmosis es `osmosis-1`. La red de prueba actual de Osmosis e A continuación se presentan algunos ejemplos de subgrafos como referencia: -[Ejemplo de filtrado de bloques](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Ejemplo de filtrado de bloques](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Ejemplo de recompensas del validador](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Ejemplo de recompensas del validador](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Ejemplo de delegaciones de validador](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Ejemplo de delegaciones de validador](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Ejemplo de intercambio de tokens de Osmosis](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Ejemplo de intercambio de tokens de Osmosis](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/es/cookbook/near.mdx b/website/pages/es/cookbook/near.mdx index 363d37ae8529..c5c079141781 100644 --- a/website/pages/es/cookbook/near.mdx +++ b/website/pages/es/cookbook/near.mdx @@ -235,9 +235,9 @@ El endpoint de GraphQL para los subgrafos NEAR está determinado por la definici A continuación se presentan algunos ejemplos de subgrafos como referencia: -[Bloques NEAR](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[Bloques NEAR](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[Recibos NEAR](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[Recibos NEAR](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## Preguntas frecuentes diff --git a/website/pages/es/cookbook/quick-start.mdx b/website/pages/es/cookbook/quick-start.mdx index 2c57e5106073..490a829d3f9b 100644 --- a/website/pages/es/cookbook/quick-start.mdx +++ b/website/pages/es/cookbook/quick-start.mdx @@ -14,13 +14,13 @@ This guide is written assuming that you have: ## 1. Create a subgraph on Subgraph Studio -Ve a Subgraph Studio [https://thegraph.com/studio/](https://thegraph.com/studio/) y conecta tu wallet. +Go to the Subgraph Studio [https://thegraph.com/studio/](https://thegraph.com/studio/) and connect your wallet. Once connected, you can begin by clicking “create a subgraph.” Select the network of your choice and click continue. ## 2. Install the Graph CLI -The Graph CLI esta escrito en JavaScript y necesitaras tener `npm` o `yarn` instalado para usarlo. +The Graph CLI is written in JavaScript and you will need to have either `npm` or `yarn` installed to use it. On your local machine, run one of the following commands: @@ -44,7 +44,7 @@ When you initialize your subgraph, the CLI tool will ask you for the following i - Ethereum network(optional): you may need to specify which EVM-compatible network your subgraph will be indexing data from - Contract address: Locate the smart contract address you’d like to query data from - ABI: If the ABI is not autopopulated, you will need to input it manually as a JSON file -- Start Block: it is suggested that you input the start block to save time while your subgraph indexes blockchain data. You can locate the start block by finding the block where your contract was deployed. +- Bloque de inicio: se sugiere que ingreses el bloque de inicio para ahorrar tiempo mientras tu subgrafo indexa los datos de la cadena de bloques. Puedes ubicar el bloque de inicio encontrando el bloque en el que se implementó tu contrato. - Contract Name: input the name of your contract - Index contract events as entities: it is suggested that you set this to true as it will automatically add mappings to your subgraph for every emitted event - Add another contract(optional): you can add another contract diff --git a/website/pages/es/cookbook/subgraph-debug-forking.mdx b/website/pages/es/cookbook/subgraph-debug-forking.mdx index 08177fcca5ac..edc8eaf340d8 100644 --- a/website/pages/es/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/es/cookbook/subgraph-debug-forking.mdx @@ -14,11 +14,11 @@ En el contexto de la depuración, **subgraph forking** te permite depurar tu sub Cuando implementas un subgrafo en un nodo Graph remoto para la indexación y falla en el bloque _X_, la buena noticia es que el nodo Graph seguirá atendiendo consultas de GraphQL usando su tienda, que está sincronizado para bloquear _X_. ¡Genial! Esto significa que podemos aprovechar esta tienda "actualizada" para corregir los errores que surgen al indexar el bloque _X_. -En pocas palabras, vamos a _bifurcar el subgrafo fallido_ desde un nodo de Graph remoto que garantiza que el subgrafo se indexe para bloquear _X_ para proporcionar al subgrafo implementado localmente que se está depurando en el bloque _X_ una vista actualizada del estado de indexación. +En pocas palabras, vamos a _bifurcar el subgrafo fallido_ desde un nodo de Graph remoto que garantiza que el subgrafo se indexe para bloquear *X* para proporcionar al subgrafo implementado localmente que se está depurando en el bloque _X_ una vista actualizada del estado de indexación. ## ¡Por favor, muéstrame algo de código! -Para mantenernos enfocados en el debugging de subgrafos, simplifiquemos las cosas y sigamos con el [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) que indexa el contrato inteligente Ethereum Gravity. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Estos son los handlers definidos para indexar `Gravatar`s, sin errores de ningún tipo: diff --git a/website/pages/es/developing/creating-a-subgraph.mdx b/website/pages/es/developing/creating-a-subgraph.mdx index 82f4b4d2c821..acc61955fdd4 100644 --- a/website/pages/es/developing/creating-a-subgraph.mdx +++ b/website/pages/es/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ Para este subgrafo de ejemplo, `subgraph.yaml` es: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ Para algunos tipos de entidad, el `id` se construye a partir de los id de otras Admitimos los siguientes escalares en nuestra API GraphQL: -| Tipo | Descripción | -| --- | --- | -| `Bytes` | Byte array, representado como un string hexadecimal. Comúnmente utilizado para los hashes y direcciones de Ethereum. | -| `String` | Escalar para valores `string`. Los caracteres nulos no son compatibles y se eliminan automáticamente. | -| `Boolean` | Escalar para valores `boolean`. | -| `Int` | La especificación GraphQL define `Int` con un tamaño de 32 bytes. | -| `BigInt` | Números enteros grandes. Se utiliza para los tipos `uint32`, `int64`, `uint64`, ..., `uint256` de Ethereum. Nota: Todo por debajo de `uint32`, como `int32`, `uint24` o `int8` se representa como `i32`. | -| `BigDecimal` | `BigDecimal` Decimales de alta precisión representados como un signo y un exponente. El rango de exponentes va de -6143 a +6144. Redondeado a 34 dígitos significativos. | +| Tipo | Descripción | +| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Bytes` | Byte array, representado como un string hexadecimal. Comúnmente utilizado para los hashes y direcciones de Ethereum. | +| `String` | Escalar para valores `string`. Los caracteres nulos no son compatibles y se eliminan automáticamente. | +| `Boolean` | Escalar para valores `boolean`. | +| `Int` | La especificación GraphQL define `Int` con un tamaño de 32 bytes. | +| `BigInt` | Números enteros grandes. Se utiliza para los tipos `uint32`, `int64`, `uint64`, ..., `uint256` de Ethereum. Nota: Todo por debajo de `uint32`, como `int32`, `uint24` o `int8` se representa como `i32`. | +| `BigDecimal` | `BigDecimal` Decimales de alta precisión representados como un signo y un exponente. El rango de exponentes va de -6143 a +6144. Redondeado a 34 dígitos significativos. | #### Enums @@ -468,10 +468,10 @@ Diccionarios de idiomas admitidos: Algoritmos admitidos para ordenar los resultados: -| Algoritmos | Descripción | -| --- | --- | -| rango | Usa la calidad de coincidencia (0-1) de la consulta de texto completo para ordenar los resultados. | -| rango de proximidad | Similar al rango, pero también incluye la proximidad de los matches. | +| Algoritmos | Descripción | +| ------------------- | -------------------------------------------------------------------------------------------------- | +| rango | Usa la calidad de coincidencia (0-1) de la consulta de texto completo para ordenar los resultados. | +| rango de proximidad | Similar al rango, pero también incluye la proximidad de los matches. | ## Escribir Mappings @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Nota:** Un nuevo origen de datos sólo procesará las llamadas y los eventos del bloque en el que fue creado y todos los bloques siguientes, pero no procesará los datos históricos, es decir, los datos que están contenidos en bloques anteriores. -> +> > Si los bloques anteriores contienen datos relevantes para la nueva fuente de datos, lo mejor es indexar esos datos leyendo el estado actual del contrato y creando entidades que representen ese estado en el momento de crear la nueva fuente de datos. ### Contexto de la fuente de datos @@ -703,7 +703,7 @@ dataSources: ``` > **Nota:** El bloque de creación del contrato se puede buscar rápidamente en Etherscan: -> +> > 1. Busca el contrato introduciendo su dirección en la barra de búsqueda. > 2. Haz clic en el hash de la transacción de creación en la sección `Contract Creator`. > 3. Carga la página de detalles de la transacción, donde encontrarás el bloque inicial de ese contrato. diff --git a/website/pages/es/glossary.mdx b/website/pages/es/glossary.mdx index e890a6a91936..1339b93c7747 100644 --- a/website/pages/es/glossary.mdx +++ b/website/pages/es/glossary.mdx @@ -8,6 +8,8 @@ title: Glosario - **GraphQL**: Un lenguaje de consulta para APIs y un tiempo de ejecución para cumplir esas consultas con datos existentes. The Graph utiliza GraphQL para consultar subgrafos. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgrafo (Subgraph)**: Una API personalizada basada en datos de la blockchain que puede consultarse mediante [GraphQL](https://graphql.org/). Los developers pueden crear, deployar y publicar subgrafos en la red descentralizada de The Graph. Luego, los Indexadores pueden empezar a indexar los subgrafos para que los consumidores de subgrafos puedan consultarlos. - **Servicio Alojado (Hosted Service)**: Un servicio de plataforma temporal para construir y consultar subgrafos mientras la red descentralizada de The Graph madura su coste de servicio, calidad y experiencia del developer. diff --git a/website/pages/es/graphcast.mdx b/website/pages/es/graphcast.mdx index a65adeadd73e..4bd72d1dee55 100644 --- a/website/pages/es/graphcast.mdx +++ b/website/pages/es/graphcast.mdx @@ -10,11 +10,11 @@ Currently, the cost to broadcast information to other network participants is de The Graphcast SDK (Software Development Kit) allows developers to build Radios, which are gossip-powered applications that Indexers can run to serve a given purpose. We also intend to create a few Radios (or provide support to other developers/teams that wish to build Radios) for the following use cases: -- Real-time cross-checking of subgraph data integrity ([POI Radio](https://docs.graphops.xyz/graphcast/radios/poi-radio)). -- Conducting auctions and coordination for warp syncing subgraphs, substreams, and Firehose data from other Indexers. -- Self-reporting on active query analytics, including subgraph request volumes, fee volumes, etc. -- Self-reporting on indexing analytics, including subgraph indexing time, handler gas costs, indexing errors encountered, etc. -- Self-reporting on stack information including graph-node version, Postgres version, Ethereum client version, etc. +- Real-time cross-checking of subgraph data integrity ([POI Radio](https://docs.graphops.xyz/graphcast/radios/poi-radio)). +- Conducting auctions and coordination for warp syncing subgraphs, substreams, and Firehose data from other Indexers. +- Self-reporting on active query analytics, including subgraph request volumes, fee volumes, etc. +- Self-reporting on indexing analytics, including subgraph indexing time, handler gas costs, indexing errors encountered, etc. +- Self-reporting on stack information including graph-node version, Postgres version, Ethereum client version, etc. ### Learn More diff --git a/website/pages/es/network/explorer.mdx b/website/pages/es/network/explorer.mdx index eb36dea39eb7..d125fe73c53a 100644 --- a/website/pages/es/network/explorer.mdx +++ b/website/pages/es/network/explorer.mdx @@ -87,7 +87,7 @@ La tabla de Delegadores te permitirá ver los Delegadores activos en la comunida - Cantidad total de GRT que tienen actualmente dentro del protocolo - La fecha en la que delegaron por última vez -Si deseas obtener más información sobre cómo convertirte en Delegador, ¡no busques más! Todo lo que tienes que hacer es dirigirte a la [documentación oficial](/network/delegating) o [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Red diff --git a/website/pages/es/querying/graphql-api.mdx b/website/pages/es/querying/graphql-api.mdx index 077d900999ce..6e8fa62a6996 100644 --- a/website/pages/es/querying/graphql-api.mdx +++ b/website/pages/es/querying/graphql-api.mdx @@ -2,7 +2,7 @@ title: API GraphQL --- -Esta guía explica la API de consulta GraphQL que se utiliza para the Graph Protocol. +Esta guía explica la API de consulta GraphQL que se utiliza para The Graph Protocol. ## Consultas @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| Símbolo | Operador | Descripción | -| --- | --- | --- | -| `&` | `And` | Para combinar varios términos de búsqueda en un filtro para entidades que incluyen todos los términos proporcionados | -| | | `O` | Las consultas con varios términos de búsqueda separados por o el operador devolverá todas las entidades que coincidan con cualquiera de los términos proporcionados | -| `<->` | `Follow by` | Especifica la distancia entre dos palabras. | -| `:*` | `Prefijo` | Utilice el término de búsqueda del prefijo para encontrar palabras cuyo prefijo coincida (se requieren 2 caracteres.) | +| Símbolo | Operador | Descripción | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `&` | `And` | Para combinar varios términos de búsqueda en un filtro para entidades que incluyen todos los términos proporcionados | +| | | `O` | Las consultas con varios términos de búsqueda separados por o el operador devolverá todas las entidades que coincidan con cualquiera de los términos proporcionados | +| `<->` | `Follow by` | Especifica la distancia entre dos palabras. | +| `:*` | `Prefijo` | Utilice el término de búsqueda del prefijo para encontrar palabras cuyo prefijo coincida (se requieren 2 caracteres.) | #### Examples diff --git a/website/pages/es/substreams/[[...slug]].mdx b/website/pages/es/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/es/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/fr/cookbook/arweave.mdx b/website/pages/fr/cookbook/arweave.mdx index c6c83b281322..cde716f93d53 100644 --- a/website/pages/fr/cookbook/arweave.mdx +++ b/website/pages/fr/cookbook/arweave.mdx @@ -166,7 +166,7 @@ Le endpoint GraphQL pour les subgraphes d'Arweave est déterminé par la défini Voici un exemple de modèle subgraphe : -- [Exemple de subgraphe pour Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Exemple de subgraphe pour Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/fr/cookbook/cosmos.mdx b/website/pages/fr/cookbook/cosmos.mdx index 62a844df631d..3685f704a042 100644 --- a/website/pages/fr/cookbook/cosmos.mdx +++ b/website/pages/fr/cookbook/cosmos.mdx @@ -63,7 +63,7 @@ dataSources: language: wasm/assemblyscript blockHandlers: - handler: handleNewBlock # le nom de la fonction dans le fichier de mapping - Gestionnaires d'événements: + Gestionnaires d'événements : - event: rewards # le type d'événement qui sera traité handler: handleReward # le nom de la fonction dans le fichier de mapping transactionHandlers: @@ -178,7 +178,7 @@ Vous pouvez trouver la liste complète des types pour l'intégration Cosmos [ici Il est important de noter que les messages Cosmos sont spécifiques à une chaîne et qu'ils sont transmis à un sous-graphe sous la forme d'une charge utile sérialisée [Protocol Buffers](https://developers.google.com/protocol-buffers/). Par conséquent, les données du message doivent être décodées dans une fonction de mappage avant de pouvoir être traitées. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Création et construction d'un subgraphe Cosmos @@ -250,10 +250,10 @@ Le réseau principal d'Osmosis est `osmosis-1`. Le réseau de test actuel d'Osmo Voici quelques exemples de subgraphes pour référence : -[Exemple de filtrage par blocs](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Exemple de filtrage par blocs](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Exemple de récompenses de validateurs](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Exemple de récompenses de validateurs](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Exemple de délégation de validateurs](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Exemple de délégation de validateurs](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Exemple d'échange de jetons Osmosis](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Exemple d'échange de jetons Osmosis](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/fr/cookbook/near.mdx b/website/pages/fr/cookbook/near.mdx index c03c1ee32ab7..5c57a62fbcef 100644 --- a/website/pages/fr/cookbook/near.mdx +++ b/website/pages/fr/cookbook/near.mdx @@ -235,9 +235,9 @@ Le point de terminaison GraphQL pour les subgraphes NEAR est déterminé par la Voici quelques exemples de subgraphes pour référence : -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/fr/cookbook/subgraph-debug-forking.mdx b/website/pages/fr/cookbook/subgraph-debug-forking.mdx index 824f5a630f85..50e1f8478ace 100644 --- a/website/pages/fr/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/fr/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ En bref, nous allons _fork le subgraphe défaillant_ à partir d'un nœud The Gr ## Je vous en prie, montrez-moi du code ! -Pour rester concentré sur le débogage des subgraphes, gardons les choses simples et suivons l'[exemple du subgraphe](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexant le contrat intelligent Ethereum Gravity. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Voici les gestionnaires définis pour l'indexation des `Gravatars`, sans le moindre bug : diff --git a/website/pages/fr/developing/creating-a-subgraph.mdx b/website/pages/fr/developing/creating-a-subgraph.mdx index 750c7001d62d..67b939f6325e 100644 --- a/website/pages/fr/developing/creating-a-subgraph.mdx +++ b/website/pages/fr/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/fr/glossary.mdx b/website/pages/fr/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/fr/glossary.mdx +++ b/website/pages/fr/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/fr/network/explorer.mdx b/website/pages/fr/network/explorer.mdx index e11ec8ec182a..06ce138ba711 100644 --- a/website/pages/fr/network/explorer.mdx +++ b/website/pages/fr/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/fr/substreams/[[...slug]].mdx b/website/pages/fr/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/fr/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/hi/cookbook/arweave.mdx b/website/pages/hi/cookbook/arweave.mdx index ff9992342dba..7bba73f38de2 100644 --- a/website/pages/hi/cookbook/arweave.mdx +++ b/website/pages/hi/cookbook/arweave.mdx @@ -166,7 +166,7 @@ graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph सहायता के एक सब-ग्राफ का उदाहरण -- [आरवीव के लिए उदाहरण सब-ग्राफ](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [आरवीव के लिए उदाहरण सब-ग्राफ](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## सामान्य प्रश्न diff --git a/website/pages/hi/cookbook/base-testnet.mdx b/website/pages/hi/cookbook/base-testnet.mdx index caf0b047fd97..f4990653bdcb 100644 --- a/website/pages/hi/cookbook/base-testnet.mdx +++ b/website/pages/hi/cookbook/base-testnet.mdx @@ -6,12 +6,12 @@ title: आधार पर सबग्राफ बनाना आपको किस चीज़ की ज़रूरत पड़ेगी: -- एक बेस टेस्टनेट अनुबंध पता -- एक क्रिप्टो वॉलेट (जैसे मेटामास्क या कॉइनबेस वॉलेट) +- एक बेस टेस्टनेट अनुबंध पता +- एक क्रिप्टो वॉलेट (जैसे मेटामास्क या कॉइनबेस वॉलेट) ## सबग्राफ स्टूडियो -### 1. ग्राफ़ सीएलआई इनस्टॉल करें +### 1. ग्राफ़ सीएलआई इनस्टॉल करें ग्राफ़ सीएलआई (>=v0.41.0) जावास्क्रिप्ट में लिखा गया है और इसका उपयोग करने के लिए आपको या तो `npm` या `यार्न` स्थापित करने की आवश्यकता होगी। @@ -23,7 +23,7 @@ npm install -g @graphprotocol/graph-cli yarn global add @graphprotocol/graph-cli ``` -### 2. सबग्राफ स्टूडियो में अपना सबग्राफ बनाएं +### 2. सबग्राफ स्टूडियो में अपना सबग्राफ बनाएं [सबग्राफ स्टूडियो](https://thegraph.com/studio/) पर जाएं और अपने क्रिप्टो वॉलेट को कनेक्ट करें। @@ -31,7 +31,7 @@ yarn global add @graphprotocol/graph-cli ब्लॉकचेनअनुक्रमित ब्लॉकचेन के रूप में "बेस (टेस्टनेट)" का चयन करें और क्रिएट सबग्राफ पर क्लिक करें। -### 3. अपना सबग्राफ इनिशियलाइज़ करें +### 3. अपना सबग्राफ इनिशियलाइज़ करें > आप सबग्राफ स्टूडियो में अपने सबग्राफ के लिए विशिष्ट कमांड पा सकते हैं। @@ -49,29 +49,29 @@ graph init --studio आपका सबग्राफ स्लग आपके सबग्राफ के लिए एक पहचानकर्ता है। सीएलआई उपकरण आपको एक सबग्राफ बनाने के चरणों के बारे में बताएगा, जिसमें निम्न शामिल हैं: -- प्रोटोकॉल: एथेरियम -- सबग्राफ स्लग: `` -- सबग्राफ बनाने के लिए निर्देशिका: `` -- एथेरियम नेटवर्क: बेस-टेस्टनेट \_ अनुबंध पता: `` -- स्टार्ट ब्लॉक (वैकल्पिक) -- अनुबंध का नाम: `` -- इंडेक्सिंग इवेंट्स के लिए हां/नहीं (हां का मतलब है कि आपका सबग्राफ स्कीमा में इकाइयों के साथ बूटस्ट्रैप किया जाएगा और उत्सर्जित घटनाओं के लिए सरल मैपिंग) +- प्रोटोकॉल: एथेरियम +- सबग्राफ स्लग: `` +- सबग्राफ बनाने के लिए निर्देशिका: `` +- एथेरियम नेटवर्क: बेस-टेस्टनेट \_ अनुबंध पता: `` +- स्टार्ट ब्लॉक (वैकल्पिक) +- अनुबंध का नाम: `` +- इंडेक्सिंग इवेंट्स के लिए हां/नहीं (हां का मतलब है कि आपका सबग्राफ स्कीमा में इकाइयों के साथ बूटस्ट्रैप किया जाएगा और उत्सर्जित घटनाओं के लिए सरल मैपिंग) -### 3. अपना सबग्राफ लिखें +### 3. अपना सबग्राफ लिखें > यदि उत्सर्जित ईवेंट ही एकमात्र ऐसी चीज़ है जिसे आप अनुक्रमित करना चाहते हैं, तो किसी अतिरिक्त कार्य की आवश्यकता नहीं है, और आप अगले चरण पर जा सकते हैं। पिछला कमांड एक स्कैफोल्ड सबग्राफ बनाता है जिसे आप अपना सबग्राफ बनाने के लिए शुरुआती बिंदु के रूप में उपयोग कर सकते हैं। सबग्राफ में बदलाव करते समय, आप मुख्य रूप से तीन फाइलों के साथ काम करेंगे: -- मेनिफेस्ट (subgraph.yaml) - मेनिफेस्ट परिभाषित करता है कि आपके सबग्राफ को कौन से डेटा स्रोत इंडेक्स करेंगे। बेस टेस्टनेट पर अपने सबग्राफ को तैनात करने के लिए मेनिफेस्ट फ़ाइल में नेटवर्क नाम के रूप में 'बेस-टेस्टनेट' जोड़ना सुनिश्चित करें। -- स्कीमा (schema.graphql) - ग्राफक्यूएल स्कीमा परिभाषित करता है कि आप सबग्राफ से कौन सा डेटा प्राप्त करना चाहते हैं। -- असेंबलीस्क्रिप्ट मैपिंग (mapping.ts) - यह वह कोड है जो स्कीमा में परिभाषित इकाई के लिए आपके डेटा सोर्स से डेटा का अनुवाद करता है। +- मेनिफेस्ट (subgraph.yaml) - मेनिफेस्ट परिभाषित करता है कि आपके सबग्राफ को कौन से डेटा स्रोत इंडेक्स करेंगे। बेस टेस्टनेट पर अपने सबग्राफ को तैनात करने के लिए मेनिफेस्ट फ़ाइल में नेटवर्क नाम के रूप में 'बेस-टेस्टनेट' जोड़ना सुनिश्चित करें। +- स्कीमा (schema.graphql) - ग्राफक्यूएल स्कीमा परिभाषित करता है कि आप सबग्राफ से कौन सा डेटा प्राप्त करना चाहते हैं। +- असेंबलीस्क्रिप्ट मैपिंग (mapping.ts) - यह वह कोड है जो स्कीमा में परिभाषित इकाई के लिए आपके डेटा सोर्स से डेटा का अनुवाद करता है। यदि आप अतिरिक्त डेटा को अनुक्रमित करना चाहते हैं, तो आपको मेनिफेस्ट, स्कीमा और मैपिंग का विस्तार करने की आवश्यकता होगी। अपना सबग्राफ कैसे लिखना है, इस बारे में अधिक जानकारी के लिए, [Creating a Subgraph](/developing/creating-a-subgraph). -### 4. सबग्राफ स्टूडियो में तैनात करें +### 4. सबग्राफ स्टूडियो में तैनात करें इससे पहले कि आप अपना सबग्राफ तैनात कर सकें, आपको सबग्राफ स्टूडियो से प्रमाणित करना होगा। आप निम्न आदेश चलाकर ऐसा कर सकते हैं: @@ -103,7 +103,7 @@ graph deploy --studio ``` ```` -### 5. अपना सबग्राफ पूछें +### 5. अपना सबग्राफ पूछें एक बार आपका सबग्राफ तैनात हो जाने के बाद, आप सबग्राफ स्टूडियो में `डेवलपमेंट क्वेरी URL` का उपयोग करके इसे अपने डैप से क्वेरी कर सकते हैं। diff --git a/website/pages/hi/cookbook/cosmos.mdx b/website/pages/hi/cookbook/cosmos.mdx index a5872c660f26..b98bba42b139 100644 --- a/website/pages/hi/cookbook/cosmos.mdx +++ b/website/pages/hi/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ class Any { यह गौर करना अत्यंत जरुरी है कि कॉसमॉस के मैसेज चेन-विशिष्ट हैं और उन्हें सब-ग्राफ्स में एक क्रमबद्ध [प्रोटोकॉल बफर्स](https://developers.google.com/protocol-buffers/) की तरह पास किया जाता है| परिणामस्वरूप, मैसेज के डाटा को प्रोसेस करने से पहले मैपिंग फंक्शन में डिकोड करने की आवश्यकता होती है| -सब-ग्राफ में मैसेज डिकोड करने का एक उदहारण [यहाँ](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts) से देखें| +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## कॉसमॉस सब-ग्राफ्स बनाना और निर्माण करना @@ -250,10 +250,10 @@ graph deploy subgraph-name --node http://localhost:8020/ --ipfs http://localhost सन्दर्भ के लिए कुछ सब-ग्राफ्स के उदाहरण: -[ब्लॉक फ़िल्टर उदहारण](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[ब्लॉक फ़िल्टर उदहारण](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[सत्यापनकर्ता इनाम उदाहरण](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[सत्यापनकर्ता इनाम उदाहरण](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[सत्यापनकर्ता प्रतिनिधि मंडल उदाहरण](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[सत्यापनकर्ता प्रतिनिधि मंडल उदाहरण](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[ऑस्मोसिस टोकन अदला-बदली उदाहरण](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[ऑस्मोसिस टोकन अदला-बदली उदाहरण](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/hi/cookbook/near.mdx b/website/pages/hi/cookbook/near.mdx index 6651dadba0e6..f6439ed027cf 100644 --- a/website/pages/hi/cookbook/near.mdx +++ b/website/pages/hi/cookbook/near.mdx @@ -235,9 +235,9 @@ NEAR सबग्राफ के लिए ग्राफक्यूएल संदर्भ के लिए यहां कुछ उदाहरण सबग्राफ दिए गए हैं: -[NEAR ब्लॉक्स](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR ब्लॉक्स](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR रेसिप्टस](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR रेसिप्टस](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## सामान्य प्रश्न diff --git a/website/pages/hi/cookbook/subgraph-debug-forking.mdx b/website/pages/hi/cookbook/subgraph-debug-forking.mdx index e21dd55ae61e..aa013c3c83fc 100644 --- a/website/pages/hi/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/hi/cookbook/subgraph-debug-forking.mdx @@ -8,17 +8,17 @@ title: फोर्क्स का उपयोग करके त्वरि **सबग्राफ फोर्किंग** आलसी ढंग से _दूसरे_ सबग्राफ के स्टोर (आमतौर पर एक परोक्ष सबग्राफ) से इकाइयां को लाने की प्रक्रिया है। -डिबगिंग के संदर्भ में, **सबग्राफ फोर्किंग** आपको ब्लॉक*X* को सिंक-अप करने के लिए बिना प्रतीक्षा किए ब्लॉक _X_ पर अपने विफल सबग्राफ को डीबग करने की अनुमति देता है । +डिबगिंग के संदर्भ में, **सबग्राफ फोर्किंग** आपको ब्लॉक_X_ को सिंक-अप करने के लिए बिना प्रतीक्षा किए ब्लॉक _X_ पर अपने विफल सबग्राफ को डीबग करने की अनुमति देता है । ## क्या?! कैसे? -जब आप अनुक्रमण के लिए एक दूरस्थ ग्राफ़ नोड पर एक सबग्राफ तैनात करते हैं और यह ब्लॉक _X_ करने में विफल रहता है, तो अच्छी खबर यह है कि ग्राफ़ नोड अभी भी अपने स्टोर का उपयोग करके ग्राफ़क्यूएल क्वेरी को सर्व करेगा, जो ब्लॉक*X* में सिंक-अप है। एक दम बढ़िया! इसका मतलब यह है कि ब्लॉक _X_ को अनुक्रमित करते समय उत्पन्न होने वाली बग को ठीक करने के लिए हम इस "अप-टू-डेट" स्टोर का लाभ उठा सकते हैं। +जब आप अनुक्रमण के लिए एक दूरस्थ ग्राफ़ नोड पर एक सबग्राफ तैनात करते हैं और यह ब्लॉक _X_ करने में विफल रहता है, तो अच्छी खबर यह है कि ग्राफ़ नोड अभी भी अपने स्टोर का उपयोग करके ग्राफ़क्यूएल क्वेरी को सर्व करेगा, जो ब्लॉक_X_ में सिंक-अप है। एक दम बढ़िया! इसका मतलब यह है कि ब्लॉक _X_ को अनुक्रमित करते समय उत्पन्न होने वाली बग को ठीक करने के लिए हम इस "अप-टू-डेट" स्टोर का लाभ उठा सकते हैं। संक्षेप में, हम एक दूरस्थ ग्राफ नोड से _असफल सबग्राफ को फोर्क करने जा रहे हैं_ जो सबग्राफ को ब्लॉक _X_ तक अनुक्रमित होने की गारंटी देता है ताकि ब्लॉक _X_ पर डिबग किए जा रहे स्थानीय रूप से तैनात सबग्राफ को इंडेक्सिंग स्थिति का एक अप-टू-डेट दृश्य प्रदान हो सकें। ## कृपया मुझे कुछ कोड दिखाओ! -सबग्राफ डिबगिंग पर ध्यान केंद्रित करने के लिए, चीजों को सरल रखें और [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) एथेरियम ग्रेविटी स्मार्ट कॉन्ट्रैक्ट को इंडेक्स करने के साथ चलें। +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. `Gravatar`s को अनुक्रमणित करने के लिए परिभाषित हैंडलर यहां दिए गए हैं, बिना किसी बग के: diff --git a/website/pages/hi/deploying/deploying-a-subgraph-to-hosted.mdx b/website/pages/hi/deploying/deploying-a-subgraph-to-hosted.mdx index 6d3eca9af3bf..c0066e9fdc84 100644 --- a/website/pages/hi/deploying/deploying-a-subgraph-to-hosted.mdx +++ b/website/pages/hi/deploying/deploying-a-subgraph-to-hosted.mdx @@ -98,9 +98,9 @@ Options: } ``` -**ध्यान दें:** कॉन्फ़िग फ़ाइल में आपको कोई `टेम्प्लेट` (यदि आपके पास है) निर्दिष्ट करने की आवश्यकता नहीं है, केवल `डेटा सोर्स`। यदि `subgraph.yaml` फ़ाइल में कोई `टेम्प्लेट` घोषित है, तो उनका नेटवर्क स्वचालित रूप से `--network` विकल्प के साथ निर्दिष्ट एक में अपडेट हो जाएगा. +**ध्यान दें:** कॉन्फ़िग फ़ाइल में आपको कोई `टेम्प्लेट` (यदि आपके पास है) निर्दिष्ट करने की आवश्यकता नहीं है, केवल ` डेटा सोर्स `। यदि `subgraph.yaml` फ़ाइल में कोई `टेम्प्लेट` घोषित है, तो उनका नेटवर्क स्वचालित रूप से `--network` विकल्प के साथ निर्दिष्ट एक में अपडेट हो जाएगा. -अब, मान लें कि आप अपने सबग्राफ को `mainnet` और `goerli` नेटवर्क पर तैनात करना चाहते हैं, और यह आपका `subgraph.yaml` है: +अब, मान लें कि आप अपने सबग्राफ को ` mainnet ` और `goerli` नेटवर्क पर तैनात करना चाहते हैं, और यह आपका `subgraph.yaml` है: ```yaml # ... @@ -159,7 +159,7 @@ dataSources: अब आप `yarn deploy` करने के लिए तैयार हैं| -**ध्यान दें:** जैसा कि पहले उल्लेख किया गया है, `graph-cli 0.32.0` के बाद से आप सीधे `yarn deploy` चला सकते हैं `--नेटवर्क` विकल्प के साथ: +**ध्यान दें:** जैसा कि पहले उल्लेख किया गया है, `graph-cli 0.32.0` के बाद से आप सीधे `yarn deploy` चला सकते हैं ` --नेटवर्क ` विकल्प के साथ: ```sh # Using default networks.json file diff --git a/website/pages/hi/deploying/subgraph-studio.mdx b/website/pages/hi/deploying/subgraph-studio.mdx index 36c1e919d966..888b0683152b 100644 --- a/website/pages/hi/deploying/subgraph-studio.mdx +++ b/website/pages/hi/deploying/subgraph-studio.mdx @@ -37,7 +37,7 @@ title: सबग्राफ स्टूडियो का उपयोग क - आपका सबग्राफ नाम - छवि - विवरण -- श्रेणियां (जैसे `DeFi`, `NFTs`, `Governance`) +- श्रेणियां (जैसे ` DeFi `, ` NFTs `, `Governance`) - वेबसाइट ## ग्राफ नेटवर्क के साथ सबग्राफ अनुकूलता diff --git a/website/pages/hi/developing/assemblyscript-api.mdx b/website/pages/hi/developing/assemblyscript-api.mdx index 64ce64af253c..ffcb8d059e0e 100644 --- a/website/pages/hi/developing/assemblyscript-api.mdx +++ b/website/pages/hi/developing/assemblyscript-api.mdx @@ -43,14 +43,14 @@ npm install --save-dev @graphprotocol/graph-ts # NPM सबग्राफ मेनिफ़ेस्ट में `apiVersion` मैपिंग एपीआई संस्करण निर्दिष्ट करता है जो किसी दिए गए सबग्राफ़ के लिए ग्राफ़ नोड द्वारा चलाया जाता है। वर्तमान मैपिंग एपीआई संस्करण 0.0.6 है। -| संस्करण | रिलीज नोट्स | -| :-: | --- | -| 0.0.7 | जोड़े गए `TransactionReceipt` और `Log` कक्षाओं को Ethereum प्रकारों में
Added `receipt` फ़ील्ड को Ethereum Event ऑब्जेक्ट में जोड़ा गया | -| 0.0.6 | एथेरियम ट्रांजैक्शन ऑब्जेक्ट में `nonce` फील्ड जोड़ा गया
एथेरियम ब्लॉक ऑब्जेक्ट में `baseFeePerGas` जोड़ा गया | -| 0.0.5 | असेंबलीस्क्रिप्ट संस्करण 0.19.10 में अपग्रेड किया गया (इसमें ब्रेकिंग परिवर्तन शामिल हैं, कृपया [`माइग्रेशन गाइड`](/release-notes/assemblyscript-migration-guide) देखें)
`ethereum.transaction.gasUsed` का नाम बदलकर `ethereum.transaction.gasLimit` कर दिया गया | -| 0.0.4 | एथेरियम स्मार्टकॉन्ट्रेक्टकॉल ऑब्जेक्ट में `functionSignature` फ़ील्ड जोड़ा गया | -| 0.0.3 | एथेरियम कॉल ऑब्जेक्ट में `from` फ़ील्ड जोड़ा गया
`etherem.call.address` का नाम बदलकर `ethereum.call.to` कर दिया गया | -| 0.0.2 | एथेरियम लेनदेन ऑब्जेक्ट में `input` फ़ील्ड जोड़ा गया | +| संस्करण | रिलीज नोट्स | +|:-------:| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0.0.7 | जोड़े गए `TransactionReceipt` और `Log` कक्षाओं को Ethereum प्रकारों में
Added `receipt` फ़ील्ड को Ethereum Event ऑब्जेक्ट में जोड़ा गया | +| 0.0.6 | एथेरियम ट्रांजैक्शन ऑब्जेक्ट में `nonce` फील्ड जोड़ा गया
एथेरियम ब्लॉक ऑब्जेक्ट में `baseFeePerGas` जोड़ा गया | +| 0.0.5 | असेंबलीस्क्रिप्ट संस्करण 0.19.10 में अपग्रेड किया गया (इसमें ब्रेकिंग परिवर्तन शामिल हैं, कृपया [`माइग्रेशन गाइड`](/release-notes/assemblyscript-migration-guide) देखें)
`ethereum.transaction.gasUsed` का नाम बदलकर `ethereum.transaction.gasLimit` कर दिया गया | +| 0.0.4 | एथेरियम स्मार्टकॉन्ट्रेक्टकॉल ऑब्जेक्ट में `functionSignature` फ़ील्ड जोड़ा गया | +| 0.0.3 | एथेरियम कॉल ऑब्जेक्ट में `from` फ़ील्ड जोड़ा गया
`etherem.call.address` का नाम बदलकर `ethereum.call.to` कर दिया गया | +| 0.0.2 | एथेरियम लेनदेन ऑब्जेक्ट में `input` फ़ील्ड जोड़ा गया | ### अंतर्निहित प्रकार @@ -524,18 +524,14 @@ import { log } from '@graphprotocol/graph-ts' `लॉग` एपीआई एक प्रारूप स्ट्रिंग और स्ट्रिंग मानों की एक सरणी लेता है। यह तब प्लेसहोल्डर्स को सरणी से स्ट्रिंग मानों के साथ बदल देता है। पहले `{}` प्लेसहोल्डर को सरणी में पहले मान से बदल दिया जाता है, दूसरे `{}` प्लेसहोल्डर को दूसरे मान से बदल दिया जाता है और इसी तरह। ```typescript -log.info('संदेश प्रदर्शित किया जाना है: {}, {}, {}', [ - value.toString(), - OtherValue.toString(), - 'पहले से ही एक स्ट्रिंग', -]) +log.info ('संदेश प्रदर्शित किया जाना है: {}, {}, {}', [value.toString (), OtherValue.toString (), 'पहले से ही एक स्ट्रिंग']) ``` #### एक या अधिक मान लॉग करना ##### एकल मान लॉग करना -नीचे दिए गए उदाहरण में, स्ट्रिंग मान "ए" लॉग होने से पहले `['ए']` बनने के लिए एक सरणी में पारित किया गया है: +नीचे दिए गए उदाहरण में, स्ट्रिंग मान "ए" लॉग होने से पहले ` ['ए'] ` बनने के लिए एक सरणी में पारित किया गया है: ```typescript let myValue = 'A' diff --git a/website/pages/hi/developing/creating-a-subgraph.mdx b/website/pages/hi/developing/creating-a-subgraph.mdx index 70e76edd1ae6..dd2c6dc981ab 100644 --- a/website/pages/hi/developing/creating-a-subgraph.mdx +++ b/website/pages/hi/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ Options: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ type GravatarDeclined @entity { हम अपने ग्राफक्यूएल एपीआई में निम्नलिखित स्केलर्स का समर्थन करते हैं: -| प्रकार | विवरण | -| --- | --- | -| `Bytes` | बाइट सरणी, एक हेक्साडेसिमल स्ट्रिंग के रूप में दर्शाया गया है। आमतौर पर एथेरियम हैश और पतों के लिए उपयोग किया जाता है। | -| `String` | `स्ट्रिंग` मानों के लिए स्केलर। अशक्त वर्ण समर्थित नहीं हैं और स्वचालित रूप से हटा दिए जाते हैं। | -| `Boolean` | `boolean` मानों के लिए स्केलर। | -| `Int` | ग्राफक्लाइन स्पेक `Int` को 32 बाइट्स के आकार के रूप में परिभाषित करता है। | -| `BigInt` | बड़े पूर्णांक। एथेरियम के `uint32`, `int64`, `uint64`, ..., `uint256` प्रकारों के लिए उपयोग किया जाता है। नोट: `uint32` के नीचे सब कुछ, जैसे `int32`, `uint24` या `int8` को `i32` के रूप में दर्शाया गया है। | -| `BigDecimal` | `BigDecimal` उच्च परिशुद्धता दशमलव एक महत्व और एक प्रतिपादक के रूप में दर्शाया गया है। एक्सपोनेंट रेंज -6143 से +6144 तक है। 34 महत्वपूर्ण अंकों तक गोल। | +| प्रकार | विवरण | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | बाइट सरणी, एक हेक्साडेसिमल स्ट्रिंग के रूप में दर्शाया गया है। आमतौर पर एथेरियम हैश और पतों के लिए उपयोग किया जाता है। | +| `String` | `स्ट्रिंग` मानों के लिए स्केलर। अशक्त वर्ण समर्थित नहीं हैं और स्वचालित रूप से हटा दिए जाते हैं। | +| `Boolean` | `boolean` मानों के लिए स्केलर। | +| `Int` | ग्राफक्लाइन स्पेक `Int` को 32 बाइट्स के आकार के रूप में परिभाषित करता है। | +| `BigInt` | बड़े पूर्णांक। एथेरियम के `uint32`, `int64`, `uint64`, ..., `uint256` प्रकारों के लिए उपयोग किया जाता है। नोट: `uint32` के नीचे सब कुछ, जैसे `int32`, `uint24` या `int8` को `i32` के रूप में दर्शाया गया है। | +| `BigDecimal` | `BigDecimal` उच्च परिशुद्धता दशमलव एक महत्व और एक प्रतिपादक के रूप में दर्शाया गया है। एक्सपोनेंट रेंज -6143 से +6144 तक है। 34 महत्वपूर्ण अंकों तक गोल। | #### Enums @@ -328,7 +328,7 @@ type TokenBalance @entity { #### उदाहरण -`उपयोगकर्ता` निकाय प्रकार से `संगठन` निकाय प्रकार में रिवर्स लुकअप परिभाषित करें. नीचे दिए गए उदाहरण में, यह `संगठन` इकाई के भीतर `सदस्यों` विशेषता को देखकर प्राप्त किया जाता है। क्वेरीज़ में, `संगठन` फ़ील्ड `उपयोगकर्ता` पर उन सभी `संगठन` संस्थाओं को खोजकर हल किया जाएगा जिनमें उपयोगकर्ता की आईडी शामिल है। +<कोड>उपयोगकर्ता निकाय प्रकार से <कोड>संगठन निकाय प्रकार में रिवर्स लुकअप परिभाषित करें. नीचे दिए गए उदाहरण में, यह `संगठन` इकाई के भीतर `सदस्यों` विशेषता को देखकर प्राप्त किया जाता है। क्वेरीज़ में, `संगठन` फ़ील्ड `उपयोगकर्ता` पर उन सभी `संगठन` संस्थाओं को खोजकर हल किया जाएगा जिनमें उपयोगकर्ता की आईडी शामिल है। ```graphql type Organization @entity { @@ -597,7 +597,7 @@ dataSources: ### गतिशील रूप से बनाए गए अनुबंधों के लिए डेटा स्रोत टेम्प्लेट -फिर, आप मेनिफेस्ट में _डेटा स्रोत टेम्प्लेट_ जोड़ते हैं। ये नियमित डेटा स्रोतों के समान हैं, सिवाय इसके कि उनमें `स्रोत` के तहत पूर्व-निर्धारित अनुबंध पता नहीं है। आमतौर पर, आप पैरेंट अनुबंध द्वारा प्रबंधित या संदर्भित प्रत्येक प्रकार के उप-अनुबंध के लिए एक टेम्प्लेट परिभाषित करेंगे। +फिर, आप मेनिफेस्ट में _डेटा स्रोत टेम्प्लेट_ जोड़ते हैं। ये नियमित डेटा स्रोतों के समान हैं, सिवाय इसके कि उनमें <कोड>स्रोत के तहत पूर्व-निर्धारित अनुबंध पता नहीं है। आमतौर पर, आप पैरेंट अनुबंध द्वारा प्रबंधित या संदर्भित प्रत्येक प्रकार के उप-अनुबंध के लिए एक टेम्प्लेट परिभाषित करेंगे। ```yaml dataSources: @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **ध्यान दें:** एक नया डेटा स्रोत केवल उस ब्लॉक के लिए कॉल और ईवेंट को प्रोसेस करेगा जिसमें इसे बनाया गया था और सभी बाद के ब्लॉक, लेकिन ऐतिहासिक डेटा, यानी डेटा को प्रोसेस नहीं करेगा जो पिछले ब्लॉकों में निहित है। -> +> > यदि पिछले ब्लॉक में नए डेटा स्रोत के लिए प्रासंगिक डेटा है, तो उस डेटा को अनुबंध की वर्तमान स्थिति को पढ़कर और नए डेटा स्रोत के निर्माण के समय उस स्थिति का प्रतिनिधित्व करने वाली संस्थाओं का निर्माण करना सबसे अच्छा है। ### डेटा स्रोत प्रसंग @@ -703,7 +703,7 @@ dataSources: ``` > **ध्यान दें:** इथरस्कैन पर अनुबंध निर्माण ब्लॉक को जल्दी से देखा जा सकता है: -> +> > 1. खोज बार में उसका पता दर्ज करके अनुबंध की खोज करें। > 2. `अनुबंध निर्माता` अनुभाग में निर्माण लेनदेन हैश पर क्लिक करें। > 3. लेन-देन विवरण पृष्ठ लोड करें जहां आपको उस अनुबंध के लिए प्रारंभ ब्लॉक मिलेगा। @@ -934,7 +934,7 @@ _meta { ### मौजूदा सबग्राफ पर ग्राफ्टिंग -जब एक सबग्राफ पहली बार तैनात किया जाता है, तो यह कुछ परिस्थितियों में संबंधित श्रृंखला के उत्पत्ति ब्लॉक (या प्रत्येक डेटा स्रोत के साथ परिभाषित `स्टार्टब्लॉक`) पर घटनाओं को अनुक्रमित करना शुरू कर देता है; किसी मौजूदा सबग्राफ से डेटा का पुन: उपयोग करना और बहुत बाद के ब्लॉक में अनुक्रमण करना प्रारंभ करना लाभदायक होता है। इंडेक्सिंग के इस तरीके को _ग्राफ्टिंग_ कहा जाता है। ग्राफ्टिंग, उदाहरण के लिए, विकास के दौरान मैपिंग में सरल त्रुटियों को जल्दी से दूर करने या अस्थायी रूप से एक मौजूदा सबग्राफ को विफल होने के बाद फिर से काम करने के लिए उपयोगी है। +जब एक सबग्राफ पहली बार तैनात किया जाता है, तो यह कुछ परिस्थितियों में संबंधित श्रृंखला के उत्पत्ति ब्लॉक (या प्रत्येक डेटा स्रोत के साथ परिभाषित <कोड>स्टार्टब्लॉक) पर घटनाओं को अनुक्रमित करना शुरू कर देता है; किसी मौजूदा सबग्राफ से डेटा का पुन: उपयोग करना और बहुत बाद के ब्लॉक में अनुक्रमण करना प्रारंभ करना लाभदायक होता है। इंडेक्सिंग के इस तरीके को _ग्राफ्टिंग_ कहा जाता है। ग्राफ्टिंग, उदाहरण के लिए, विकास के दौरान मैपिंग में सरल त्रुटियों को जल्दी से दूर करने या अस्थायी रूप से एक मौजूदा सबग्राफ को विफल होने के बाद फिर से काम करने के लिए उपयोगी है। जब `subgraph.yaml` में सबग्राफ मेनिफेस्ट में `graft` ब्लॉक होता है तो एक सबग्राफ को बेस सबग्राफ पर ग्राफ्ट किया जाता है: diff --git a/website/pages/hi/developing/unit-testing-framework.mdx b/website/pages/hi/developing/unit-testing-framework.mdx index f6324380602b..bfe6e62f3b4b 100644 --- a/website/pages/hi/developing/unit-testing-framework.mdx +++ b/website/pages/hi/developing/unit-testing-framework.mdx @@ -408,7 +408,7 @@ describe('handleUpdatedGravatars', () => { उदाहरण: -प्रत्येक परीक्षण के बाद `afterEach` के अंदर का कोड निष्पादित होगा। +प्रत्येक परीक्षण के बाद ` afterEach ` के अंदर का कोड निष्पादित होगा। ```typescript import { describe, test, beforeEach, afterEach } from "matchstick-as/assembly/index" @@ -447,7 +447,7 @@ describe("handleUpdatedGravatar", () => { }) ``` -उस वर्णन में प्रत्येक परीक्षण के बाद `afterEach` के अंदर का कोड निष्पादित होगा +उस वर्णन में प्रत्येक परीक्षण के बाद ` afterEach ` के अंदर का कोड निष्पादित होगा ```typescript import { describe, test, beforeEach, afterEach } from "matchstick-as/assembly/index" @@ -932,7 +932,7 @@ test('Derived fields example test', () => { ### गतिशील डेटा स्रोतों का परीक्षण -`संदर्भ()`, `पता()` और `नेटवर्क()` कार्यों के वापसी मान का मज़ाक उड़ाकर गतिशील डेटा स्रोतों का परीक्षण किया जा सकता है। डेटा स्रोत नाम स्थान। ये फ़ंक्शन वर्तमान में निम्नलिखित लौटाते हैं: `context()` - एक खाली इकाई (DataSourceContext), `address()` लौटाता है - `0x000000000000000000000000000000000000000`, `देता है नेटवर्क()` - `मेननेट` लौटाता है। `create(...)` और `createWithContext(...)` फ़ंक्शंस को कुछ भी नहीं करने के लिए मज़ाक उड़ाया जाता है, इसलिए उन्हें परीक्षणों में बुलाए जाने की आवश्यकता नहीं है। `dataSourceMock` नेमस्पेस `matchstick-as` (संस्करण 0.3.0+) में दिए गए मानों में परिवर्तन किया जा सकता है। +<कोड>संदर्भ(), <कोड>पता() और <कोड>नेटवर्क() कार्यों के वापसी मान का मज़ाक उड़ाकर गतिशील डेटा स्रोतों का परीक्षण किया जा सकता है। डेटा स्रोत नाम स्थान। ये फ़ंक्शन वर्तमान में निम्नलिखित लौटाते हैं: `context()` - एक खाली इकाई (DataSourceContext), `address()` लौटाता है - `0x000000000000000000000000000000000000000`, ` देता है नेटवर्क () - <कोड> मेननेट लौटाता है। create(...)` और `createWithContext(...)` फ़ंक्शंस को कुछ भी नहीं करने के लिए मज़ाक उड़ाया जाता है, इसलिए उन्हें परीक्षणों में बुलाए जाने की आवश्यकता नहीं है। `dataSourceMock` नेमस्पेस `matchstick-as` (संस्करण 0.3.0+) में दिए गए मानों में परिवर्तन किया जा सकता है। उदाहरण नीचे: @@ -1080,15 +1080,15 @@ Global test coverage: 22.2% (2/9 handlers). इसका अर्थ है कि आपने अपने कोड में `console.log` का उपयोग किया है, जो कि असेंबलीस्क्रिप्ट द्वारा समर्थित नहीं है। कृपया [लॉगिंग API](/Developing/assemblyscript-api/#logging-api) का उपयोग करने पर विचार करें > त्रुटि TS2554: अपेक्षित? तर्क, लेकिन मिला ?. -> +> > return new ethereum.Block(defaultAddressBytes, defaultAddressBytes, defaultAddressBytes, defaultAddress, defaultAddressBytes, defaultAddressBytes, defaultAddressBytes, defaultBigInt, defaultBigInt, defaultBigInt, defaultBigInt, defaultBigInt, defaultBigInt, defaultBigInt, defaultBigInt); -> +> > in ~lib/matchstick-as/assembly/defaults.ts(18,12) -> +> > त्रुटि TS2554: अपेक्षित? तर्क, लेकिन मिला ?. -> +> > return new ethereum.Transaction(defaultAddressBytes, defaultBigInt, defaultAddress, defaultAddress, defaultBigInt, defaultBigInt, defaultBigInt, defaultAddressBytes, defaultBigInt); -> +> > in ~lib/matchstick-as/assembly/defaults.ts(24,12) तर्कों में बेमेल `ग्राफ़-टीएस` और `मैचस्टिक-एज़` में बेमेल होने के कारण होता है। इस तरह की समस्याओं को ठीक करने का सबसे अच्छा तरीका है कि सभी चीज़ों को नवीनतम रिलीज़ किए गए संस्करण में अपडेट कर दिया जाए. diff --git a/website/pages/hi/glossary.mdx b/website/pages/hi/glossary.mdx index 138b1df2914d..1367d7807fa6 100644 --- a/website/pages/hi/glossary.mdx +++ b/website/pages/hi/glossary.mdx @@ -8,6 +8,8 @@ title: शब्दकोष - **ग्राफ़क्यूएल**: एपीआई के लिए एक क्वेरी भाषा और आपके मौजूदा डेटा के साथ उन क्वेरीज़ को पूरा करने के लिए एक रनटाइम। ग्राफ सबग्राफ को क्वेरी करने के लिए ग्राफक्लाइन का उपयोग करता है। +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **सबग्राफ**: ब्लॉकचैन डेटा पर निर्मित एक कस्टम एपीआई जिसे [ग्राफक्यूएल](https://graphql.org/) का उपयोग करके क्वेरी की जा सकती है। डेवलपर ग्राफ़ के विकेन्द्रीकृत नेटवर्क के लिए सबग्राफ बना, तैनात और प्रकाशित कर सकते हैं। फिर, इंडेक्सर्स सबग्राफ उपभोक्ताओं द्वारा पूछताछ के लिए उन्हें उपलब्ध कराने के लिए सबग्राफ को इंडेक्स करना शुरू कर सकते हैं। - **होस्ट की गई सेवा**: ग्राफ़ के विकेन्द्रीकृत नेटवर्क के रूप में उप-अनुच्छेद बनाने और क्वेरी करने के लिए एक अस्थायी मचान सेवा सेवा की लागत, सेवा की गुणवत्ता और डेवलपर अनुभव को परिपक्व कर रही है। diff --git a/website/pages/hi/graphcast.mdx b/website/pages/hi/graphcast.mdx index 41447da41c72..b1cc5ff50a2f 100644 --- a/website/pages/hi/graphcast.mdx +++ b/website/pages/hi/graphcast.mdx @@ -10,11 +10,11 @@ title: ग्राफकास्ट ग्राफकास्ट एसडीके (सॉफ्टवेयर डेवलपमेंट किट) डेवलपर्स को रेडियो बनाने की अनुमति देता है, जो गपशप-संचालित अनुप्रयोग हैं जो इंडेक्सर्स किसी दिए गए उद्देश्य को पूरा करने के लिए चला सकते हैं। हम निम्नलिखित उपयोग के मामलों के लिए कुछ रेडियो बनाने का भी इरादा रखते हैं (या अन्य डेवलपर्स/टीमों को सहायता प्रदान करते हैं जो रेडियो बनाना चाहते हैं): -- सबग्राफ डेटा अखंडता की रीयल-टाइम क्रॉस-चेकिंग ([POI Radio](https://docs.graphops.xyz/graphcast/radios/poi-radio)). -- अन्य इंडेक्सर्स से ताना सिंकिंग सबग्राफ, सबस्ट्रीम और फायरहोज डेटा के लिए नीलामी और समन्वय आयोजित करना। -- सक्रिय क्वेरी एनालिटिक्स पर स्व-रिपोर्टिंग, जिसमें सबग्राफ अनुरोध मात्रा, शुल्क मात्रा आदि शामिल हैं। -- इंडेक्सिंग एनालिटिक्स पर सेल्फ-रिपोर्टिंग, जिसमें सबग्राफ इंडेक्सिंग टाइम, हैंडलर गैस कॉस्ट, इंडेक्सिंग एरर, आदि शामिल हैं। -- ग्राफ-नोड संस्करण, पोस्टग्रेज संस्करण, एथेरियम क्लाइंट संस्करण, आदि सहित स्टैक जानकारी पर स्व-रिपोर्टिंग। +- सबग्राफ डेटा अखंडता की रीयल-टाइम क्रॉस-चेकिंग ([POI Radio](https://docs.graphops.xyz/graphcast/radios/poi-radio)). +- अन्य इंडेक्सर्स से ताना सिंकिंग सबग्राफ, सबस्ट्रीम और फायरहोज डेटा के लिए नीलामी और समन्वय आयोजित करना। +- सक्रिय क्वेरी एनालिटिक्स पर स्व-रिपोर्टिंग, जिसमें सबग्राफ अनुरोध मात्रा, शुल्क मात्रा आदि शामिल हैं। +- इंडेक्सिंग एनालिटिक्स पर सेल्फ-रिपोर्टिंग, जिसमें सबग्राफ इंडेक्सिंग टाइम, हैंडलर गैस कॉस्ट, इंडेक्सिंग एरर, आदि शामिल हैं। +- ग्राफ-नोड संस्करण, पोस्टग्रेज संस्करण, एथेरियम क्लाइंट संस्करण, आदि सहित स्टैक जानकारी पर स्व-रिपोर्टिंग। ### और अधिक जानें diff --git a/website/pages/hi/mips-faqs.mdx b/website/pages/hi/mips-faqs.mdx index 404a65e650e1..ba9f251273fb 100644 --- a/website/pages/hi/mips-faqs.mdx +++ b/website/pages/hi/mips-faqs.mdx @@ -14,13 +14,13 @@ title: एमआईपी अक्सर पूछे जाने वाले ### उपयोगी संसाधन -- [विन्सेंट (विक्टर) टैगेलिया से इंडेक्सर 2ूल](https://indexer-2ools.vincenttaglia.com/#/) -- [ग्राफ नेटवर्क पर प्रभावी इंडेक्सर कैसे बनें](https://thegraph.com/blog/how-to-become-indexer/) -- [इंडेक्सर नॉलेज हब](https://thegraph.academy/indexers/) -- [आवंटन अनुकूलक](https://github.com/graphprotocol/allocationopt.jl) -- [आवंटन अनुकूलन टूलिंग](https://github.com/anyblockanalytics/thegraph-allocation-optimization/) +- [विन्सेंट (विक्टर) टैगेलिया से इंडेक्सर 2ूल](https://indexer-2ools.vincenttaglia.com/#/) +- [ग्राफ नेटवर्क पर प्रभावी इंडेक्सर कैसे बनें](https://thegraph.com/blog/how-to-become-indexer/) +- [इंडेक्सर नॉलेज हब](https://thegraph.academy/indexers/) +- [आवंटन अनुकूलक](https://github.com/graphprotocol/allocationopt.jl) +- [आवंटन अनुकूलन टूलिंग](https://github.com/anyblockanalytics/thegraph-allocation-optimization/) -### 1. क्या सबग्राफ विफल होने पर भी इंडेक्सिंग (पीओआई) का वैध प्रमाण उत्पन्न करना संभव है? +### 1. क्या सबग्राफ विफल होने पर भी इंडेक्सिंग (पीओआई) का वैध प्रमाण उत्पन्न करना संभव है? हाँ, यह वास्तव में है। @@ -28,55 +28,55 @@ title: एमआईपी अक्सर पूछे जाने वाले समुदाय के एक सदस्य [SunTzu](https://github.com/suntzu93) ने मध्यस्थता चार्टर की कार्यप्रणाली के अनुपालन में इस प्रक्रिया को स्वचालित करने के लिए एक स्क्रिप्ट बनाई है। रेपो देखें [here] \(https://github.com/suntzu93/get_valid_poi_subgraph)। -### 2. एमआईपी कार्यक्रम किस श्रृंखला को सबसे पहले प्रोत्साहित करेगा? +### 2. एमआईपी कार्यक्रम किस श्रृंखला को सबसे पहले प्रोत्साहित करेगा? विकेंद्रीकृत नेटवर्क पर समर्थित होने वाली पहली श्रृंखला ग्नोसिस चेन है! ग्नोसिस चेन, जिसे पहले एक्सडीएआई के नाम से जाना जाता था, एक ईवीएम-आधारित श्रृंखला है। ग्नोसिस चेन को पहली बार चुना गया था क्योंकि इसके चलने वाले नोड्स की उपयोगकर्ता-मित्रता, इंडेक्सर की तत्परता, द ग्राफ के साथ संरेखण और वेब 3 के भीतर गोद लेना। -### 3. एमआईपी कार्यक्रम में नई शृंखला कैसे जोड़ी जाएगी? +### 3. एमआईपी कार्यक्रम में नई शृंखला कैसे जोड़ी जाएगी? इंडेक्सर की तत्परता, मांग और सामुदायिक भावना के आधार पर, पूरे एमआईपी कार्यक्रम में नई श्रृंखलाओं की घोषणा की जाएगी। चेन को पहले टेस्टनेट पर सपोर्ट किया जाएगा और बाद में मेननेट पर उस चेन को सपोर्ट करने के लिए एक GIP पास किया जाएगा। एमआईपी प्रोग्राम में भाग लेने वाले इंडेक्सर्स चुनेंगे कि वे किस चेन का समर्थन करने में रुचि रखते हैं और क्वेरी फीस अर्जित करने और सबग्राफ की सेवा के लिए नेटवर्क पर इंडेक्सिंग पुरस्कार अर्जित करने के अलावा प्रति श्रृंखला पुरस्कार अर्जित करेंगे। एमआईपी प्रतिभागियों को उनके प्रदर्शन, नेटवर्क की जरूरतों को पूरा करने की क्षमता और सामुदायिक समर्थन के आधार पर अंक दिए जाएंगे। -### 4. हमें कैसे पता चलेगा कि नेटवर्क नई श्रृंखला के लिए तैयार है? +### 4. हमें कैसे पता चलेगा कि नेटवर्क नई श्रृंखला के लिए तैयार है? ग्राफ़ फाउंडेशन तत्परता का सर्वोत्तम आकलन करने के लिए क्यूओएस प्रदर्शन मेट्रिक्स, नेटवर्क प्रदर्शन और सामुदायिक चैनलों की निगरानी करेगा। प्राथमिकता यह सुनिश्चित कर रही है कि नेटवर्क उन मल्टी-चेन डैप के प्रदर्शन की जरूरतों को पूरा करे जो उनके सबग्राफ को माइग्रेट करने में सक्षम हों। -### 5. पुरस्कार प्रति श्रृंखला कैसे विभाजित होते हैं? +### 5. पुरस्कार प्रति श्रृंखला कैसे विभाजित होते हैं? यह देखते हुए कि चेन नोड्स को सिंक करने के लिए अपनी आवश्यकताओं में भिन्न होती हैं, और वे क्वेरी वॉल्यूम और गोद लेने में भिन्न होती हैं, उस श्रृंखला के चक्र के अंत में प्रति श्रृंखला पुरस्कार तय किए जाएंगे ताकि यह सुनिश्चित किया जा सके कि सभी फीडबैक और सीखने पर कब्जा कर लिया गया है। हालाँकि, हर समय इंडेक्सर्स नेटवर्क पर चेन को सपोर्ट करने के बाद क्वेरी फीस और इंडेक्सिंग रिवार्ड्स अर्जित करने में सक्षम होंगे। -### 6. क्या हमें एमआईपी कार्यक्रम में सभी श्रृंखलाओं को अनुक्रमित करने की आवश्यकता है या क्या हम केवल एक श्रृंखला चुन सकते हैं और उसे अनुक्रमित कर सकते हैं? +### 6. क्या हमें एमआईपी कार्यक्रम में सभी श्रृंखलाओं को अनुक्रमित करने की आवश्यकता है या क्या हम केवल एक श्रृंखला चुन सकते हैं और उसे अनुक्रमित कर सकते हैं? आप जो भी श्रृंखला चाहते हैं उसे अनुक्रमित करने के लिए आपका स्वागत है! एमआईपी कार्यक्रम का लक्ष्य इंडेक्सर्स को उन उपकरणों और ज्ञान से लैस करना है जो वे चाहते हैं कि चेन को इंडेक्स करें और उन वेब 3 पारिस्थितिक तंत्रों का समर्थन करें जिनमें वे रुचि रखते हैं। हालांकि, प्रत्येक श्रृंखला के लिए टेस्टनेट से मेननेट तक चरण होते हैं। आपके द्वारा अनुक्रमित की जा रही श्रृंखलाओं के लिए सभी चरणों को पूरा करना सुनिश्चित करें। चरणों के बारे में अधिक जानने के लिए [एमआईपी धारणा पृष्ठ](https://thegraphfoundation.notion.site/MIPs-Home-911e1187f1d94d12b247317265f81059) देखें। -### 7. इनाम कब बांटे जाएंगे? +### 7. इनाम कब बांटे जाएंगे? एक बार प्रदर्शन मेट्रिक्स मिलने और माइग्रेट किए गए सबग्राफ उन इंडेक्सर्स द्वारा समर्थित होने के बाद एमआईपी पुरस्कार प्रति श्रृंखला वितरित किए जाएंगे। उस श्रृंखला के चक्र के बीच में प्रति श्रृंखला कुल पुरस्कारों के बारे में जानकारी देखें। -### 8. अंकन कैसे काम करता है? +### 8. अंकन कैसे काम करता है? इंडेक्सर्स लीडरबोर्ड पर पूरे कार्यक्रम में स्कोरिंग के आधार पर पुरस्कारों के लिए प्रतिस्पर्धा करेंगे। कार्यक्रम स्कोरिंग पर आधारित होगा: **सबग्राफ कवरेज** -- क्या आप प्रति श्रृंखला सबग्राफ के लिए अधिकतम समर्थन प्रदान कर रहे हैं? +- क्या आप प्रति श्रृंखला सबग्राफ के लिए अधिकतम समर्थन प्रदान कर रहे हैं? -- एमआईपी के दौरान, बड़े इंडेक्सर्स से उम्मीद की जाती है कि वे प्रति श्रृंखला सबग्राफ का 50%+ दांव लगाएंगे जिसका वे समर्थन करते हैं। +- एमआईपी के दौरान, बड़े इंडेक्सर्स से उम्मीद की जाती है कि वे प्रति श्रृंखला सबग्राफ का 50%+ दांव लगाएंगे जिसका वे समर्थन करते हैं। **सेवा की गुणवत्ता** -- क्या इंडेक्सर सेवा की अच्छी गुणवत्ता (विलंबता, ताजा डेटा, अपटाइम, आदि) के साथ श्रृंखला की सेवा कर रहा है? +- क्या इंडेक्सर सेवा की अच्छी गुणवत्ता (विलंबता, ताजा डेटा, अपटाइम, आदि) के साथ श्रृंखला की सेवा कर रहा है? -- क्या डैप डेवलपर्स का समर्थन करने वाला इंडेक्सर उनकी जरूरतों के प्रति प्रतिक्रियाशील है? +- क्या डैप डेवलपर्स का समर्थन करने वाला इंडेक्सर उनकी जरूरतों के प्रति प्रतिक्रियाशील है? क्या इंडेक्सर कुशलता से आवंटन कर रहा है, नेटवर्क के समग्र स्वास्थ्य में योगदान दे रहा है? **समुदाय का समर्थन** -- क्या इंडेक्सर साथी इंडेक्सर्स के साथ सहयोग कर रहा है ताकि उन्हें मल्टी-चेन स्थापित करने में मदद मिल सके? +- क्या इंडेक्सर साथी इंडेक्सर्स के साथ सहयोग कर रहा है ताकि उन्हें मल्टी-चेन स्थापित करने में मदद मिल सके? -- क्या इंडेक्सर पूरे कार्यक्रम के दौरान कोर देवों को फीडबैक प्रदान कर रहा है या फोरम में इंडेक्सर्स के साथ जानकारी साझा कर रहा है? +- क्या इंडेक्सर पूरे कार्यक्रम के दौरान कोर देवों को फीडबैक प्रदान कर रहा है या फोरम में इंडेक्सर्स के साथ जानकारी साझा कर रहा है? -### 9. डिस्कॉर्ड की भूमिका कैसे सौंपी जाएगी? +### 9. डिस्कॉर्ड की भूमिका कैसे सौंपी जाएगी? मॉडरेटर अगले कुछ दिनों में भूमिकाएं असाइन करेंगे. diff --git a/website/pages/hi/network-transition-faq.mdx b/website/pages/hi/network-transition-faq.mdx index 32e91b6dbbf6..08f02e1340e7 100644 --- a/website/pages/hi/network-transition-faq.mdx +++ b/website/pages/hi/network-transition-faq.mdx @@ -84,16 +84,16 @@ title: नेटवर्क संक्रमण अक्सर पूछे > इस तालिका में परीक्षण नेटवर्क शामिल नहीं होंगे, जो [सबग्राफ स्टूडियो](https://thegraph.com/studio/) में निःशुल्क रहते हैं। -| नेटवर्क | Announcing integration on The Graph Network | Network Integration complete | Phase 1: disable new subgraphs on hosted service | Phase 2: disable subgraph upgrades on hosted service | Phase 3: disable subgraphs on hosted service | -| --- | :-: | :-: | :-: | :-: | :-: | -| Ethereum | ✓ | ✓ | | | | -| Gnosis (formerly xDAI) | ✓ | ✓\* | | | | -| Polygon | ✓ | | | | | -| Celo | ✓ | ✓\* | | | | -| Arbitrum-one | ✓ | ✓\* | | | | -| Avalanche | ✓ | ✓\* | | | | -| Optimism | ✓ | | | | | -| Fantom | ✓ | | | | | +| नेटवर्क | Announcing integration on The Graph Network | Network Integration complete | Phase 1: disable new subgraphs on hosted service | Phase 2: disable subgraph upgrades on hosted service | Phase 3: disable subgraphs on hosted service | +| ---------------------- |:-------------------------------------------:|:----------------------------:|:------------------------------------------------:|:----------------------------------------------------:|:--------------------------------------------:| +| Ethereum | ✓ | ✓ | | | | +| Gnosis (formerly xDAI) | ✓ | ✓\* | | | | +| Polygon | ✓ | | | | | +| Celo | ✓ | ✓\* | | | | +| Arbitrum-one | ✓ | ✓\* | | | | +| Avalanche | ✓ | ✓\* | | | | +| Optimism | ✓ | | | | | +| Fantom | ✓ | | | | | \* नेटवर्क वर्तमान में ग्राफ़ के विकेंद्रीकृत नेटवर्क पर बीटा में है। diff --git a/website/pages/hi/network/benefits.mdx b/website/pages/hi/network/benefits.mdx index 16c300dd1d1b..0048dccbbfc6 100644 --- a/website/pages/hi/network/benefits.mdx +++ b/website/pages/hi/network/benefits.mdx @@ -27,47 +27,47 @@ socialImage: https://thegraph.com/docs/img/seo/benefits.jpg ## कम मात्रा वाले उपयोगकर्ता (प्रति माह 30,000 से कम प्रश्न) -| लागत तुलना | स्वयं होस्ट किया गया | ग्राफ नेटवर्क | -| :-: | :-: | :-: | -| मासिक सर्वर लागत\* | $350 प्रति माह | $0 | -| पूछताछ लागत | $0+ | ~ $ 15 प्रति माह | -| इंजीनियरिंग का समय | $ 400 प्रति माह | कोई नहीं, विश्व स्तर पर वितरित इंडेक्सर्स के साथ नेटवर्क में बनाया गया | -| प्रति माह प्रश्न | इन्फ्रा क्षमताओं तक सीमित | 30,000 (ऑटो स्केलिंग) | -| लागत प्रति क्वेरी | $0 | $0.0005 | -| आधारभूत संरचना | केंद्रीकृत | विकेन्द्रीकृत | -| भौगोलिक अतिरेक | $750+ प्रति अतिरिक्त नोड | शामिल | -| अपटाइम | भिन्न | 99.9%+ | -| कुल मासिक लागत | $750+ | ~$15 | +| लागत तुलना | स्वयं होस्ट किया गया | ग्राफ नेटवर्क | +|:------------------------------:|:---------------------------------------:|:----------------------------------------------------------------------:| +| मासिक सर्वर लागत\* | $350 प्रति माह | $0 | +| पूछताछ लागत | $0+ | ~ $ 15 प्रति माह | +| इंजीनियरिंग का समय | $ 400 प्रति माह | कोई नहीं, विश्व स्तर पर वितरित इंडेक्सर्स के साथ नेटवर्क में बनाया गया | +| प्रति माह प्रश्न | इन्फ्रा क्षमताओं तक सीमित | 30,000 (ऑटो स्केलिंग) | +| लागत प्रति क्वेरी | $0 | $0.0005 | +| आधारभूत संरचना | केंद्रीकृत | विकेन्द्रीकृत | +| भौगोलिक अतिरेक | $750+ प्रति अतिरिक्त नोड | शामिल | +| अपटाइम | भिन्न | 99.9%+ | +| कुल मासिक लागत | $750+ | ~$15 | ## मध्यम मात्रा उपयोगकर्ता (3,000,000+ प्रश्न प्रति माह) -| लागत तुलना | स्वयं होस्ट किया गया | ग्राफ नेटवर्क | -| :-: | :-: | :-: | -| मासिक सर्वर लागत\* | $350 प्रति माह | $0 | -| पूछताछ लागत | $ 500 प्रति माह | $750 प्रति माह | -| इंजीनियरिंग का समय | $800 प्रति माह | कोई नहीं, विश्व स्तर पर वितरित इंडेक्सर्स के साथ नेटवर्क में बनाया गया | -| प्रति माह प्रश्न | इन्फ्रा क्षमताओं तक सीमित | 3,000,000+ | -| लागत प्रति क्वेरी | $0 | $0.00025 | -| आधारभूत संरचना | केंद्रीकृत | विकेन्द्रीकृत | -| इंजीनियरिंग खर्च | $ 200 प्रति घंटा | शामिल | -| भौगोलिक अतिरेक | प्रति अतिरिक्त नोड कुल लागत में $1,200 | शामिल | -| अपटाइम | भिन्न | 99.9%+ | -| कुल मासिक लागत | $1,650+ | $750 | +| लागत तुलना | स्वयं होस्ट किया गया | ग्राफ नेटवर्क | +|:------------------------------:|:------------------------------------------:|:----------------------------------------------------------------------:| +| मासिक सर्वर लागत\* | $350 प्रति माह | $0 | +| पूछताछ लागत | $ 500 प्रति माह | $750 प्रति माह | +| इंजीनियरिंग का समय | $800 प्रति माह | कोई नहीं, विश्व स्तर पर वितरित इंडेक्सर्स के साथ नेटवर्क में बनाया गया | +| प्रति माह प्रश्न | इन्फ्रा क्षमताओं तक सीमित | 3,000,000+ | +| लागत प्रति क्वेरी | $0 | $0.00025 | +| आधारभूत संरचना | केंद्रीकृत | विकेन्द्रीकृत | +| इंजीनियरिंग खर्च | $ 200 प्रति घंटा | शामिल | +| भौगोलिक अतिरेक | प्रति अतिरिक्त नोड कुल लागत में $1,200 | शामिल | +| अपटाइम | भिन्न | 99.9%+ | +| कुल मासिक लागत | $1,650+ | $750 | ## उच्च मात्रा उपयोगकर्ता (30,000,000+ प्रश्न प्रति माह) -| लागत तुलना | स्वयं होस्ट किया गया | ग्राफ नेटवर्क | -| :-: | :-: | :-: | -| मासिक सर्वर लागत\* | $1100 प्रति माह, प्रति नोड | $0 | -| पूछताछ लागत | $4000 | $4,500 per month | -| आवश्यक नोड्स की संख्या | 10 | Not applicable | -| इंजीनियरिंग का समय | $6,000 or more per month | कोई नहीं, विश्व स्तर पर वितरित इंडेक्सर्स के साथ नेटवर्क में बनाया गया | -| प्रति माह प्रश्न | इन्फ्रा क्षमताओं तक सीमित | 30,000,000+ | -| लागत प्रति क्वेरी | $0 | $0.00015 | -| आधारभूत संरचना | केंद्रीकृत | विकेन्द्रीकृत | -| भौगोलिक अतिरेक | प्रति अतिरिक्त नोड कुल लागत में $1,200 | शामिल | -| अपटाइम | भिन्न | 99.9%+ | -| कुल मासिक लागत | $11,000+ | $4,500 | +| लागत तुलना | स्वयं होस्ट किया गया | ग्राफ नेटवर्क | +|:------------------------------:|:-------------------------------------------:|:----------------------------------------------------------------------:| +| मासिक सर्वर लागत\* | $1100 प्रति माह, प्रति नोड | $0 | +| पूछताछ लागत | $4000 | $4,500 per month | +| आवश्यक नोड्स की संख्या | 10 | Not applicable | +| इंजीनियरिंग का समय | $6,000 or more per month | कोई नहीं, विश्व स्तर पर वितरित इंडेक्सर्स के साथ नेटवर्क में बनाया गया | +| प्रति माह प्रश्न | इन्फ्रा क्षमताओं तक सीमित | 30,000,000+ | +| लागत प्रति क्वेरी | $0 | $0.00015 | +| आधारभूत संरचना | केंद्रीकृत | विकेन्द्रीकृत | +| भौगोलिक अतिरेक | प्रति अतिरिक्त नोड कुल लागत में $1,200 | शामिल | +| अपटाइम | भिन्न | 99.9%+ | +| कुल मासिक लागत | $11,000+ | $4,500 | \*बैकअप की लागत सहित: $50-$100 प्रति माह diff --git a/website/pages/hi/network/delegating.mdx b/website/pages/hi/network/delegating.mdx index b66e0e9e4ce2..3ced69566ba6 100644 --- a/website/pages/hi/network/delegating.mdx +++ b/website/pages/hi/network/delegating.mdx @@ -33,8 +33,8 @@ title: Delegating एक बात पर भी विचार करना चाहिए कि एक इंडेक्सर को बुद्धिमानी से चुनना है। यदि आप एक ऐसे इंडेक्सर को चुनते हैं जो भरोसेमंद नहीं था, या अच्छा काम नहीं कर रहा था, तो आप अनाधिकृत करना चाहेंगे, जिसका अर्थ है कि आप पुरस्कार अर्जित करने के बहुत सारे अवसर खो देंगे, जो जीआरटी जलाने जितना ही बुरा हो सकता है।
- ![डेलिगेशन अनबॉन्डिंग](/img/Delegation-Unbonding.png) _डेलीगेशन UI में 0.5% शुल्क और साथ ही 28 दिन पर ध्यान दें बंधन - अवधि._ + ![डेलिगेशन अनबॉन्डिंग](/img/Delegation-Unbonding.png) _डेलीगेशन UI में 0.5% शुल्क और साथ ही 28 दिन पर ध्यान दें + बंधन अवधि._
### डेलीगेटर्स के लिए उचित इनाम भुगतान के साथ एक भरोसेमंद इंडेक्सर चुनना @@ -44,8 +44,8 @@ title: Delegating इंडेक्सिंग रिवार्ड कट - इंडेक्सिंग रिवार्ड कट उन रिवॉर्ड्स का हिस्सा है जो इंडेक्सर अपने लिए रखेंगे। इसका मतलब है कि अगर इसे 100% पर सेट किया जाता है, तो डेलिगेटर के तौर पर आपको 0 इंडेक्सिंग रिवॉर्ड्स मिलेंगे। यदि आप यूआई में 80% देखते हैं, तो इसका मतलब है कि एक प्रतिनिधि के रूप में, आपको 20% प्राप्त होगा। एक महत्वपूर्ण नोट - नेटवर्क की शुरुआत में, इंडेक्सिंग रिवार्ड्स अधिकांश पुरस्कारों के लिए जिम्मेदार होंगे।
- ![इंडेक्सिंग रिवॉर्ड कट](/img/Indexing-Reward-Cut.png) *शीर्ष इंडेक्सर डेलीगेटर्स को पुरस्कारों का 90% दे रहा है। बीच - वाला प्रतिनिधि को 20% दे रहा है। नीचे वाला डेलिगेटरों को ~83% दे रहा है।* + ![इंडेक्सिंग रिवॉर्ड कट](/img/Indexing-Reward-Cut.png) *शीर्ष इंडेक्सर डेलीगेटर्स को पुरस्कारों का 90% दे रहा है। + बीच वाला प्रतिनिधि को 20% दे रहा है। नीचे वाला डेलिगेटरों को ~83% दे रहा है।*
- प्रश्न शुल्क कट - यह बिल्कुल इंडेक्सिंग रिवार्ड कट की तरह काम करता है। हालाँकि, यह विशेष रूप से इंडेक्सर द्वारा एकत्र की जाने वाली क्वेरी फीस पर रिटर्न के लिए है। यह ध्यान दिया जाना चाहिए कि नेटवर्क की शुरुआत में, इंडेक्सिंग रिवार्ड की तुलना में क्वेरी फीस से रिटर्न बहुत कम होगा। यह निर्धारित करने के लिए नेटवर्क पर ध्यान देने की सिफारिश की जाती है कि नेटवर्क में क्वेरी शुल्क कब अधिक महत्वपूर्ण होने लगेगा। diff --git a/website/pages/hi/network/explorer.mdx b/website/pages/hi/network/explorer.mdx index 927ee1ceb71d..64b229a8f6d7 100644 --- a/website/pages/hi/network/explorer.mdx +++ b/website/pages/hi/network/explorer.mdx @@ -87,7 +87,7 @@ title: ग्राफ एक्सप्लोरर - वर्तमान में उनके पास प्रोटोकॉल में जीआरटी की कुल राशि है - जिस तारीख को उन्होंने आखिरी बार प्रत्यायोजित किया था -यदि आप प्रतिनिधि बनने के तरीके के बारे में अधिक जानना चाहते हैं, तो आगे मत देखिए! आपको बस इतना करना है कि [आधिकारिक दस्तावेज़ीकरण](/network/delegating) या [द ग्राफ़ अकादमी](https://docs.thegraph.academy/network/delegators) पर जाना है। +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## नेटवर्क diff --git a/website/pages/hi/network/indexing.mdx b/website/pages/hi/network/indexing.mdx index 2335c278c61d..0651b4c21ed5 100644 --- a/website/pages/hi/network/indexing.mdx +++ b/website/pages/hi/network/indexing.mdx @@ -112,12 +112,12 @@ query indexerAllocations { - **माध्यम** - प्रोडक्शन इंडेक्सर प्रति सेकंड 100 सबग्राफ और 200-500 अनुरोधों का समर्थन करता है। - **बड़ा** - वर्तमान में उपयोग किए जाने वाले सभी सबग्राफ को अनुक्रमित करने और संबंधित ट्रैफ़िक के अनुरोधों को पूरा करने के लिए तैयार है। -| Setup | Postgres
(CPUs) | Postgres
(memory in GBs) | Postgres
(disk in TBs) | VMs
(CPUs) | VMs
(memory in GBs) | -| --- | :-: | :-: | :-: | :-: | :-: | -| Small | 4 | 8 | 1 | 4 | 16 | -| Standard | 8 | 30 | 1 | 12 | 48 | -| Medium | 16 | 64 | 2 | 32 | 64 | -| Large | 72 | 468 | 3.5 | 48 | 184 | +| Setup | Postgres
(CPUs) | Postgres
(memory in GBs) | Postgres
(disk in TBs) | VMs
(CPUs) | VMs
(memory in GBs) | +| -------- |:--------------------------:|:-----------------------------------:|:---------------------------------:|:---------------------:|:------------------------------:| +| Small | 4 | 8 | 1 | 4 | 16 | +| Standard | 8 | 30 | 1 | 12 | 48 | +| Medium | 16 | 64 | 2 | 32 | 64 | +| Large | 72 | 468 | 3.5 | 48 | 184 | ### एक इंडेक्सर को कौन सी बुनियादी सुरक्षा सावधानियां बरतनी चाहिए? @@ -149,20 +149,20 @@ query indexerAllocations { #### ग्राफ नोड -| Port | Purpose | Routes | CLI Argument | Environment Variable | -| --- | --- | --- | --- | --- | -| 8000 | GraphQL HTTP server
(सबग्राफ प्रश्नों के लिए) | /subgraphs/id/...
/subgraphs/name/.../... | --http-port | - | -| 8001 | GraphQL WS
(सबग्राफ सब्सक्रिप्शन के लिए) | /subgraphs/id/...
/subgraphs/name/.../... | --ws-port | - | -| 8020 | JSON-RPC
(तैनाती के प्रबंधन के लिए) | / | --admin-port | - | -| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | -| 8040 | Prometheus metrics | /metrics | --metrics-port | - | +| Port | Purpose | Routes | CLI Argument | Environment Variable | +| ---- | -------------------------------------------------------- | ---------------------------------------------------- | ----------------- | -------------------- | +| 8000 | GraphQL HTTP server
(सबग्राफ प्रश्नों के लिए) | /subgraphs/id/...
/subgraphs/name/.../... | --http-port | - | +| 8001 | GraphQL WS
(सबग्राफ सब्सक्रिप्शन के लिए) | /subgraphs/id/...
/subgraphs/name/.../... | --ws-port | - | +| 8020 | JSON-RPC
(तैनाती के प्रबंधन के लिए) | / | --admin-port | - | +| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | +| 8040 | Prometheus metrics | /metrics | --metrics-port | - | #### Indexer Service -| Port | Purpose | Routes | CLI Argument | Environment Variable | -| --- | --- | --- | --- | --- | -| 7600 | GraphQL HTTP server
(सबग्राफ प्रश्नों के लिए) | /subgraphs/id/...
/status
/channel-messages-inbox | --port | `INDEXER_SERVICE_PORT` | -| 7300 | Prometheus metrics | /metrics | --metrics-port | - | +| Port | Purpose | Routes | CLI Argument | Environment Variable | +| ---- | -------------------------------------------------------- | ----------------------------------------------------------------------- | -------------- | ---------------------- | +| 7600 | GraphQL HTTP server
(सबग्राफ प्रश्नों के लिए) | /subgraphs/id/...
/status
/channel-messages-inbox | --port | `INDEXER_SERVICE_PORT` | +| 7300 | Prometheus metrics | /metrics | --metrics-port | - | #### Indexer Agent @@ -559,7 +559,7 @@ graph indexer status - `ग्राफ़ अनुक्रमणिका क्रियाएँ स्वीकृत निष्पादित करती हैं` - कार्यकर्ता को स्वीकृत क्रियाओं को तुरंत निष्पादित करने के लिए बाध्य करें -सभी आदेश जो आउटपुट में नियम प्रदर्शित करते हैं, समर्थित आउटपुट स्वरूपों (`तालिका`, `yaml`, और `json`) के बीच `का उपयोग करके चुन सकते हैं - आउटपुट` तर्क। +सभी आदेश जो आउटपुट में नियम प्रदर्शित करते हैं, समर्थित आउटपुट स्वरूपों (`तालिका`, `yaml`, और `json`) के बीच ` का उपयोग करके चुन सकते हैं - आउटपुट ` तर्क। #### Indexing rules @@ -623,7 +623,7 @@ graph indexer rules delete QmZfeJYR86UARzp9HiXbURWunYgC9ywvPvoePNbuaATrEK - सभी कतारबद्ध क्रियाओं को देखने के लिए इंडेक्सर `indexer-cli` का उपयोग कर सकता है - इंडेक्सर (या अन्य सॉफ़्टवेयर) `इंडेक्सर-क्ली` का उपयोग करके कतार में क्रियाओं को स्वीकृत या रद्द कर सकता है। स्वीकृति और रद्द करने के आदेश इनपुट के रूप में क्रिया आईडी की एक सरणी लेते हैं। - निष्पादन कार्यकर्ता नियमित रूप से स्वीकृत कार्यों के लिए कतार का चुनाव करता है। यह कतार से `अनुमोदित` कार्यों को पकड़ लेगा, उन्हें निष्पादित करने का प्रयास करेगा, और निष्पादन की स्थिति के आधार पर डीबी में मूल्यों को `सफलता` या `विफल< पर अपडेट करेगा। /0>. -
  • यदि कोई कार्रवाई सफल होती है तो कार्यकर्ता यह सुनिश्चित करेगा कि एक अनुक्रमण नियम मौजूद है जो एजेंट को बताता है कि आगे बढ़ते हुए आवंटन को कैसे प्रबंधित किया जाए, जब एजेंट ऑटो` या `में मैन्युअल कार्रवाई करते समय उपयोगी हो निगरानी` मोड। +
  • यदि कोई कार्रवाई सफल होती है तो कार्यकर्ता यह सुनिश्चित करेगा कि एक अनुक्रमण नियम मौजूद है जो एजेंट को बताता है कि आगे बढ़ते हुए आवंटन को कैसे प्रबंधित किया जाए, जब एजेंट <कोड>ऑटो या <कोड> में मैन्युअल कार्रवाई करते समय उपयोगी हो निगरानी ` मोड। - अनुक्रमणक क्रिया निष्पादन के इतिहास को देखने के लिए क्रिया कतार की निगरानी कर सकता है और यदि आवश्यक हो तो निष्पादन विफल होने पर क्रिया आइटम को पुन: अनुमोदित और अद्यतन कर सकता है। क्रिया कतार पंक्तिबद्ध और की गई सभी कार्रवाइयों का इतिहास प्रदान करती है। डेटा मॉडल: @@ -762,7 +762,7 @@ indexer cost set model my_model.agora 3. `GraphToken.abi` चुने जाने और संपादक में खुलने के साथ, Remix इंटरफ़ेस में Deploy और `Run Transactions` सेक्शन में स्विच करें। -4. पर्यावरण के तहत `इंजेक्टेड वेब3` चुनें और `खाता` के तहत अपना इंडेक्सर पता चुनें। +4. पर्यावरण के तहत <कोड>इंजेक्टेड वेब3 चुनें और <कोड>खाता के तहत अपना इंडेक्सर पता चुनें। 5. ग्राफटोकन अनुबंध पता सेट करें - `पते पर` के बगल में ग्राफटोकन अनुबंध पता (`0xc944E90C64B2c07662A292be6244BDf05Cda44a7`) पेस्ट करें और आवेदन करने के लिए `पते पर` बटन पर क्लिक करें। @@ -776,7 +776,7 @@ indexer cost set model my_model.agora 3. `Stakeing.abi` चुने जाने और संपादक में खुलने के साथ, रीमिक्स इंटरफ़ेस में `Deploy` और `Run Transactions` सेक्शन पर स्विच करें। -4. पर्यावरण के तहत `इंजेक्टेड वेब3` चुनें और `खाता` के तहत अपना इंडेक्सर पता चुनें। +4. पर्यावरण के तहत <कोड>इंजेक्टेड वेब3 चुनें और <कोड>खाता के तहत अपना इंडेक्सर पता चुनें। 5. स्टेकिंग अनुबंध पता सेट करें - `पते पर` के आगे स्टेकिंग अनुबंध पता (`0xF55041E37E12cD407ad00CE2910B8269B01263b9`) पेस्ट करें और आवेदन करने के लिए `पते पर` बटन पर क्लिक करें। diff --git a/website/pages/hi/operating-graph-node.mdx b/website/pages/hi/operating-graph-node.mdx index f05f39b8e238..d3c040ceff96 100644 --- a/website/pages/hi/operating-graph-node.mdx +++ b/website/pages/hi/operating-graph-node.mdx @@ -104,13 +104,13 @@ docker-compose up जब यह चल रहा होता है तो ग्राफ़ नोड निम्नलिखित पोर्ट को उजागर करता है: -| Port | Purpose | Routes | CLI Argument | Environment Variable | -| --- | --- | --- | --- | --- | -| 8000 | GraphQL HTTP server
    (सबग्राफ प्रश्नों के लिए) | /subgraphs/id/...
    /subgraphs/name/.../... | --http-port | - | -| 8001 | GraphQL WS
    (सबग्राफ सब्सक्रिप्शन के लिए) | /subgraphs/id/...
    /subgraphs/name/.../... | --ws-port | - | -| 8020 | JSON-RPC
    (तैनाती के प्रबंधन के लिए) | / | --admin-port | - | -| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | -| 8040 | Prometheus metrics | /metrics | --metrics-port | - | +| Port | Purpose | Routes | CLI Argument | Environment Variable | +| ---- | -------------------------------------------------------- | ---------------------------------------------------- | ----------------- | -------------------- | +| 8000 | GraphQL HTTP server
    (सबग्राफ प्रश्नों के लिए) | /subgraphs/id/...
    /subgraphs/name/.../... | --http-port | - | +| 8001 | GraphQL WS
    (सबग्राफ सब्सक्रिप्शन के लिए) | /subgraphs/id/...
    /subgraphs/name/.../... | --ws-port | - | +| 8020 | JSON-RPC
    (तैनाती के प्रबंधन के लिए) | / | --admin-port | - | +| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | +| 8040 | Prometheus metrics | /metrics | --metrics-port | - | > **महत्वपूर्ण**: बंदरगाहों को सार्वजनिक रूप से उजागर करने के बारे में सावधान रहें - **प्रशासन बंदरगाहों** को बंद रखा जाना चाहिए। इसमें ग्राफ़ नोड JSON-RPC समापन बिंदु शामिल है। diff --git a/website/pages/hi/querying/graphql-api.mdx b/website/pages/hi/querying/graphql-api.mdx index 79142e830f16..33f882f3ed44 100644 --- a/website/pages/hi/querying/graphql-api.mdx +++ b/website/pages/hi/querying/graphql-api.mdx @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| प्रतीक | ऑपरेटर | विवरण | -| --- | --- | --- | -| `&` | `And` | सभी प्रदान किए गए शब्दों को शामिल करने वाली संस्थाओं के लिए एक से अधिक खोज शब्दों को फ़िल्टर में संयोजित करने के लिए | -| | | `Or` | या ऑपरेटर द्वारा अलग किए गए एकाधिक खोज शब्दों वाली क्वेरी सभी संस्थाओं को प्रदान की गई शर्तों में से किसी से मेल के साथ वापस कर देगी | -| `<->` | `Follow by` | दो शब्दों के बीच की दूरी निर्दिष्ट करें। | -| `:*` | `Prefix` | उन शब्दों को खोजने के लिए उपसर्ग खोज शब्द का उपयोग करें जिनके उपसर्ग मेल खाते हैं (2 वर्ण आवश्यक हैं।) | +| प्रतीक | ऑपरेटर | विवरण | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `&` | `And` | सभी प्रदान किए गए शब्दों को शामिल करने वाली संस्थाओं के लिए एक से अधिक खोज शब्दों को फ़िल्टर में संयोजित करने के लिए | +| | | `Or` | या ऑपरेटर द्वारा अलग किए गए एकाधिक खोज शब्दों वाली क्वेरी सभी संस्थाओं को प्रदान की गई शर्तों में से किसी से मेल के साथ वापस कर देगी | +| `<->` | `Follow by` | दो शब्दों के बीच की दूरी निर्दिष्ट करें। | +| `:*` | `Prefix` | उन शब्दों को खोजने के लिए उपसर्ग खोज शब्द का उपयोग करें जिनके उपसर्ग मेल खाते हैं (2 वर्ण आवश्यक हैं।) | #### Examples diff --git a/website/pages/hi/release-notes/assemblyscript-migration-guide.mdx b/website/pages/hi/release-notes/assemblyscript-migration-guide.mdx index 2e3eca733040..a6d16d2d7def 100644 --- a/website/pages/hi/release-notes/assemblyscript-migration-guide.mdx +++ b/website/pages/hi/release-notes/assemblyscript-migration-guide.mdx @@ -127,11 +127,8 @@ ERROR TS2451: Cannot redeclare block-scoped variable 'a' ~~~~~~~~~~~~~ in assembly/index.ts(4,3) ``` - यदि आपके पास वेरिएबल शैडोइंग है, तो आपको अपने डुप्लिकेट वेरिएबल्स का नाम बदलने की आवश्यकता होगी। - ### Null Comparisons - अपने सबग्राफ पर अपग्रेड करने से, कभी-कभी आपको इस तरह की त्रुटियाँ मिल सकती हैं: ```typescript @@ -140,7 +137,6 @@ ERROR TS2322: Type '~lib/@graphprotocol/graph-ts/common/numbers/BigInt | null' i ~~~~ in src/mappings/file.ts(41,21) ``` - हल करने के लिए आप केवल `if` कथन को कुछ इस तरह से बदल सकते हैं: ```typescript @@ -184,7 +180,7 @@ let bytes = new Bytes(2) // bytes // same as: bytes as Uint8Array ``` -ऐसे दो परिदृश्य हैं जहां आप कास्ट करना चाहते हैं, लेकिन ` as``var ` **का उपयोग करना सुरक्षित नहीं है **: +ऐसे दो परिदृश्य हैं जहां आप कास्ट करना चाहते हैं, लेकिन `as``var` **का उपयोग करना सुरक्षित नहीं है **: - क्लास इनहेरिटेंस (सुपरक्लास → सबक्लास) पर डाउनकास्टिंग - एक सुपरक्लास साझा करने वाले दो प्रकारों के बीच @@ -287,7 +283,6 @@ ERROR TS2322: Type '~lib/string/String | null' is not assignable to type '~lib/s let somethingOrElse: string = container.data ? container.data : "else"; ``` - इस समस्या को ठीक करने के लिए, आप उस प्रॉपर्टी एक्सेस के लिए एक वेरिएबल बना सकते हैं ताकि कंपाइलर अशक्तता जांच जादू कर सके: ```typescript diff --git a/website/pages/hi/release-notes/graphql-validations-migration-guide.mdx b/website/pages/hi/release-notes/graphql-validations-migration-guide.mdx index 8a3a71fd956e..e7c713fad50a 100644 --- a/website/pages/hi/release-notes/graphql-validations-migration-guide.mdx +++ b/website/pages/hi/release-notes/graphql-validations-migration-guide.mdx @@ -40,9 +40,9 @@ npx @graphql-validate/cli -s https://api-next.thegraph.com/subgraphs/name/$GITHU **टिप्पणियाँ:** -- $GITHUB_USER, $SUBGRAPH_NAME को उपयुक्त मानों के साथ सेट करें या बदलें। जैसे: [`artblocks/art-blocks`](https://api.thegraph.com/subgraphs/name/artblocks/art-blocks) -- प्रदान किया गया पूर्वावलोकन स्कीमा URL (https://api-next.thegraph.com/) अत्यधिक दर-सीमित है और एक बार सभी उपयोगकर्ताओं के नए संस्करण में माइग्रेट हो जाने के बाद समाप्त हो जाएगा। **उत्पादन में इसका उपयोग न करें।** -- निम्नलिखित एक्सटेंशन वाली फाइलों में संचालन की पहचान की जाती है [`.graphql`,](https://www.graphql-tools.com/docs/schema-loading#graphql-file-loader)[`.ts`, `.tsx `, `.js`, `jsx`](https://www.graphql-tools.com/docs/schema-loading#code-file-loader) (`-o` विकल्प)। +- $GITHUB_USER, $SUBGRAPH_NAME को उपयुक्त मानों के साथ सेट करें या बदलें। जैसे: [`artblocks/art-blocks`](https://api.thegraph.com/subgraphs/name/artblocks/art-blocks) +- प्रदान किया गया पूर्वावलोकन स्कीमा URL (https://api-next.thegraph.com/) अत्यधिक दर-सीमित है और एक बार सभी उपयोगकर्ताओं के नए संस्करण में माइग्रेट हो जाने के बाद समाप्त हो जाएगा। **उत्पादन में इसका उपयोग न करें।** +- निम्नलिखित एक्सटेंशन वाली फाइलों में संचालन की पहचान की जाती है [`.graphql`,](https://www.graphql-tools.com/docs/schema-loading#graphql-file-loader)[`.ts`, `.tsx `, `.js`, `jsx`](https://www.graphql-tools.com/docs/schema-loading#code-file-loader) (`-o` विकल्प)। ### सीएलआई आउटपुट @@ -58,11 +58,11 @@ We provide an endpoint `https://api-next.thegraph.com/` that runs a `graph-node` आप उन्हें भेजकर प्रश्नों को आज़मा सकते हैं: -- `https://api-next.thegraph.com/subgraphs/id/` +- `https://api-next.thegraph.com/subgraphs/id/` या -- `https://api-next.thegraph.com/subgraphs/name//` +- `https://api-next.thegraph.com/subgraphs/name//` उन प्रश्नों पर काम करने के लिए जिन्हें सत्यापन त्रुटियों के रूप में फ़्लैग किया गया है, आप Altair या [GraphiQL](https://cloud.hasura.io/public/graphiql) जैसे अपने पसंदीदा ग्राफ़क्यूएल क्वेरी टूल का उपयोग कर सकते हैं, और अपनी क्वेरी को आज़मा सकते हैं। वे उपकरण आपके चलाने से पहले ही उन त्रुटियों को उनके UI में चिह्नित कर देंगे। @@ -363,8 +363,8 @@ query something { इसके अलावा, एक ग्राफक्यूएल फ़ील्ड चयन केवल तभी मान्य होता है जब निम्नलिखित मान्य हो: -- ऑब्जेक्ट फ़ील्ड में चयन सेट निर्दिष्ट होना चाहिए। -- एक एज फ़ील्ड (स्केलर, एनम) में निर्दिष्ट चयन सेट नहीं होना चाहिए। +- ऑब्जेक्ट फ़ील्ड में चयन सेट निर्दिष्ट होना चाहिए। +- एक एज फ़ील्ड (स्केलर, एनम) में निर्दिष्ट चयन सेट नहीं होना चाहिए। निम्नलिखित स्कीमा के साथ इन नियमों के उल्लंघन के कुछ उदाहरण यहां दिए गए हैं: @@ -464,8 +464,8 @@ query purposes($name: Int!) { उन अज्ञात संदर्भों को ठीक किया जाना चाहिए: -- नाम बदलें अगर यह एक टाइपो था -- अन्यथा हटा दें +- नाम बदलें अगर यह एक टाइपो था +- अन्यथा हटा दें ### फ़्रैगमेंट: अमान्य फैलाव या परिभाषा diff --git a/website/pages/hi/substreams/[[...slug]].mdx b/website/pages/hi/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/hi/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/it/cookbook/arweave.mdx b/website/pages/it/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/it/cookbook/arweave.mdx +++ b/website/pages/it/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/it/cookbook/cosmos.mdx b/website/pages/it/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/it/cookbook/cosmos.mdx +++ b/website/pages/it/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/it/cookbook/near.mdx b/website/pages/it/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/it/cookbook/near.mdx +++ b/website/pages/it/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/it/cookbook/subgraph-debug-forking.mdx b/website/pages/it/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/it/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/it/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/it/developing/creating-a-subgraph.mdx b/website/pages/it/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/it/developing/creating-a-subgraph.mdx +++ b/website/pages/it/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/it/glossary.mdx b/website/pages/it/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/it/glossary.mdx +++ b/website/pages/it/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/it/network/explorer.mdx b/website/pages/it/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/it/network/explorer.mdx +++ b/website/pages/it/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/it/substreams/[[...slug]].mdx b/website/pages/it/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/it/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/ja/cookbook/arweave.mdx b/website/pages/ja/cookbook/arweave.mdx index e4f05080f35f..db6daa881a02 100644 --- a/website/pages/ja/cookbook/arweave.mdx +++ b/website/pages/ja/cookbook/arweave.mdx @@ -2,20 +2,20 @@ title: Arweaveでのサブグラフ構築 --- -> グラフノードとホスティングサービスにおける Arweave のサポートはベータ版です。Arweave サブグラフの構築に関するご質問は[Discord](https://discord.gg/rC8rBuRtbH)にご連絡ください。 +> グラフノードとホスティングサービスにおけるArweaveのサポートはベータ版です。Arweaveサブグラフの構築に関するご質問は[Discord](https://discord.gg/rC8rBuRtbH)にご連絡ください。 -このガイドでは、Arweave ブロックチェーンのインデックスを作成するためのサブグラフの構築とデプロイ方法について学びます。 +このガイドでは、Arweaveブロックチェーンのインデックスを作成するためのサブグラフの構築とデプロイ方法について学びます。 -## Arweave とは? +## Arweaveとは? -Arweave プロトコルは、開発者がデータを永久に保存することを可能にし、それが Arweave と IPFS の主な違いです。IPFS は永続性に欠ける一方、Arweave に保存されたファイルは変更も削除もできません。 +Arweave プロトコルは、開発者がデータを永久に保存することを可能にし、それが Arweave と IPFS の主な違いです。IPFSは永続性に欠ける一方、Arweaveに保存されたファイルは変更も削除もできません。 -Arweave は既に、さまざまなプログラミング言語でプロトコルを統合するための多数のライブラリを構築しています。詳細については、次を確認できます。 +Arweaveは既に、さまざまなプログラミング言語でプロトコルを統合するための多数のライブラリを構築しています。詳細については、次を確認できます。 - [Arwiki](https://arwiki.wiki/#/en/main) -- [Arweave リソース](https://www.arweave.org/build) +- [Arweaveリソース](https://www.arweave.org/build) -## Arweave サブグラフとは? +## Arweaveサブグラフとは? グラフを使用すると、「サブグラフ」と呼ばれるカスタムのオープン API を構築できます。サブグラフは、を使用していつでもクエリできるようにするために、インデクサー (サーバー オペレーター) に、ブロックチェーンでインデックスを作成してサーバーに保存するデータを伝えるために使用されます。 [GraphQL](https://graphql.org/)。 @@ -23,14 +23,14 @@ Arweave は既に、さまざまなプログラミング言語でプロトコル ## Arweave サブグラフの作成 -Arweave のサブグラフを構築し展開できるようにするためには、2 つのパッケージが必要です。 +Arweaveのサブグラフを構築し展開できるようにするためには、2つのパッケージが必要です。 -1. `@graphprotocol/graph-cli` version 0.30.2 以降 - サブグラフの構築と展開を行うコマンドラインツールです。[ここをクリック](https://www.npmjs.com/package/@graphprotocol/graph-cli)し、`npm`を使用してダウンロードしてください。 -2. `@graphprotocol/graph-ts` version 0.27.0 以降 - サブグラフに特化した型のライブラリです。[こちらをクリック](https://www.npmjs.com/package/@graphprotocol/graph-ts)して、`npm`でダウンロードしてください。 +1. `@graphprotocol/graph-cli` version 0.30.2以降 - サブグラフの構築と展開を行うコマンドラインツールです。[ここをクリック](https://www.npmjs.com/package/@graphprotocol/graph-cli)し、`npm`を使用してダウンロードしてください。 +2. `@graphprotocol/graph-ts` version 0.27.0以降 - サブグラフに特化した型のライブラリです。[こちらをクリック](https://www.npmjs.com/package/@graphprotocol/graph-ts)して、`npm`でダウンロードしてください。 ## サブグラフのコンポーネント -サブグラフには 3 つの構成要素があります: +サブグラフには3つの構成要素があります: ### 1. マニフェスト - `subgraph.yaml` @@ -40,7 +40,7 @@ Arweave のサブグラフを構築し展開できるようにするためには ここでは、GraphQL を使用してサブグラフにインデックスを付けた後にクエリできるようにするデータを定義します。これは実際には API のモデルに似ており、モデルはリクエスト本文の構造を定義します。 -Arweave サブグラフの要件は、[existing documentation](/developing/creating-a-subgraph/#the-graphql-schema)に網羅されています。 +Arweaveサブグラフの要件は、[existing documentation](/developing/creating-a-subgraph/#the-graphql-schema)に網羅されています。 ### 3. アセンブリスクリプトマッピング - `mapping.ts` @@ -55,7 +55,7 @@ $ グラフ ビルド # AssemblyScript ファイルから Web アセンブリを ## サブグラフ マニフェスト定義 -サブグラフ マニフェスト `subgraph.yaml` は、サブグラフのデータ ソース、関心のあるトリガー、およびこれらのトリガーに応答して実行される関数を識別します。Arweave サブグラフのサブグラフ マニフェストの例については、以下を参照してください: +サブグラフ マニフェスト `subgraph.yaml` は、サブグラフのデータ ソース、関心のあるトリガー、およびこれらのトリガーに応答して実行される関数を識別します。Arweaveサブグラフのサブグラフ マニフェストの例については、以下を参照してください: ```yaml specVersion: 0.0.5 @@ -83,17 +83,17 @@ dataSources: ``` - Arweave サブグラフは新しい種類のデータ ソースを導入します (`arweave`) -- ネットワークはホスティングするグラフノード上のネットワークに対応する必要があります。ホスティングサービス上では、Arweave のメインネットは`arweave-mainnet`です。 +- ネットワークはホスティングするグラフノード上のネットワークに対応する必要があります。ホスティングサービス上では、Arweaveのメインネットは`arweave-mainnet`です。 - Arweave データ ソースには、オプションの source.owner フィールドが導入されています。これは、Arweave ウォレットの公開鍵です。 -Arweave データソースは 2 種類のハンドラーをサポートしています: +Arweaveデータソースは 2 種類のハンドラーをサポートしています: -- `blockHandlers` - すべての新しい Arweave ブロックに対して実行されます。source.owner は必要ありません。 +- `blockHandlers` - すべての新しいArweaveブロックに対して実行されます。source.ownerは必要ありません。 - `transactionHandlers` - データ ソースの `source.owner` が所有者であるすべてのトランザクションで実行されます。現在、`transactionHandlers` には所有者が必要です。ユーザーがすべてのトランザクションを処理したい場合は、`source.owner` として "" を指定する必要があります。 > Source.owner は、所有者のアドレスまたは公開鍵にすることができます。 -> トランザクションは Arweave permaweb の構成要素であり、エンドユーザーによって作成されるオブジェクトです。 +> トランザクションはArweave permawebの構成要素であり、エンドユーザーによって作成されるオブジェクトです。 > 注意:[Bundlr](https://bundlr.network/)トランザクションはまだサポートされていません。 @@ -105,7 +105,7 @@ Arweave データソースは 2 種類のハンドラーをサポートしてい イベントを処理するハンドラは、[AssemblyScript](https://www.assemblyscript.org/) で記述されています。 -Arweave のインデックス作成は、[AssemblyScript API](/developing/assemblyscript-api/)に Arweave 固有のデータ型を導入しています。 +Arweaveのインデックス作成は、[AssemblyScript API](/developing/assemblyscript-api/)にArweave固有のデータ型を導入しています。 ```tsx class Block { @@ -158,15 +158,15 @@ Arweave サブグラフのマッピングの記述は、Ethereum サブグラフ graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token ``` -## Arweave サブグラフのクエリ +## Arweaveサブグラフのクエリ -Arweave サブグラフの GraphQL エンドポイントは、スキーマ定義によって決定され、既存の API インタフェースが使用されます。詳細は[GraphQL API documentation](/querying/graphql-api/)を参照してください。 +ArweaveサブグラフのGraphQLエンドポイントは、スキーマ定義によって決定され、既存のAPIインタフェースが使用されます。詳細は[GraphQL API documentation](/querying/graphql-api/)を参照してください。 ## サブグラフの例 参考までにサブグラフの例を紹介します: -- [Arweave のサブグラフの例](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Arweaveのサブグラフの例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## よくある質問 @@ -174,21 +174,21 @@ Arweave サブグラフの GraphQL エンドポイントは、スキーマ定義 いいえ、サブグラフは 1 つのチェーン/ネットワークのデータソースのみをサポートします。 -### 保存されたファイルを Arweave でインデックス化することはできますか? +### 保存されたファイルをArweaveでインデックス化することはできますか? 現在、The Graph は Arweave をブロックチェーン (ブロックとトランザクション) としてのみインデックス化しています。 -### 自分のサブグラフにある Bundlr バンドルは特定できるのか? +### 自分のサブグラフにあるBundlrバンドルは特定できるのか? 現在はサポートされていません。 ### トランザクションを特定のアカウントにフィルターするにはどうすればよいですか? -Source.owner には、ユーザの公開鍵またはアカウントアドレスを指定することができます。 +Source.ownerには、ユーザの公開鍵またはアカウントアドレスを指定することができます。 ### 現在の暗号化フォーマットは? -通常、データはバイトとしてマッピングに渡され、直接格納されている場合はサブグラフに `hex` 形式で返されます (例: ブロックおよびトランザクション ハッシュ). あなたは A に変換したいかもしれません `base64` or `base64 URL` 私たちのマッピングでの安全なフォーマットを日本語に翻訳すると、ブロックエクスプローラーなどで表示されるものに一致するようになります[Arweave Explorer](https://viewblock.io/arweave/). +通常、データはバイトとしてマッピングに渡され、直接格納されている場合はサブグラフに `hex` 形式で返されます (例: ブロックおよびトランザクション ハッシュ). あなたはAに変換したいかもしれません `base64` or `base64 URL` 私たちのマッピングでの安全なフォーマットを日本語に翻訳すると、ブロックエクスプローラーなどで表示されるものに一致するようになります[Arweave Explorer](https://viewblock.io/arweave/). 以下の`bytesToBase64(bytes: Uint8Array, urlSafe: boolean): string` ヘルパー関数が使用可能で、`graph-ts`に追加される予定です。 diff --git a/website/pages/ja/cookbook/cosmos.mdx b/website/pages/ja/cookbook/cosmos.mdx index e4fd59d50dca..1de8abedb949 100644 --- a/website/pages/ja/cookbook/cosmos.mdx +++ b/website/pages/ja/cookbook/cosmos.mdx @@ -4,18 +4,18 @@ title: Cosmosでのサブグラフ構築 このガイドは、[Cosmos](https://docs.cosmos.network/)ベースのブロックチェーンをインデックスするサブグラフの構築について紹介するものです。 -## Cosmos のサブグラフとは何ですか? +## Cosmosのサブグラフとは何ですか? -Graph は、ブロックチェーンのイベントを処理し、その結果得られたデータを GraphQL API を介して簡単に利用できるようにするためのツールを開発者に提供するもので、個別にはサブグラフとして知られています。[Graph Node](https://github.com/graphprotocol/graph-node)が Cosmos イベントを処理できるようになったということは、Cosmos の開発者がスマートコントラクトの指標となるサブグラフを構築できるようになったということです。 +Graph は、ブロックチェーンのイベントを処理し、その結果得られたデータを GraphQL API を介して簡単に利用できるようにするためのツールを開発者に提供するもので、個別にはサブグラフとして知られています。[Graph Node](https://github.com/graphprotocol/graph-node)が Cosmosイベントを処理できるようになったということは、Cosmosの開発者がスマートコントラクトの指標となるサブグラフを構築できるようになったということです。 -Cosmos のサブグラフでサポートされているハンドラーは 4 種類あります。 +Cosmosのサブグラフでサポートされているハンドラーは4種類あります。 - **ブロックハンドラー**は、新しいブロックがチェーンに追加されるたびに実行されます。 - **イベントハンドラー**は、特定のイベントが発生したときに実行されます。 - **トランザクションハンドラー**は、トランザクションが発生したときに実行されます。 - **メッセージハンドラー**は、特定のメッセージが発生したときに実行されます。 -[Cosmos の公式ドキュメント](https://docs.cosmos.network/)に基づきます。 +[Cosmosの公式ドキュメント](https://docs.cosmos.network/)に基づきます。 > [イベント](https://docs.cosmos.network/main/core/events)は、アプリケーションの実行に関する情報を含むオブジェクトです。これらは主にブロックエクスプローラやウォレットなどのサービスプロバイダが、様々なメッセージやインデックストランザクションの実行を追跡するために使用されます。 @@ -25,19 +25,19 @@ Cosmos のサブグラフでサポートされているハンドラーは 4 種 ブロックハンドラーでは全てのデータにアクセスできますが、その他のハンドラーでは、サブグラフの開発者がよりきめ細かくデータを処理することができます。 -## Cosmos サブグラフの構築 +## Cosmosサブグラフの構築 ### サブグラフの依存関係 -[graph-cli](https://github.com/graphprotocol/graph-cli)は、サブグラフの構築とデプロイのための CLI ツールです。Cosmos サブグラフを扱うには、バージョン`>=0.30.0`が必要です。 +[graph-cli](https://github.com/graphprotocol/graph-cli)は、サブグラフの構築とデプロイのためのCLIツールです。Cosmosサブグラフを扱うには、バージョン`>=0.30.0`が必要です。 -[graph-ts](https://github.com/graphprotocol/graph-ts)はサブグラフに特化した型のライブラリで、Cosmos のサブグラフを扱うにはバージョン`>=0.27.0`が必要です。 +[graph-ts](https://github.com/graphprotocol/graph-ts)はサブグラフに特化した型のライブラリで、Cosmosのサブグラフを扱うにはバージョン`>=0.27.0`が必要です。 ### サブグラフの主な構成要素 -サブグラフの定義には、3 つの重要な部分があります。 +サブグラフの定義には、3つの重要な部分があります。 -**subgraph.yaml**: サブグラフのマニフェストを含む YAML ファイルで、追跡するイベントとその処理方法を特定します。 +**subgraph.yaml**: サブグラフのマニフェストを含むYAMLファイルで、追跡するイベントとその処理方法を特定します。 **schema.graphql**: サブグラフにどのようなデータが保存されているか、また GraphQL を使ってどのようにクエリを行うかを定義します。 @@ -75,7 +75,7 @@ dataSources: ``` - Cosmos subgraphs introduce a new `kind` of data source (`cosmos`). -- `ネットワーク`は、Cosmos エコシステム内のチェーンに対応する必要があります。この例では、Cosmos Hub mainnet が使用されています。 +- `ネットワーク`は、Cosmosエコシステム内のチェーンに対応する必要があります。この例では、Cosmos Hub mainnetが使用されています。 ### スキーマ定義 @@ -85,7 +85,7 @@ dataSources: イベントを処理するためのハンドラは[AssemblyScript](https://www.assemblyscript.org/)で書かれています。 -Cosmos インデックスでは、Cosmos 特有のデータ型を[AssemblyScript API](/developing/assemblyscript-api/)に導入しています。 +Cosmosインデックスでは、Cosmos特有のデータ型を[AssemblyScript API](/developing/assemblyscript-api/)に導入しています。 ```tsx class Block { @@ -172,15 +172,15 @@ class Any { `MessageData` の一部として、メッセージハンドラは、メッセージを包含するトランザクションに関する最も重要な情報を含む、トランザクションコンテキストを受け取ります。トランザクションコンテキストは`EventData`型でも利用できますが、対 応するイベントがトランザクションと関連付けられている場合に限ります。さらに、すべてのハンドラはブロック(`HeaderOnlyBlock`) への参照を受け取ります。 -Cosmos 統合の全種類一覧は[こちら](https://github.com/graphprotocol/graph-ts/blob/4c064a8118dff43b110de22c7756e5d47fcbc8df/chain/cosmos.ts)で確認できます。 +Cosmos統合の全種類一覧は[こちら](https://github.com/graphprotocol/graph-ts/blob/4c064a8118dff43b110de22c7756e5d47fcbc8df/chain/cosmos.ts)で確認できます。 ### メッセージ・デコーディング -Cosmos のメッセージはチェーンに固有であり、シリアル化された[Protocol Buffers](https://developers.google.com/protocol-buffers/)ペイロードの形でサブグラフに渡されることに注意することが重要です。その結果、メッセージデータは処理される前にマッピング関数でデコードされる必要があります。 +Cosmosのメッセージはチェーンに固有であり、シリアル化された[Protocol Buffers](https://developers.google.com/protocol-buffers/)ペイロードの形でサブグラフに渡されることに注意することが重要です。その結果、メッセージデータは処理される前にマッピング関数でデコードされる必要があります。 -サブグラフのメッセージデータをデコードする例は、[こちら](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts)で見ることができます。 +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). -## Cosmos サブグラフの作成と構築 +## Cosmosサブグラフの作成と構築 サブグラフ マッピングの記述を開始する前の最初のステップは、サブグラフ スキーマ ファイル (`schema.graphql`) で定義されたエンティティに基づいて型バインディングを生成することです。これにより、マッピング関数がそれらのタイプの新しいオブジェクトを作成し、ストアに保存できるようになります。これは、`codegen` CLI コマンドを使用して行います。 @@ -194,9 +194,9 @@ $ graph codegen $ graph build ``` -## Cosmos サブグラフの展開 +## Cosmosサブグラフの展開 -サブグラフを作成したら、`graph create` CLI コマンドを実行した後、`graph deploy` CLI コマンドを使用してサブグラフをデプロイすることができます。 +サブグラフを作成したら、`graph create` CLIコマンドを実行した後、`graph deploy` CLIコマンドを使用してサブグラフをデプロイすることができます。 **ホストされたサービス** @@ -218,42 +218,42 @@ $ graph build グラフ展開サブグラフ名 --ノード http://localhost:8020/ --ipfs http://localhost:5001 ``` -## Cosmos サブグラフのクエリ +## Cosmosサブグラフのクエリ -Cosmos サブグラフの GraphQL エンドポイントは、スキーマ定義によって決定され、既存の API インタフェースが使用されます。詳細は[GraphQL API documentation](/querying/graphql-api/)を参照してください。 +CosmosサブグラフのGraphQLエンドポイントは、スキーマ定義によって決定され、既存のAPIインタフェースが使用されます。詳細は[GraphQL API documentation](/querying/graphql-api/)を参照してください。 -## Cosmos ブロックチェーンに対応 +## Cosmosブロックチェーンに対応 ### コスモスハブ #### コスモスハブとは? -[Cosmos Hub ブロックチェーン](https://hub.cosmos.network/)は、[Cosmos](https://cosmos.network/)エコシステムの中で最初のブロックチェーンとなります。詳しくは[公式ドキュメント](https://docs.cosmos.network/)をご覧ください。 +[Cosmos Hubブロックチェーン](https://hub.cosmos.network/)は、[Cosmos](https://cosmos.network/)エコシステムの中で最初のブロックチェーンとなります。詳しくは[公式ドキュメント](https://docs.cosmos.network/)をご覧ください。 #### ネットワーク -Cosmos Hub のメインネットは`cosmoshub-4`です。コスモスハブの現在のテストネットは`theta-testnet-001`です。
    その他の Cosmos Hub ネットワーク、すなわち`cosmoshub-3`は停止しているため、データは提供されていません。 +Cosmos Hubのメインネットは`cosmoshub-4`です。コスモスハブの現在のテストネットは`theta-testnet-001`です。
    その他のCosmos Hubネットワーク、すなわち`cosmoshub-3`は停止しているため、データは提供されていません。 ### Osmosis -> グラフノードとホスティングサービスにおける Osmosis のサポートはベータ版です。Osmosis サブグラフの構築に関するご質問は、The Graph チームまでお問い合わせください。 +> グラフノードとホスティングサービスにおけるOsmosisのサポートはベータ版です。Osmosisサブグラフの構築に関するご質問は、The Graphチームまでお問い合わせください。 -#### Osmosis とは? +#### Osmosisとは? -[Osmosis](https://osmosis.zone/) は、Cosmos SDK の上に構築された分散型のクロスチェーン自動マーケット メーカー (AMM) プロトコルです。 IBC 対応のトークンを取引します。詳細については、[公式ドキュメント](https://docs.osmosis.zone/)をご覧ください。 +[Osmosis](https://osmosis.zone/) は、Cosmos SDK の上に構築された分散型のクロスチェーン自動マーケット メーカー (AMM) プロトコルです。 IBC対応のトークンを取引します。詳細については、[公式ドキュメント](https://docs.osmosis.zone/)をご覧ください。 #### ネットワーク -Osmosis メインネットは`osmosis-1`です。現在のテストネットは `osmo-test-4` です。 +Osmosisメインネットは`osmosis-1`です。現在のテストネットは `osmo-test-4` です。 ## サブグラフの例 参考までにサブグラフの例を紹介します: -[ブロックフィルタリング例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[ブロックフィルタリング例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[バリデータ報酬の例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[バリデータ報酬の例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[バリデータ・デリゲーションの例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[バリデータ・デリゲーションの例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis トークンスワップの例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosisトークンスワップの例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/ja/cookbook/near.mdx b/website/pages/ja/cookbook/near.mdx index 8c9628e07804..7c0a725ed986 100644 --- a/website/pages/ja/cookbook/near.mdx +++ b/website/pages/ja/cookbook/near.mdx @@ -75,7 +75,7 @@ dataSources: - NEAR サブグラフは、新しい`種類`のデータソース(`near`) を導入する - ホスト側のグラフノード上の`ネットワーク`に対応している必要があります。ホスティングサービスでは、NEAR のメインネットは`near-mainnet`,、NEAR のテストネットは`near-testnet`です。 - NEAR のデータソースには、オプションで`source.account`フィールドが用意されており、これは[NEAR account](https://docs.near.org/docs/concepts/account)に対応する人間が読める ID であり、アカウントまたはサブアカウントである可能性があります。 -- NEAR のデータソースは、オプションの `source.accounts` フィールドを導入し、オプションのサフィックスとプレフィックスを含んでいます。少なくともプレフィックスまたはサフィックスを指定する必要があり、それぞれ値のリストで始まるまたは終わる任意のアカウントにマッチします。以下の例では、以下のようにマッチします。`[app|good].*[morning.near|morning.testnet]`. リストだけが必要な場合は、他のフィールドを省略することができます。 +- NEARのデータソースは、オプションの `source.accounts` フィールドを導入し、オプションのサフィックスとプレフィックスを含んでいます。少なくともプレフィックスまたはサフィックスを指定する必要があり、それぞれ値のリストで始まるまたは終わる任意のアカウントにマッチします。以下の例では、以下のようにマッチします。`[app|good].*[morning.near|morning.testnet]`. リストだけが必要な場合は、他のフィールドを省略することができます。 ```yaml accounts: @@ -235,9 +235,9 @@ NEAR サブグラフの GraphQL エンドポイントは、既存の API イン 参考までにサブグラフの例を紹介します: -[NEAR ブロック](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEARブロック](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR 領収書](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR 領収書](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## よくある質問 diff --git a/website/pages/ja/cookbook/subgraph-debug-forking.mdx b/website/pages/ja/cookbook/subgraph-debug-forking.mdx index 7d22ee73175b..1a325a2c7f42 100644 --- a/website/pages/ja/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/ja/cookbook/subgraph-debug-forking.mdx @@ -2,23 +2,23 @@ title: フォークを用いた迅速かつ容易なサブグラフのデバッグ --- -大量のデータを処理する多くのシステムと同様に、The Graph の Indexers(グラフノード)は、サブグラフとターゲットブロックチェーンの同期にかなりの時間がかかる場合があります。デバッグを目的とした素早い変更と、インデックス作成に必要な長い待ち時間の不一致は非常に逆効果であり、私たちはそれを十分に認識しています。そこで、[LimeChain](https://limechain.tech/)が開発した**subgraph forking**を導入し、今回はこの機能を使ってサブグラフのデバッグを大幅に高速化する方法を紹介します。 +大量のデータを処理する多くのシステムと同様に、The GraphのIndexers(グラフノード)は、サブグラフとターゲットブロックチェーンの同期にかなりの時間がかかる場合があります。デバッグを目的とした素早い変更と、インデックス作成に必要な長い待ち時間の不一致は非常に逆効果であり、私たちはそれを十分に認識しています。そこで、[LimeChain](https://limechain.tech/)が開発した**subgraph forking**を導入し、今回はこの機能を使ってサブグラフのデバッグを大幅に高速化する方法を紹介します。 ## さて、それは何でしょうか? -**サブグラフのフォーク**とは、*他*のサブグラフのストア(通常はリモート) からエンティティをフェッチするプロセスです。 +**サブグラフのフォーク**とは、_他_のサブグラフのストア(通常はリモート) からエンティティをフェッチするプロセスです。 -デバッグの文脈では、**サブグラフのフォーク**により、ブロック*X*への同期を待つことなく、ブロック*X*で失敗したサブグラフのデバッグを行うことができます。 +デバッグの文脈では、**サブグラフのフォーク**により、ブロック_X_への同期を待つことなく、ブロック_X_で失敗したサブグラフのデバッグを行うことができます。 ## その方法は? -インデックス作成のためにリモートの Graph ノードにサブグラフをデプロイし、ブロック*X*で失敗した場合でも、ブロック*X*と同期しているストアを使用して GraphQL クエリを提供することができます。つまり、ブロック _X_ のインデックス作成時に発生するバグを修正するために、この最新のストアを利用できるのです。 +インデックス作成のためにリモートのGraphノードにサブグラフをデプロイし、ブロック_X_で失敗した場合でも、ブロック_X_と同期しているストアを使用して GraphQL クエリを提供することができます。つまり、ブロック _X_ のインデックス作成時に発生するバグを修正するために、この最新のストアを利用できるのです。 -簡単に言うと、ブロック*X*でデバッグされているローカルにデプロイされたサブグラフにインデックス状態の最新のビューを提供するために、ブロック*X*までインデックスされたサブグラフを持つことが保証されているリモート Graph ノードから *失敗したサブグラフをフォーク*しようとしているのです。 +簡単に言うと、ブロック_X_でデバッグされているローカルにデプロイされたサブグラフにインデックス状態の最新のビューを提供するために、ブロック_X_までインデックスされたサブグラフを持つことが保証されているリモートGraphノードから _失敗したサブグラフをフォーク_しようとしているのです。 ## コードを見てみましょう -サブグラフのデバッグに集中するために、物事をシンプルにして、Ethereum Gravity スマートコントラクトのサブグラフのインデックス作成の[例](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar)に沿って実行しましょう。 +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. 以下は、`Gravatar`のインデックスを作成するために定義されたハンドラで、バグが全くありません。 @@ -44,32 +44,32 @@ export function handleUpdatedGravatar(event: UpdatedGravatar): void { } ``` -この場合、残念なことに、この完璧に見えるサブグラフを[HostedService](https://thegraph.com/hosted-service/) にデプロイすると、*"Gravatar not found!"*というエラーで失敗してしまいます。 +この場合、残念なことに、この完璧に見えるサブグラフを[HostedService](https://thegraph.com/hosted-service/) にデプロイすると、_"Gravatar not found!"_というエラーで失敗してしまいます。 通常の試すであろう修正方法: 1. マッピングソースを変更して問題の解決を試す(解決されないことは分かっていても) -2. サブグラフを[HostedService](https://thegraph.com/hosted-service/)(または別のリモート Graph ノード)に再デプロイする +2. サブグラフを[HostedService](https://thegraph.com/hosted-service/)(または別のリモートGraphノード)に再デプロイする 3. 同期を待つ -4. 再び問題が発生した場合は、1 に戻る +4. 再び問題が発生した場合は、1に戻る -このように、通常のデバッグ処理とほぼ同じですが、1 つだけ、処理を恐ろしく遅くするステップがあります:_3. 同期を待つ_ +このように、通常のデバッグ処理とほぼ同じですが、1つだけ、処理を恐ろしく遅くするステップがあります:_3. 同期を待つ_ **サブグラフのフォーク**を利用することで、このステップを実質的に省略することができます。その方法は次の通りです: 0. **_適切なフォークベース_**セットを持つローカルのグラフ・ノードをスピンアップする 1. マッピングのソースを変更し、問題を解決する -2. ローカル Graph ノードにデプロイし、**_失敗したサブグラフをフォーク_**して、**_問題のブロックから開始_**する -3. もし再度、壊れる場合 1 に戻る +2. ローカルGraphノードにデプロイし、**_失敗したサブグラフをフォーク_**して、**_問題のブロックから開始_**する +3. もし再度、壊れる場合1に戻る -さて、ここで 2 つの疑問が生じます: +さて、ここで2つの疑問が生じます: 1. フォークベースとは? 2. フォーキングは誰ですか? 回答: -1. `fork-base`は「ベース」URL で、*subgraph id*が追加されたときの URL (`/`) はサブグラフのストアに対する有効な GraphQL endpoint であることを示します。 +1. `fork-base`は「ベース」URLで、_subgraph id_が追加されたときのURL (`/`) はサブグラフのストアに対する有効な GraphQL endpoint であることを示します。 2. フォーキングは簡単であり煩雑な手間はありません ```bash @@ -90,13 +90,13 @@ $ cargo run -p graph-node --release -- \ --fork-base https://api.thegraph.com/subgraphs/id/ ``` -1. よく調べてみると、2 つのハンドラで `Gravatar` をインデックスする際に使用される `id` 表現にミスマッチがあることに気づきました。`handleNewGravatar` はそれを hex (`event.params.id.toHex()`) に変換しますが、`handleUpdatedGravatar` は int32 (`event.params.id.toI32()`) を使用するので `handleUpdatedGravatar` は "Gravatar not found!" でパニックになってしまうのです。両方とも`id`を 16 進数に変換するようにしています。 -2. 変更後、ローカルの Graph ノードにサブグラフをデプロイし、**_失敗したサブグラフのフォーク_**と `subgraph.yaml` で `dataSources.source.startBlock` を `6190343` にセットしてください。 +1. よく調べてみると、2つのハンドラで `Gravatar` をインデックスする際に使用される `id` 表現にミスマッチがあることに気づきました。`handleNewGravatar` はそれを hex (`event.params.id.toHex()`) に変換しますが、`handleUpdatedGravatar` は int32 (`event.params.id.toI32()`) を使用するので `handleUpdatedGravatar` は "Gravatar not found!" でパニックになってしまうのです。両方とも`id`を16進数に変換するようにしています。 +2. 変更後、ローカルのGraphノードにサブグラフをデプロイし、**_失敗したサブグラフのフォーク_**と `subgraph.yaml` で `dataSources.source.startBlock` を `6190343` にセットしてください。 ```bash $ graph deploy gravity --debug-fork QmNp169tKvomnH3cPXTfGg4ZEhAHA6kEq5oy1XDqAxqHmW --ipfs http://localhost:5001 --node http://localhost:8020 ``` -3. ローカルの Graph ノードが出力するログを調べてみると、すべてうまくいっていることがわかります。 +3. ローカルのGraphノードが出力するログを調べてみると、すべてうまくいっていることがわかります。 4. バグのないサブグラフをリモート グラフ ノードにデプロイし、その後ずっと幸せに暮らしています。 (じゃがいもはありません) 5. 終わり diff --git a/website/pages/ja/cookbook/subgraph-uncrashable.mdx b/website/pages/ja/cookbook/subgraph-uncrashable.mdx index 4ffebe5a1c6c..fdc30e27cd86 100644 --- a/website/pages/ja/cookbook/subgraph-uncrashable.mdx +++ b/website/pages/ja/cookbook/subgraph-uncrashable.mdx @@ -2,11 +2,11 @@ title: 安全なサブグラフのコード生成 --- -[Subgraph Uncrashable](https://float-capital.github.io/float-subgraph-uncrashable/)は、プロジェクトの graphql スキーマからヘルパー関数のセットを生成するコード生成ツールです。これにより、サブグラフ内のエンティティとのすべてのインタラクションが完全に安全で一貫性のあるものになることを保証します。 +[Subgraph Uncrashable](https://float-capital.github.io/float-subgraph-uncrashable/)は、プロジェクトのgraphqlスキーマからヘルパー関数のセットを生成するコード生成ツールです。これにより、サブグラフ内のエンティティとのすべてのインタラクションが完全に安全で一貫性のあるものになることを保証します。 ## Why integrate with Subgraph Uncrashable? -- **継続的なアップタイム**です。誤って処理されたエンティティによってサブグラフがクラッシュすることがあり、The Graph に依存しているプロジェクトに支障をきたすことがあります。ヘルパー関数を設定して、サブグラフを「クラッシュしない」ようにし、ビジネスの継続性を確保しましょう。 +- **継続的なアップタイム**です。誤って処理されたエンティティによってサブグラフがクラッシュすることがあり、The Graphに依存しているプロジェクトに支障をきたすことがあります。ヘルパー関数を設定して、サブグラフを「クラッシュしない」ようにし、ビジネスの継続性を確保しましょう。 - **完全な安全**です。サブグラフの開発でよく見られる問題は、未定義のエンティティのロード、エンティティのすべての値の設定または初期化、エンティティのロードと保存のレースコンディションの問題です。エンティティとのすべてのインタラクションが完全にアトミックであることを確認する。 @@ -18,9 +18,9 @@ title: 安全なサブグラフのコード生成 - また、このフレームワークには、エンティティ変数のグループに対して、カスタムだが安全なセッター関数を作成する方法が(設定ファイルを通じて)含まれています。この方法では、ユーザーが古いグラフ・エンティティをロード/使用することは不可能であり、また、関数が必要とする変数の保存や設定を忘れることも不可能です。 -- 警告ログは、サブグラフのロジックに違反がある場所を示すログとして記録され、データの正確性を確保するための問題の修正に役立ちます。これらのログは、The Graph のホスティングサービスの「Logs」セクションで確認することができます。 +- 警告ログは、サブグラフのロジックに違反がある場所を示すログとして記録され、データの正確性を確保するための問題の修正に役立ちます。これらのログは、The Graphのホスティングサービスの「Logs」セクションで確認することができます。 -Subgraph Uncrashable は、Graph CLI codegen コマンドでオプションのフラグとして実行することができます。 +Subgraph Uncrashableは、Graph CLI codegenコマンドでオプションのフラグとして実行することができます。 ```sh graph codegen -u [options] [] diff --git a/website/pages/ja/deploying/subgraph-studio-faqs.mdx b/website/pages/ja/deploying/subgraph-studio-faqs.mdx index 223fdc410287..07e31999931e 100644 --- a/website/pages/ja/deploying/subgraph-studio-faqs.mdx +++ b/website/pages/ja/deploying/subgraph-studio-faqs.mdx @@ -4,11 +4,11 @@ title: サブグラフスタジオFAQ ## 1. What is Subgraph Studio? -[Subgraph Studio](https://thegraph.com/studio/)は、サブグラフや API キーを作成・管理・公開するための Dapp であり、サブグラフの作成・管理・公開を行う。 +[Subgraph Studio](https://thegraph.com/studio/)は、サブグラフやAPIキーを作成・管理・公開するためのDappであり、サブグラフの作成・管理・公開を行う。 ## 2. How do I create an API Key? -API を作成するには、Subgraph Studio に移動し、ウォレットを接続します。上部にある API keys タブをクリックします。そこで、API キーを作成することができます。 +APIを作成するには、Subgraph Studioに移動し、ウォレットを接続します。上部にあるAPI keysタブをクリックします。そこで、APIキーを作成することができます。 ## 3. Can I create multiple API Keys? @@ -26,6 +26,6 @@ API キーを作成後、「セキュリティ」セクションで、特定の ## 6. How do I find query URLs for subgraphs if I’m not the developer of the subgraph I want to use? -各サブグラフのクエリ URL は、Graph Explorer の「Subgraph Details」で確認できます。「Query」をクリックすると、興味のあるサブグラフのクエリ URL が表示されます。ここで``というプレースホルダーを、Subgraph Studio で利用したい API キーに置き換えることができます。 +各サブグラフのクエリ URL は、Graph Explorerの「Subgraph Details」で確認できます。「Query」をクリックすると、興味のあるサブグラフのクエリ URL が表示されます。ここで``というプレースホルダーを、Subgraph Studioで利用したい API キーに置き換えることができます。 -API キーを作成すると、自分でサブグラフを構築した場合でも、ネットワークに公開されているすべてのサブグラフにクエリを実行できることを覚えておいてください。新しい API キーを介したこれらのクエリは、ネットワーク上の他のクエリと同様に支払われます。 +APIキーを作成すると、自分でサブグラフを構築した場合でも、ネットワークに公開されているすべてのサブグラフにクエリを実行できることを覚えておいてください。新しい API キーを介したこれらのクエリは、ネットワーク上の他のクエリと同様に支払われます。 diff --git a/website/pages/ja/developing/creating-a-subgraph.mdx b/website/pages/ja/developing/creating-a-subgraph.mdx index 652e5b26627e..a8d18bbc1c30 100644 --- a/website/pages/ja/developing/creating-a-subgraph.mdx +++ b/website/pages/ja/developing/creating-a-subgraph.mdx @@ -2,7 +2,7 @@ title: サブグラフの作成 --- -サブグラフは、ブロックチェーンからデータを抽出し、加工して保存し、GraphQL で簡単にクエリできるようにします。 +サブグラフは、ブロックチェーンからデータを抽出し、加工して保存し、GraphQLで簡単にクエリできるようにします。 ![サブグラフの定義](/img/defining-a-subgraph.png) @@ -14,7 +14,7 @@ title: サブグラフの作成 - `AssemblyScript Mappings`: イベントデータをスキーマで定義されたエンティティに変換する[AssemblyScript](https://github.com/AssemblyScript/assemblyscript)コード (例: このチュートリアルでは`mapping.ts`) -> The Graph の分散型ネットワークでサブグラフを利用するためには、[API キーを作成する必要があります](/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key)。[シグナルを追加](/network/curating/#how-to-signal)し、少なくとも[10,000 GRT](/network-transition-faq/#how-can-i ensure-that-my-subgraph-will-pick-up-by-indexer-on-the-graph-network) をサブグラフに追加すると良いでしょう。 +> The Graphの分散型ネットワークでサブグラフを利用するためには、[API キーを作成する必要があります](/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key)。[シグナルを追加](/network/curating/#how-to-signal)し、少なくとも[10,000 GRT](/network-transition-faq/#how-can-i ensure-that-my-subgraph-will-pick-up-by-indexer-on-the-graph-network) をサブグラフに追加すると良いでしょう。 マニフェスト・ファイルの内容を詳しく説明する前に、サブグラフを構築してデプロイするために必要な [Graph CLI](https://github.com/graphprotocol/graph-cli)をインストールする必要があります。 @@ -87,7 +87,7 @@ Options: 契約書の`address`は、該当するネットワークの`networks.json`に書き込まれることになります -> **Note:** 対話型 CLI を使用している場合、`graph init`を正常に実行した後、新しい`dataSource`を追加するよう促されます。 +> **Note:** 対話型CLIを使用している場合、`graph init`を正常に実行した後、新しい`dataSource`を追加するよう促されます。 ## サブグラフ・マニフェスト @@ -98,7 +98,7 @@ Options: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -182,7 +182,7 @@ ABI ファイルは、契約内容と一致している必要があります。A エンティティを定義する前に、一歩下がって、データがどのように構造化され、リンクされているかを考えることが重要です。すべてのクエリは、サブグラフのスキーマで定義されたデータモデルと、サブグラフでインデックス化されたエンティティに対して行われます。このため、Dap のニーズに合わせてサブグラフ・スキーマを定義すると良いでしょう。エンティティは、イベントや関数ではなく、「データを含むオブジェクト」と考えるとよいでしょう。 -The Graph では、`schema.graphql`にエンティティタイプを定義するだけで、Graph Node がそのエンティティタイプのシングルインスタンスやコレクションを問い合わせるためのトップレベルのフィールドを生成してくれます。エンティティになるべき各タイプは、`@entity`ディレクティブでアノテーションされることが要求されます。デフォルトでは、エンティティはミュータブルです。つまり、マッピングは既存のエンティティをロードし、それを変更し、そのエンティティの新しいバージョンを保存することができます。Mutable には代償があり、例えば、チェーンからそのまま抽出されたデータを含むなど、決して変更されないことが分かっているエンティティタイプには、`@entity(immutable: true)` で immutable としてマークすることが推奨されます。マッピングは、エンティティが作成されたのと同じブロック内で変更が行われる限り、Immutable エンティティに変更を加えることができます。Immutable なエンティティは、書き込みや問い合わせが非常に高速になるため、可能な限り使用すべきです。 +The Graphでは、`schema.graphql`にエンティティタイプを定義するだけで、Graph Nodeがそのエンティティタイプのシングルインスタンスやコレクションを問い合わせるためのトップレベルのフィールドを生成してくれます。エンティティになるべき各タイプは、`@entity`ディレクティブでアノテーションされることが要求されます。デフォルトでは、エンティティはミュータブルです。つまり、マッピングは既存のエンティティをロードし、それを変更し、そのエンティティの新しいバージョンを保存することができます。Mutable には代償があり、例えば、チェーンからそのまま抽出されたデータを含むなど、決して変更されないことが分かっているエンティティタイプには、`@entity(immutable: true)` で immutable としてマークすることが推奨されます。マッピングは、エンティティが作成されたのと同じブロック内で変更が行われる限り、Immutableエンティティに変更を加えることができます。Immutableなエンティティは、書き込みや問い合わせが非常に高速になるため、可能な限り使用すべきです。 ### 良い例 @@ -228,7 +228,7 @@ Null 以外のフィールド 'name' の null 値が解決されました 各エンティティには `id` フィールドが必要です。このフィールドは `Bytes!` または `String!` 型である必要があります。 `Bytes!` の ID を持つエンティティは書き込みが高速になるため、`ID` に人間が読み取れるテキストが含まれていない限り、通常は `Bytes!` を使用することをお勧めします。 `String!` `id` を持つものとしてクエリします。 `id` フィールドは主キーとして機能し、同じタイプのすべてのエンティティ間で一意である必要があります。歴史的な理由から、タイプ `ID!` も受け入れられ、`String!` と同義です。 -例えば、`let id = left.id.concat(right.id)` は `left` と `right` の id から id を生成するために使用されます。同様に、既存のエンティティの id とカウンタ`count`から id を構成するには、`let id = left.id.concatI32(count)` を使うことができます。この連結は、`left`の長さが、例えば、`left.id`が`Address`であるように、全てのそうした実体に対して同じである限り、ユニークな id を作り出すことが保証されています。 +例えば、`let id = left.id.concat(right.id)` は `left` と `right` のidからidを生成するために使用されます。同様に、既存のエンティティのidとカウンタ`count`からidを構成するには、`let id = left.id.concatI32(count)` を使うことができます。この連結は、`left`の長さが、例えば、`left.id`が`Address`であるように、全てのそうした実体に対して同じである限り、ユニークなidを作り出すことが保証されています。 ### 組み込みの Scalar タイプ @@ -236,14 +236,14 @@ Null 以外のフィールド 'name' の null 値が解決されました GraphQL API では、以下の Scalar をサポートしています: -| タイプ | 説明書き | -| --- | --- | -| `Bytes` | Byte 配列で、16 進数の文字列で表されます。Ethereum のハッシュやアドレスによく使われます。 | -| `String` | `string`値の Scalar であり、Null 文字はサポートされておらず、自動的に削除されます。 | -| `Boolean` | `boolean`値を表す Scalar。 | -| `Int` | Int GraphQL の仕様では、`Int`のサイズは 32 バイトと定義されています。 | -| `BigInt` | 大きな整数。Ethereum の`uint32`, `int64`, `uint64`, ..., `uint256` タイプに使用されます。注: `int32`, `uint24` `int8`など`uint32`以下のものは`i32`として表現されます。 | -| `BigDecimal` | `BigDecimal`は、高精度の 10 進数を記号と指数で表します。指数の範囲は -6143 ~ +6144 です。有効数字 34 桁にまとめられます。 | +| タイプ | 説明書き | +| ------------ | --------------------------------------------------------------------------------------------------------------------------------- | +| `Bytes` | Byte 配列で、16 進数の文字列で表されます。Ethereum のハッシュやアドレスによく使われます。 | +| `String` | `string`値の Scalar であり、Null 文字はサポートされておらず、自動的に削除されます。 | +| `Boolean` | `boolean`値を表す Scalar。 | +| `Int` | Int GraphQL の仕様では、`Int`のサイズは 32 バイトと定義されています。 | +| `BigInt` | 大きな整数。Ethereum の`uint32`, `int64`, `uint64`, ..., `uint256` タイプに使用されます。注: `int32`, `uint24` `int8`など`uint32`以下のものは`i32`として表現されます。 | +| `BigDecimal` | `BigDecimal`は、高精度の 10 進数を記号と指数で表します。指数の範囲は -6143 ~ +6144 です。有効数字 34 桁にまとめられます。 | #### Enums @@ -445,33 +445,33 @@ query { サポートされている言語の辞書: -| コード | 辞書 | -| ------ | ------------ | -| simple | General | -| da | Danish | -| nl | Dutch | -| en | English | -| fi | Finnish | -| fr | French | -| de | German | -| hu | Hungarian | -| it | Italian | -| no | Norwegian | -| pt | ポルトガル語 | -| ro | Romanian | -| ru | Russian | -| es | Spanish | -| sv | Swedish | -| tr | Turkish | +| コード | 辞書 | +| ------ | --------- | +| simple | General | +| da | Danish | +| nl | Dutch | +| en | English | +| fi | Finnish | +| fr | French | +| de | German | +| hu | Hungarian | +| it | Italian | +| no | Norwegian | +| pt | ポルトガル語 | +| ro | Romanian | +| ru | Russian | +| es | Spanish | +| sv | Swedish | +| tr | Turkish | ### ランキングアルゴリズム サポートされている結果の順序付けのアルゴリズム: -| アルゴリズム | 説明書き | -| ------------- | ------------------------------------------------------------------- | -| rank | フルテキストクエリのマッチ品質 (0-1) を使用して結果を並べ替えます。 | -| proximityRank | ProximityRank rank に似ていますが、マッチの近接性も含みます。 | +| アルゴリズム | 説明書き | +| ------------- | ---------------------------------------- | +| rank | フルテキストクエリのマッチ品質 (0-1) を使用して結果を並べ替えます。 | +| proximityRank | ProximityRank rank に似ていますが、マッチの近接性も含みます。 | ## マッピングの記述 @@ -522,7 +522,7 @@ export function handleUpdatedGravatar(event: UpdatedGravatar): void { ## コード生成 -スマートコントラクト、イベント、エンティティを簡単かつタイプセーフに扱うために、Graph CLI はサブグラフの GraphQL スキーマとデータソースに含まれるコントラクト ABI から AssemblyScript タイプを生成することができます。 +スマートコントラクト、イベント、エンティティを簡単かつタイプセーフに扱うために、Graph CLIはサブグラフのGraphQLスキーマとデータソースに含まれるコントラクトABIからAssemblyScriptタイプを生成することができます。 これを行うためには @@ -567,7 +567,7 @@ import { Gravatar } from '../generated/schema' EVM 互換のスマート コントラクトの一般的なパターンは、レジストリ コントラクトまたはファクトリ コントラクトの使用です。1 つのコントラクトが、それぞれ独自の状態とイベントを持つ任意の数の他のコントラクトを作成、管理、または参照します。 -これらのサブコントラクトのアドレスは、事前にわかっている場合とわかっていない場合があり、これらのコントラクトの多くは、時間の経過とともに作成および/または追加される可能性があります。このような場合、単一のデータ ソースまたは固定数のデータ ソースを定義することは不可能であり、より動的なアプローチ、つまり *データ ソース テンプレート*が必要とされるのはこのためです。 +これらのサブコントラクトのアドレスは、事前にわかっている場合とわかっていない場合があり、これらのコントラクトの多くは、時間の経過とともに作成および/または追加される可能性があります。このような場合、単一のデータ ソースまたは固定数のデータ ソースを定義することは不可能であり、より動的なアプローチ、つまり _データ ソース テンプレート_が必要とされるのはこのためです。 ### メインコントラクトのデータソース @@ -647,7 +647,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **注:** 新しいデータ ソースは、それが作成されたブロックとそれに続くすべてのブロックの呼び出しとイベントのみを処理しますが、履歴データ (データなど) は処理しません。それは前のブロックに含まれています。 -> +> > 以前のブロックに新しいデータソースに関連するデータが含まれている場合は、コントラクトの現在の状態を読み取り、新しいデータソースが作成された時点でその状態を表すエンティティを作成することで、そのデータにインデックスを付けることが最善です。 ### データソースコンテクスト @@ -704,7 +704,7 @@ dataSources: ``` > **注:** コントラクト作成ブロックは、Etherscan ですばやく検索できます。 -> +> > 1. 検索バーにアドレスを入力してコントラクトを検索します。 > 2. `Contract Creator` セクションの作成トランザクションハッシュをクリックします。 > 3. トランザクションの詳細ページを読み込んで、そのコントラクトの開始ブロックを見つけます。 @@ -715,7 +715,7 @@ dataSources: コールハンドラーは、次の 2 つのケースのいずれかでのみトリガされます:指定された関数がコントラクト自身以外のアカウントから呼び出された場合、または Solidity で外部としてマークされ、同じコントラクト内の別の関数の一部として呼び出された場合。 -> **Note:** コールハンドラは現在、Parity トレース API に依存しています。BNB chain や Arbitrum のような特定のネットワークは、この API をサポートしていません。これらのネットワークのインデックスを持つサブグラフが 1 つ以上のコールハンドラを含む場合、同期を開始しません。サブグラフの開発者は、代わりにイベントハンドラを使用する必要があります。イベント・ハンドラはコール・ハンドラよりもはるかに高性能であり、すべての evm ネットワークでサポートされています。 +> **Note:** コールハンドラは現在、ParityトレースAPIに依存しています。BNB chainやArbitrumのような特定のネットワークは、このAPIをサポートしていません。これらのネットワークのインデックスを持つサブグラフが1つ以上のコールハンドラを含む場合、同期を開始しません。サブグラフの開発者は、代わりにイベントハンドラを使用する必要があります。イベント・ハンドラはコール・ハンドラよりもはるかに高性能であり、すべてのevmネットワークでサポートされています。 ### コールハンドラーの定義 @@ -778,7 +778,7 @@ filter: _定義されたハンドラーは、ハンドラーが定義されているコントラクト(データソース)への呼び出しを含むすべてのブロックに対して一度だけ呼ばれます。_ -> **Note:** コールハンドラは現在、Parity トレース API に依存しています。BNB chain や Arbitrum のような特定のネットワークは、この API をサポートしていません。これらのネットワークのインデックスを持つサブグラフが 1 つ以上のコールハンドラを含む場合、同期を開始しません。サブグラフの開発者は、代わりにイベントハンドラを使用する必要があります。イベント・ハンドラはコール・ハンドラよりもはるかに高性能であり、すべての evm ネットワークでサポートされています。 +> **Note:** コールハンドラは現在、ParityトレースAPIに依存しています。BNB chainやArbitrumのような特定のネットワークは、このAPIをサポートしていません。これらのネットワークのインデックスを持つサブグラフが1つ以上のコールハンドラを含む場合、同期を開始しません。サブグラフの開発者は、代わりにイベントハンドラを使用する必要があります。イベント・ハンドラはコール・ハンドラよりもはるかに高性能であり、すべてのevmネットワークでサポートされています。 ブロックハンドラーにフィルターがない場合、ハンドラーはブロックごとに呼び出されます。1 つのデータソースには、各フィルタータイプに対して 1 つのブロックハンドラーしか含めることができません。 @@ -853,9 +853,9 @@ eventHandlers: `specVersion` `0.0.4`以降、サブグラフ機能はマニフェストファイルのトップレベルにある`features`セクションで、以下の表のように`camelCase` の名前を使って明示的に宣言する必要があります: -| 特徴 | 名前 | +| 特徴 | 名前 | | --------------------------------------------------------- | --------------------------------------------------- | -| [致命的でないエラー](#non-fatal-errors) | `nonFatalErrors` | +| [致命的でないエラー](#non-fatal-errors) | `nonFatalErrors` | | [Full-text Search](#defining-fulltext-search-fields) | `fullTextSearch` | | [Grafting](#grafting-onto-existing-subgraphs) | `grafting` | | [IPFS on Ethereum Contracts](#ipfs-on-ethereum-contracts) | `ipfsOnEthereumContracts` or `nonDeterministicIpfs` | @@ -877,9 +877,9 @@ dataSources: ... IPFS と Ethereum を組み合わせる一般的なユースケースは、チェーン上で維持するにはコストがかかりすぎるデータを IPFS 上に保存し、Ethereum コントラクトで IPFS ハッシュを参照することです。 -このような IPFS のハッシュが与えられた場合、サブグラフは`ipfs.cat`や`ipfs.map`を使って IPFS から対応するファイルを読み取ることができます。ただし、これを確実に行うためには、サブグラフのインデックスを作成するグラフノードが接続する IPFS ノードに、これらのファイルがピン留めされている必要があります。[hosted service の場合、これは/](https://thegraph.com/hosted-service) +このような IPFS のハッシュが与えられた場合、サブグラフは`ipfs.cat`や`ipfs.map`を使って IPFS から対応するファイルを読み取ることができます。ただし、これを確実に行うためには、サブグラフのインデックスを作成するグラフノードが接続する IPFS ノードに、これらのファイルがピン留めされている必要があります。[hosted serviceの場合、これは/](https://thegraph.com/hosted-service) -> **注:** グラフ ネットワークはまだ `ipfs.cat` と `ipfs.map` をサポートしていないため、開発者はデプロイしないでください Studio を介してネットワークへのその機能を使用するサブグラフ +> **注:** グラフ ネットワークはまだ `ipfs.cat` と `ipfs.map` をサポートしていないため、開発者はデプロイしないでくださいStudio を介してネットワークへのその機能を使用するサブグラフ > **[機能管理](#experimental-features):** `ipfsOnEthereumContracts` はサブグラフ・マニフェストの `features` で宣言されなければなりません。非 EVM チェーンについては、`nonDeterministicIpfs` エイリアスも同じ目的で使用できます。 @@ -964,9 +964,9 @@ graft: ## ファイルデータソース -ファイルデータソースは、IPFS を皮切りに、インデックス作成時にオフチェーンデータに堅牢かつ拡張可能な方法でアクセスするための新しいサブグラフ機能です。 +ファイルデータソースは、IPFSを皮切りに、インデックス作成時にオフチェーンデータに堅牢かつ拡張可能な方法でアクセスするための新しいサブグラフ機能です。 -> また、オフチェーンデータの決定論的なインデックス作成、および任意の HTTP ソースデータの導入の可能性についても基礎ができました。 +> また、オフチェーンデータの決定論的なインデックス作成、および任意のHTTPソースデータの導入の可能性についても基礎ができました。 ### 概要 @@ -974,7 +974,7 @@ graft: これは、[既存のデータソーステンプレート](https://thegraph.com/docs/en/developing/creating-a-subgraph/#data-source-templates)と同様で、新しいチェーンベースのデータソースを動的に作成するために使用します。 -> 既存の`ipfs.cat` API を置き換えるものです。 +> 既存の`ipfs.cat` APIを置き換えるものです。 ### 移行ガイド @@ -1027,7 +1027,7 @@ type TokenMetadata @entity { } ``` -親エンティティと結果のファイルデータソースエンティティの間の関係が 1:1 である場合、最も単純なパターンは、IPFS CID をルックアップとして使用して、親エンティティを結果のファイルエンティティにリンクすることです。新しいファイルベースのエンティティのモデリングに問題がある場合は、Discord に連絡してください。 +親エンティティと結果のファイルデータソースエンティティの間の関係が1:1である場合、最も単純なパターンは、IPFS CIDをルックアップとして使用して、親エンティティを結果のファイルエンティティにリンクすることです。新しいファイルベースのエンティティのモデリングに問題がある場合は、Discordに連絡してください。 > [入れ子フィルター](https://thegraph.com/docs/en/querying/graphql-api/#example-for-nested-entity-filtering)を使用すると、これらの入れ子エンティティに基づいて、親エンティティをフィルタリングすることができます。 @@ -1057,9 +1057,9 @@ templates: #### ファイルを処理するハンドラーを新規に作成 -このハンドラは、1 つの`Bytes`パラメータを受け入れなければなりませんが、これは、ファイルが見つかったときに、その内容を処理することができます。これは多くの場合 JSON ファイルであり、`graph-ts`ヘルパー([ドキュメント](https://thegraph.com/docs/en/developing/assemblyscript-api/#json-api))で処理することができます。 +このハンドラは、1つの`Bytes`パラメータを受け入れなければなりませんが、これは、ファイルが見つかったときに、その内容を処理することができます。これは多くの場合JSONファイルであり、`graph-ts`ヘルパー([ドキュメント](https://thegraph.com/docs/en/developing/assemblyscript-api/#json-api))で処理することができます。 -読みやすい文字列としてのファイルの CID は、`dataSource`を介して次のようにアクセスできます: +読みやすい文字列としてのファイルのCIDは、`dataSource`を介して次のようにアクセスできます: ```typescript const cid = dataSource.stringParam() @@ -1097,9 +1097,9 @@ export function handleMetadata(content: Bytes): void { チェーンベースハンドラーの実行中に、ファイルデータソースを作成できるようになりました: - 自動生成された`templates`からテンプレートをインポートする。 -- マッピング内から`TemplateName.create(cid: string)` を呼び出し、cid を有効な IPFS コンテンツ識別子とする。 +- マッピング内から`TemplateName.create(cid: string)` を呼び出し、cidを有効なIPFSコンテンツ識別子とする。 -> 現在、Graph Node は[v0 と v1 のコンテンツ識別子](https://docs.ipfs.tech/concepts/content-addressing/)、およびディレクトリを持つコンテンツ識別子(例:`bafyreighykzv2we26wfrbzkcdw37sbrby4upq7ae3qobbq7i4er3tnxci/metadata.json`)をサポートしています。 +> 現在、Graph Nodeは[v0とv1のコンテンツ識別子](https://docs.ipfs.tech/concepts/content-addressing/)、およびディレクトリを持つコンテンツ識別子(例:`bafyreighykzv2we26wfrbzkcdw37sbrby4upq7ae3qobbq7i4er3tnxci/metadata.json`)をサポートしています。 例: @@ -1130,7 +1130,7 @@ export function handleTransfer(event: TransferEvent): void { } ``` -これは新しいファイルデータソースを作成し、Graph Node の設定された IPFS エンドポイントをポーリングし、見つからない場合はリトライします。ファイルが見つかると、ファイルデータソースハンドラが実行されます。 +これは新しいファイルデータソースを作成し、Graph Nodeの設定されたIPFSエンドポイントをポーリングし、見つからない場合はリトライします。ファイルが見つかると、ファイルデータソースハンドラが実行されます。 この例では、親 `Token` エンティティと結果の `TokenMetadata` エンティティの間のルックアップとして CID を使用しています。 @@ -1150,23 +1150,23 @@ export function handleTransfer(event: TransferEvent): void { - ファイルデータソースハンドラは、他のファイルデータソースのエンティティにアクセスすることはできません。 - ファイルデータソースに関連するエンティティは、チェーンベースハンドラーからアクセスできません。 -> この制約は、ほとんどのユースケースで問題になることはありませんが、一部のユースケースでは複雑さをもたらすかもしれません。ファイルベースのデータをサブグラフでモデル化する際に問題がある場合は、Discord を通じてご連絡ください。 +> この制約は、ほとんどのユースケースで問題になることはありませんが、一部のユースケースでは複雑さをもたらすかもしれません。ファイルベースのデータをサブグラフでモデル化する際に問題がある場合は、Discordを通じてご連絡ください。 また、オンチェーンデータソースや他のファイルデータソースからデータソースを作成することはできません。この制限は、将来的に解除される可能性があります。 #### ベストプラクティス -NFT メタデータを対応するトークンにリンクする場合、メタデータの IPFS ハッシュを使用して、トークン エンティティから Metadata エンティティを参照します。IPFS ハッシュを ID として使用して Metadata エンティティを保存します。 +NFT メタデータを対応するトークンにリンクする場合、メタデータの IPFS ハッシュを使用して、トークン エンティティから Metadata エンティティを参照します。IPFSハッシュをIDとして使用してMetadataエンティティを保存します。 ファイル データ ソースの作成時に [DataSource context](https://thegraph.com/docs/en/developing/assemblyscript-api/#entity-and-data-source-context) を使用すると、ファイル データ ソース ハンドラーで利用できるようになる追加情報を渡すことができます。 -複数回リフレッシュされるエンティティがある場合は、IPFS ハッシュ&スタンプとエンティティ ID を使用して一意のファイルベースのエンティティを作成し、チェーンベースのエンティティ内の派生フィールドを使用してそれらを参照します。 +複数回リフレッシュされるエンティティがある場合は、IPFSハッシュ&スタンプとエンティティIDを使用して一意のファイルベースのエンティティを作成し、チェーンベースのエンティティ内の派生フィールドを使用してそれらを参照します。 > クエリが「最新版」のみを返すように、上記の推奨事項を改善するよう取り組んでいます。 #### 既知の問題点 -ファイル データ ソースは現在、ABI が使用されていないにもかかわらず、ABI を必要とします ([issue](https://github.com/graphprotocol/graph-cli/issues/961))。回避策は、任意の ABI を追加することです。 +ファイル データ ソースは現在、ABI が使用されていないにもかかわらず、ABI を必要とします ([issue](https://github.com/graphprotocol/graph-cli/issues/961))。回避策は、任意のABIを追加することです。 ファイルデータソースのハンドラーは、`eth_call`コントラクトバインディングをインポートするファイルには存在できず、「unknown import」で失敗しました。`ethereum::ethereum.call` has not been defined" ([issue](https://github.com/graphprotocol/graph-cli/issues/4309)) で失敗します。回避策としては、ファイルデータソースハンドラーを専用ファイルに作成することです。 @@ -1176,4 +1176,4 @@ NFT メタデータを対応するトークンにリンクする場合、メタ #### 参考文献 -[GIP ファイルデータソース](https://forum.thegraph.com/t/gip-file-data-sources/2721) +[GIPファイルデータソース](https://forum.thegraph.com/t/gip-file-data-sources/2721) diff --git a/website/pages/ja/developing/developer-faqs.mdx b/website/pages/ja/developing/developer-faqs.mdx index 9905822ae151..b8fd8ee79db7 100644 --- a/website/pages/ja/developing/developer-faqs.mdx +++ b/website/pages/ja/developing/developer-faqs.mdx @@ -4,7 +4,7 @@ title: 開発者 FAQ ## 1. What is a subgraph? -サブグラフは、ブロックチェーンデータを基に構築されたカスタム API です。サブグラフは GraphQL クエリ言語を使ってクエリされ、Graph CLI を使って Graph Node にデプロイされます。デプロイされ、The Graph の分散型ネットワークに公開されると、インデクサーはサブグラフを処理し、サブグラフの消費者がクエリできるようにします。 +サブグラフは、ブロックチェーンデータを基に構築されたカスタムAPIです。サブグラフはGraphQLクエリ言語を使ってクエリされ、Graph CLIを使ってGraph Nodeにデプロイされます。デプロイされ、The Graphの分散型ネットワークに公開されると、インデクサーはサブグラフを処理し、サブグラフの消費者がクエリできるようにします。 ## 2. Can I delete my subgraph? @@ -135,7 +135,7 @@ The Graph は、ホステッドサービスに対して課金することはあ ## 27. When will the Hosted Service be shut down? -ホスティングサービスは 2023 年第 1 四半期に停止する予定です。発表のブログ記事[こちら](https://thegraph.com/blog/sunsetting-hosted-service)をお読みください。Hosted Service を利用しているすべての Dapps は、分散型ネットワークに移行することが推奨されます。Migration Grants は、開発者のサブグラフの移行を支援するために用意されています。サブグラフを移行するアプリは[こちら](https://thegraph.typeform.com/to/Zz8UAPri?typeform-source=thegraph.com)から申請することができます。 +ホスティングサービスは2023年第1四半期に停止する予定です。発表のブログ記事[こちら](https://thegraph.com/blog/sunsetting-hosted-service)をお読みください。Hosted Serviceを利用しているすべてのDappsは、分散型ネットワークに移行することが推奨されます。Migration Grants は、開発者のサブグラフの移行を支援するために用意されています。サブグラフを移行するアプリは[こちら](https://thegraph.typeform.com/to/Zz8UAPri?typeform-source=thegraph.com)から申請することができます。 ## 28. How do I upgrade a subgraph on mainnet? diff --git a/website/pages/ja/glossary.mdx b/website/pages/ja/glossary.mdx index 368abf6d10e5..d7fa2fe8b654 100644 --- a/website/pages/ja/glossary.mdx +++ b/website/pages/ja/glossary.mdx @@ -4,76 +4,78 @@ title: 用語集 - **The Graph**。データのインデックス(索引付け)とクエリ(問い合わせ)のための分散型プロトコル。 -- **クエリ**:データに対する要求。The Graph の場合、クエリとは、インデクサーが回答するサブグラフのデータに対するリクエストのことです。 +- **クエリ**:データに対する要求。The Graphの場合、クエリとは、インデクサーが回答するサブグラフのデータに対するリクエストのことです。 -- **GraphQL**:API 用のクエリ言語であり、既存のデータでクエリを実行するためのランタイムです。グラフは、サブグラフのクエリに GraphQL を使用しています。 +- **GraphQL**:API用のクエリ言語であり、既存のデータでクエリを実行するためのランタイムです。グラフは、サブグラフのクエリにGraphQLを使用しています。 -- **Subgraph**:[GraphQL](https://graphql.org/)を使ってクエリできる、ブロックチェーンデータ上に構築されたカスタム API です。開発者は、The Graph の分散型ネットワークにサブグラフを構築、デプロイ、公開することができます。その後、インデクサーはサブグラフのインデックス作成を開始し、サブグラフコンシューマーがクエリできるようにすることができます。 +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. -- **ホスティングサービス**:The Graph の分散型ネットワークが、サービスコスト、サービス品質、開発者体験を成熟させていく過程で、サブグラフの構築とクエリのための一時的な足場となるサービスです。 +- **Subgraph**:[GraphQL](https://graphql.org/)を使ってクエリできる、ブロックチェーンデータ上に構築されたカスタムAPIです。開発者は、The Graphの分散型ネットワークにサブグラフを構築、デプロイ、公開することができます。その後、インデクサーはサブグラフのインデックス作成を開始し、サブグラフコンシューマーがクエリできるようにすることができます。 -- **インデクサー**:ブロックチェーンからデータをインデックスし、GraphQL クエリを提供するためにインデックスノードを実行するネットワーク参加者です。 +- **ホスティングサービス**:The Graphの分散型ネットワークが、サービスコスト、サービス品質、開発者体験を成熟させていく過程で、サブグラフの構築とクエリのための一時的な足場となるサービスです。 -- **インデクサー報酬**:GRT では、インデクサー報酬は、クエリ料金のリベートとインデックスの報酬の 2 つの要素で成り立っています。 +- **インデクサー**:ブロックチェーンからデータをインデックスし、GraphQLクエリを提供するためにインデックスノードを実行するネットワーク参加者です。 + +- **インデクサー報酬**:GRTでは、インデクサー報酬は、クエリ料金のリベートとインデックスの報酬の2つの要素で成り立っています。 1. **クエリ料**:ネットワーク上でクエリを提供するサブグラフ消費者から支払われます。 - 2. **インデックス作成報酬**:インデクサーが、サブグラフのインデックス作成に対して受け取る報酬です。インデックス報酬は、毎年 3%の GRT を新規に発行することで発生します。 + 2. **インデックス作成報酬**:インデクサーが、サブグラフのインデックス作成に対して受け取る報酬です。インデックス報酬は、毎年3%のGRTを新規に発行することで発生します。 -- **インデクサーのセルフステーク**:インデクサーが分散型ネットワークに参加するためにステークする GRT の金額です。最低額は 100,000GRT で、上限はありません。 +- **インデクサーのセルフステーク**:インデクサーが分散型ネットワークに参加するためにステークするGRTの金額です。最低額は100,000GRTで、上限はありません。 -- **デリゲーター**:GRT を所有し、その GRT をインデクサーに委任するネットワーク参加者です。これにより、インデクサーはネットワーク上のサブグラフへの出資比率を高めることができます。デリゲーターは、インデクサーがサブグラフを処理する際に受け取るインデクサー報酬の一部を受け取ります。 +- **デリゲーター**:GRTを所有し、そのGRTをインデクサーに委任するネットワーク参加者です。これにより、インデクサーはネットワーク上のサブグラフへの出資比率を高めることができます。デリゲーターは、インデクサーがサブグラフを処理する際に受け取るインデクサー報酬の一部を受け取ります。 -- **デリゲーション・タックス**。デリゲーターがインデクサーに GRT を委任する際に支払う 0.5%の手数料です。手数料の支払いに使われた GRT はバーンされます。 +- **デリゲーション・タックス**。デリゲーターがインデクサーにGRTを委任する際に支払う0.5%の手数料です。手数料の支払いに使われたGRTはバーンされます。 -- **キュレーター**:質の高いサブグラフを特定し、キュレーションシェアと引き換えにそれらを「キュレーション」する(つまり、その上で GRT をシグナルする)ネットワーク参加者。インデクサーがサブグラフのクエリ料を請求すると、10%がそのサブグラフの Curator に分配されます。インデクサーは、サブグラフ上のシグナルに比例してインデックス作成報酬を得ます。GRT のシグナル量と、サブグラフのインデックスを作成するインデクサーの数には相関関係があります。 +- **キュレーター**:質の高いサブグラフを特定し、キュレーションシェアと引き換えにそれらを「キュレーション」する(つまり、その上でGRTをシグナルする)ネットワーク参加者。インデクサーがサブグラフのクエリ料を請求すると、10%がそのサブグラフのCuratorに分配されます。インデクサーは、サブグラフ上のシグナルに比例してインデックス作成報酬を得ます。GRTのシグナル量と、サブグラフのインデックスを作成するインデクサーの数には相関関係があります。 -- **キュレーション税**。キュレーターがサブグラフに GRT のシグナルを送る際に支払う 1%の手数料。手数料を支払うために使用される GRT はバーンされます。 +- **キュレーション税**。キュレーターがサブグラフにGRTのシグナルを送る際に支払う1%の手数料。手数料を支払うために使用されるGRTはバーンされます。 - **サブグラフ・コンシューマー**。消費者。サブグラフにクエリをするアプリケーションやユーザーが主となります。 -- **サブグラフ・デベロッパー**:The Graph の分散型ネットワークにサブグラフを構築し、デプロイする開発者のことです。 +- **サブグラフ・デベロッパー**:The Graphの分散型ネットワークにサブグラフを構築し、デプロイする開発者のことです。 - **Subgraph Manifest**:サブグラフの GraphQL スキーマ、データ ソース、およびその他のメタデータを記述する JSON ファイルです。[こちら](https://ipfs.io/ipfs/QmVQdzeGdPUiLiACeqXRpKAYpyj8Z1yfWLMUq7A7WundUf)がその例です。 -- **リベート・プール**:サブグラフの消費者が支払ったクエリ料を、クエリ料のリベートとしてインデクサが請求できるまで保持する経済的な安全対策。残った GRT はバーンされます。 +- **リベート・プール**:サブグラフの消費者が支払ったクエリ料を、クエリ料のリベートとしてインデクサが請求できるまで保持する経済的な安全対策。残ったGRTはバーンされます。 -- **エポック**:ネットワークにおける時間の単位。1 エポックは現在 6,646 ブロック、約 1 日である。 +- **エポック**:ネットワークにおける時間の単位。1エポックは現在6,646ブロック、約1日である。 -- **アロケーション**:インデクサは、GRT のステーク(デリゲータのステークを含む)を、The Graph の分散型ネットワークで公開されているサブグラフに割り当てることができます。アロケーションは、4 つの段階のうちの 1 つです。 +- **アロケーション**:インデクサは、GRTのステーク(デリゲータのステークを含む)を、The Graphの分散型ネットワークで公開されているサブグラフに割り当てることができます。アロケーションは、4つの段階のうちの1つです。 - 1. **アクティブ**:アロケーションは、オンチェーンで作成されたときにアクティブとみなされます。これはアロケーションを開くと呼ばれ、インデクサーが特定のサブグラフのために積極的にインデックスを作成し、クエリを提供していることをネットワークに示しています。アクティブなアロケーションは、サブグラフ上のシグナルと割り当てられた GRT の量に比例してインデックス作成報酬を発生させます。 + 1. **アクティブ**:アロケーションは、オンチェーンで作成されたときにアクティブとみなされます。これはアロケーションを開くと呼ばれ、インデクサーが特定のサブグラフのために積極的にインデックスを作成し、クエリを提供していることをネットワークに示しています。アクティブなアロケーションは、サブグラフ上のシグナルと割り当てられたGRTの量に比例してインデックス作成報酬を発生させます。 - 2. **クローズド**:インデクサーは、最近の有効なインデックス証明(POI)を提出することで、与えられたサブグラフに発生したインデクサー報酬を請求することができます。これは、割り当てを終了することとして知られています。アロケーションを閉じるには、最低 1 エポック以上開いていなければなりません。最大割当期間は 28 エポックです。インデクサが 28 エポックを超えてアロケーションを開いたままにした場合、それはステイルアロケーションとして知られています。割り当てが**クローズド**状態にあるとき、フィッシャーはまだ、偽のデータを提供したインデクサーに異議を唱えるために紛争を開くことができます。 + 2. **クローズド**:インデクサーは、最近の有効なインデックス証明(POI)を提出することで、与えられたサブグラフに発生したインデクサー報酬を請求することができます。これは、割り当てを終了することとして知られています。アロケーションを閉じるには、最低1エポック以上開いていなければなりません。最大割当期間は28エポックです。インデクサが28エポックを超えてアロケーションを開いたままにした場合、それはステイルアロケーションとして知られています。割り当てが**クローズド**状態にあるとき、フィッシャーはまだ、偽のデータを提供したインデクサーに異議を唱えるために紛争を開くことができます。 3. **ファイナライズド**:紛争期間が終了し、インデクサーが請求できるクエリ料の払い戻しが可能となる段階。 4. **請求済み**:割り当ての最終段階で、対象となるすべての報酬が配布され、そのクエリ料報酬が請求されている状態です。 -- **Subgraph Studio**:サブグラフの構築、デプロイ、公開のための強力な DAP です。 +- **Subgraph Studio**:サブグラフの構築、デプロイ、公開のための強力なDAPです。 - **漁師**: ネットワーク参加者は、インデクサーのクエリ応答と POI に異議を唱えることがあります。これを漁師といいます。 Fisherman に有利に解決された紛争は、Fisherman への裁定とともに、Indexer に金銭的ペナルティをもたらし、ネットワーク内の Indexer によって実行されるインデックス作成およびクエリ作業の整合性を奨励します。ペナルティ (スラッシュ) は現在、インデクサーのセルフ ステークの 2.5% に設定されており、削減された GRT の 50% がフィッシャーマンに、残りの 50% がバーンされます。 -- **アービトレーター**:アービトレーターは、ガバナンスを介して設定されたネットワーク参加者です。アービトレーターの役割は、インデックス作成とクエリの論争の結果を決定することです。彼らの目標は、The Graph Network の実用性と信頼性を最大化することにあります。 +- **アービトレーター**:アービトレーターは、ガバナンスを介して設定されたネットワーク参加者です。アービトレーターの役割は、インデックス作成とクエリの論争の結果を決定することです。彼らの目標は、The Graph Networkの実用性と信頼性を最大化することにあります。 -- **スラッシング**: インデクサーは、不正確なインデックス証明(POI)を提供したり、不正確なデータを提供したりすると、賭けられた GRT をスラッシングされることがあります。スラッシングの割合はプロトコルパラメータで、現在はインデクサーのセルフステークの 2.5%に設定されています。削減された GRT の 50%は、不正確なデータまたは不正確な POI に異議を唱えたフィッシャーマンに支払われる。残りの 50%はバーンされます。 +- **スラッシング**: インデクサーは、不正確なインデックス証明(POI)を提供したり、不正確なデータを提供したりすると、賭けられたGRTをスラッシングされることがあります。スラッシングの割合はプロトコルパラメータで、現在はインデクサーのセルフステークの2.5%に設定されています。削減されたGRTの50%は、不正確なデータまたは不正確なPOIに異議を唱えたフィッシャーマンに支払われる。残りの50%はバーンされます。 -- **インデックス作成報酬**:インデクサーがサブグラフのインデックス作成に対して受け取る報酬です。インデックス作成報酬は GRT で分配されます。 +- **インデックス作成報酬**:インデクサーがサブグラフのインデックス作成に対して受け取る報酬です。インデックス作成報酬はGRTで分配されます。 -- **デリゲーション報酬**:GRT をインデクサーにデリゲートすることでデリゲーターが受け取る報酬。デリゲーション報酬は GRT で分配されます。 +- **デリゲーション報酬**:GRTをインデクサーにデリゲートすることでデリゲーターが受け取る報酬。デリゲーション報酬はGRTで分配されます。 -- **GRT**: Graph のワークユーティリティトークン。GRT は、ネットワーク参加者にネットワークへの貢献に対する経済的インセンティブを提供します。 +- **GRT**: Graphのワークユーティリティトークン。GRTは、ネットワーク参加者にネットワークへの貢献に対する経済的インセンティブを提供します。 -- **POI または Proof of Indexing**:インデクサーの割り当てが終了し、与えられたサブグラフで発生したインデクサー報酬を請求したい場合、有効かつ最新のインデクシング証明(POI)を提出しなければなりません。フィッシャーマンは、インデクサーの提供した POI に異議を唱えることができます。フィッシャーマン側に有利に解決された紛争は、そのインデクサーの削減をもたらします。 +- **POIまたはProof of Indexing**:インデクサーの割り当てが終了し、与えられたサブグラフで発生したインデクサー報酬を請求したい場合、有効かつ最新のインデクシング証明(POI)を提出しなければなりません。フィッシャーマンは、インデクサーの提供したPOIに異議を唱えることができます。フィッシャーマン側に有利に解決された紛争は、そのインデクサーの削減をもたらします。 -- **グラフノード**:Graph Node は、サブグラフにインデックスを付け、その結果得られたデータを GraphQL API を介してクエリに利用できるようにするコンポーネントです。そのため、インデクサースタックの中心であり、グラフノードの正しい動作は、成功するインデクサを実行するために重要です。 +- **グラフノード**:Graph Nodeは、サブグラフにインデックスを付け、その結果得られたデータをGraphQL APIを介してクエリに利用できるようにするコンポーネントです。そのため、インデクサースタックの中心であり、グラフノードの正しい動作は、成功するインデクサを実行するために重要です。 - **インデクサエージェント**:インデクサエージェントは、インデクサスタックの一部です。ネットワークへの登録、グラフノードへのサブグラフの展開の管理、割り当ての管理など、チェーン上でのインデクサーのインタラクションを促進します。 -- **グラフクライアント**:GraphQL ベースの Dapps を分散的に構築するためのライブラリです。 +- **グラフクライアント**:GraphQLベースのDappsを分散的に構築するためのライブラリです。 -- **グラフエクスプローラ**:ネットワーク参加者がサブグラフを探索し、プロトコルと対話するために設計された dapp です。 +- **グラフエクスプローラ**:ネットワーク参加者がサブグラフを探索し、プロトコルと対話するために設計されたdappです。 -- **グラフ CLI**:The Graph を構築し、デプロイするためのコマンドラインインターフェースツールです。 +- **グラフCLI**:The Graphを構築し、デプロイするためのコマンドラインインターフェースツールです。 - **クールダウン期間**:デリゲーションパラメータを変更したインデクサが再度デリゲーションできるようになるまでの残り時間。 diff --git a/website/pages/ja/managing/transferring-subgraph-ownership.mdx b/website/pages/ja/managing/transferring-subgraph-ownership.mdx index 77b67d36dfbe..2e53cfd2ce04 100644 --- a/website/pages/ja/managing/transferring-subgraph-ownership.mdx +++ b/website/pages/ja/managing/transferring-subgraph-ownership.mdx @@ -4,15 +4,15 @@ title: サブグラフの所有権移転 グラフは、サブグラフの所有権の譲渡をサポートしています。 -サブグラフをメインネットにデプロイすると、サブグラフをデプロイしたアドレスに NFT がミントされます。NFT は標準的な ERC721 をベースにしているため、異なるアカウントに簡単に転送することができます。 +サブグラフをメインネットにデプロイすると、サブグラフをデプロイしたアドレスにNFTがミントされます。NFTは標準的なERC721をベースにしているため、異なるアカウントに簡単に転送することができます。 -NFT の所有者は、そのサブグラフをコントロールします。所有者が NFT の売却や移転を決めた場合、ネットワーク上のそのサブグラフの編集や更新はできなくなります。 +NFTの所有者は、そのサブグラフをコントロールします。所有者がNFTの売却や移転を決めた場合、ネットワーク上のそのサブグラフの編集や更新はできなくなります。 -この機能により、開発ライフサイクルに柔軟性が増すだけでなく、マルチシグにコントロールを移動したり、コミュニティメンバーが DAO に代わって作成するなど、特定のユースケースがより便利になります。 +この機能により、開発ライフサイクルに柔軟性が増すだけでなく、マルチシグにコントロールを移動したり、コミュニティメンバーがDAOに代わって作成するなど、特定のユースケースがより便利になります。 ## Viewing your subgraph as an NFT -サブグラフを NFT として表示するには、OpenSea のような NFT マーケットプレイスにアクセスします。 +サブグラフをNFTとして表示するには、OpenSeaのようなNFTマーケットプレイスにアクセスします。 ``` https://opensea.io/your-wallet-address @@ -26,7 +26,7 @@ https://rainbow.me/your-wallet-addres ## Transferring ownership of a subgraph -サブグラフの所有権を移転するには、Subgraph Studio に組み込まれた UI を使用します。 +サブグラフの所有権を移転するには、Subgraph Studioに組み込まれたUIを使用します。 ![サブグラフ所有権の移転](/img/subgraph-ownership-transfer-1.png) @@ -34,6 +34,6 @@ https://rainbow.me/your-wallet-addres ![サブグラフ所有権の移転](/img/subgraph-ownership-transfer-2.png) -また、OpenSea のような NFT のマーケットプレイスのビルトイン UI を利用することも可能です。 +また、OpenSeaのようなNFTのマーケットプレイスのビルトインUIを利用することも可能です。 ![NFTマーケットプレイスからのサブグラフ所有権移転](/img/subgraph-ownership-transfer-nft-marketplace.png) diff --git a/website/pages/ja/network/developing.mdx b/website/pages/ja/network/developing.mdx index 3a48fe3a9bf2..af9bde6290ce 100644 --- a/website/pages/ja/network/developing.mdx +++ b/website/pages/ja/network/developing.mdx @@ -2,7 +2,7 @@ title: 現像 --- -開発者は、The Graph のエコシステムの需要側である。開発者はサブグラフを構築し、それを The Graph Network に公開する。そして、アプリケーションを動かすために、GraphQL でサブグラフをクエリします。 +開発者は、The Graphのエコシステムの需要側である。開発者はサブグラフを構築し、それをThe Graph Networkに公開する。そして、アプリケーションを動かすために、GraphQLでサブグラフをクエリします。 ## サブグラフのライフサイクル @@ -20,34 +20,34 @@ title: 現像 ### Publish to the Network -開発者がサブグラフに満足したら、それをグラフネットワークに公開することができます。これはオンチェーンアクションであり、インデックス作成者が発見できるようにサブグラフを登録します。公開されたサブグラフは対応する NFT を持ち、これは簡単に転送できます。公開されたサブグラフには関連するメタデータがあり、他のネットワーク参加者に有用なコンテキストと情報を提供します。 +開発者がサブグラフに満足したら、それをグラフネットワークに公開することができます。これはオンチェーンアクションであり、インデックス作成者が発見できるようにサブグラフを登録します。公開されたサブグラフは対応するNFTを持ち、これは簡単に転送できます。公開されたサブグラフには関連するメタデータがあり、他のネットワーク参加者に有用なコンテキストと情報を提供します。 ### Signal to Encourage Indexing -公開されたサブグラフは、シグナルを追加しないとインデックス作成者に拾われにくいです。シグナルは、与えられたサブグラフに関連するロックされた GRT で、与えられたサブグラフがクエリー量を受け取ることをインデックス作成者に示し、またその処理に利用できるインデックス作成報酬に寄与します。サブグラフの開発者は、インデックス作成を促進するために、一般的にそのサブグラフにシグナルを追加する。サードパーティのキュレーターも、そのサブグラフがクエリ量を増加させると判断した場合、そのサブグラフにシグナルを追加することができます。 +公開されたサブグラフは、シグナルを追加しないとインデックス作成者に拾われにくいです。シグナルは、与えられたサブグラフに関連するロックされたGRTで、与えられたサブグラフがクエリー量を受け取ることをインデックス作成者に示し、またその処理に利用できるインデックス作成報酬に寄与します。サブグラフの開発者は、インデックス作成を促進するために、一般的にそのサブグラフにシグナルを追加する。サードパーティのキュレーターも、そのサブグラフがクエリ量を増加させると判断した場合、そのサブグラフにシグナルを追加することができます。 ### Querying & Application Development サブグラフがインデクサーによって処理され、クエリに使用できるようになると、開発者はアプリケーションでサブグラフの使用を開始できます。開発者は、サブグラフを処理したインデクサーにクエリを転送するゲートウェイを介してサブグラフにクエリを実行し、GRT でクエリ料金を支払います。 -クエリを実行するためには、Subgraph Studio で API キーを生成する必要があります。この API キーは、クエリフィーを支払うために GRT で資金を調達する必要があります。開発者は、コストを抑えるために、クエリ料金の上限を設定したり、API キーを特定のサブグラフやオリジン・ドメインに限定することができます。サブグラフ・スタジオは、開発者の API キー使用量に関するデータを提供します。 +クエリを実行するためには、Subgraph StudioでAPIキーを生成する必要があります。このAPIキーは、クエリフィーを支払うためにGRTで資金を調達する必要があります。開発者は、コストを抑えるために、クエリ料金の上限を設定したり、APIキーを特定のサブグラフやオリジン・ドメインに限定することができます。サブグラフ・スタジオは、開発者のAPIキー使用量に関するデータを提供します。 例えば、クエリのレスポンスが速いインデックスを優先したり、データが最新であるインデックスを優先したりすることができます。これらの制御は、Subgraph Studio で設定します。 ### Upgrading Subgraphs -サブグラフ開発者は、バグを修正したり、新しい機能を追加したりして、サブグラフを更新することができます。サブグラフの開発者は、サブグラフの新しいバージョンを Subgraph Studio にデプロイし、制限時間内に開発・テストすることができます。 +サブグラフ開発者は、バグを修正したり、新しい機能を追加したりして、サブグラフを更新することができます。サブグラフの開発者は、サブグラフの新しいバージョンをSubgraph Studioにデプロイし、制限時間内に開発・テストすることができます。 サブグラフ開発者は、アップグレードの準備ができたら、サブグラフを新しいバージョンに向けるためのトランザクションを開始します。サブグラフをアップグレードすると、あらゆるシグナルが新しいバージョンに移行します(シグナルを適用したユーザーが "auto-migrate "を選択したと仮定して)、このとき移行税も発生します。このシグナルの移行により、インデクサーは新しいバージョンのサブグラフのインデックス作成を開始し、すぐに問い合わせができるようになるはずです。 ### Deprecating Subgraphs -ある時点で、開発者は公開されたサブグラフが不要になったと判断することがあります。そのとき、開発者はサブグラフを非推奨とし、キュレータにシグナライズされた GRT を返します +ある時点で、開発者は公開されたサブグラフが不要になったと判断することがあります。そのとき、開発者はサブグラフを非推奨とし、キュレータにシグナライズされたGRTを返します ### Diverse Developer Roles -開発者の中には、ネットワーク上のサブグラフのライフサイクルに関与し、自分のサブグラフを公開し、クエリし、反復する者もいる。サブグラフの開発に重点を置き、他の人が構築できるオープンな API を構築する人もいます。また、アプリケーションに焦点を当て、他の人が配置したサブグラフをクエリすることもあります。 +開発者の中には、ネットワーク上のサブグラフのライフサイクルに関与し、自分のサブグラフを公開し、クエリし、反復する者もいる。サブグラフの開発に重点を置き、他の人が構築できるオープンなAPIを構築する人もいます。また、アプリケーションに焦点を当て、他の人が配置したサブグラフをクエリすることもあります。 ### Developers and Network Economics -開発者はネットワークにおける重要な経済的アクターであり、インデックス作成を促進するために GRT をロックし、ネットワークの主要な価値交換であるサブグラフのクエリを重要視しています。サブグラフ開発者はまた、サブグラフがアップグレードされるたびに GRT をバーンします。 +開発者はネットワークにおける重要な経済的アクターであり、インデックス作成を促進するためにGRTをロックし、ネットワークの主要な価値交換であるサブグラフのクエリを重要視しています。サブグラフ開発者はまた、サブグラフがアップグレードされるたびにGRTをバーンします。 diff --git a/website/pages/ja/network/explorer.mdx b/website/pages/ja/network/explorer.mdx index 0a2a386d7e49..b3e7dd19121d 100644 --- a/website/pages/ja/network/explorer.mdx +++ b/website/pages/ja/network/explorer.mdx @@ -87,7 +87,7 @@ Subgraph Studio でサブグラフを公開すると、ナビゲーション バ - 現在プロトコルに保持している GRT 総量 - 最後にデリゲートした日 -デリゲーターになるための方法をもっと知りたい方は、ぜひご覧ください。 [official documentation](/network/delegating) や [The Graph Academy](https://docs.thegraph.academy/network/delegators)にアクセスしてください。 +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## ネットワーク diff --git a/website/pages/ja/operating-graph-node.mdx b/website/pages/ja/operating-graph-node.mdx index a9ad3348560f..7d05f2dcfbea 100644 --- a/website/pages/ja/operating-graph-node.mdx +++ b/website/pages/ja/operating-graph-node.mdx @@ -2,7 +2,7 @@ title: オペレーティンググラフノード --- -グラフノードはサブグラフのインデックスを作成し、得られたデータを GraphQL API 経由でクエリできるようにするコンポーネントです。そのため、インデクサースタックの中心的存在であり、グラフノードの正しい動作はインデクサーを成功させるために非常に重要です。 +グラフノードはサブグラフのインデックスを作成し、得られたデータをGraphQL API経由でクエリできるようにするコンポーネントです。そのため、インデクサースタックの中心的存在であり、グラフノードの正しい動作はインデクサーを成功させるために非常に重要です。 これは、グラフノードの文脈的な概要と、インデクサーに利用可能なより高度なオプションのいくつかを提供します。詳細なドキュメントと説明は [Graph Node リポジトリ](https://github.com/graphprotocol/graph-node)で見ることができます。 @@ -10,11 +10,11 @@ title: オペレーティンググラフノード [Graph Node](https://github.com/graphprotocol/graph-node)は、グラフネットワーク上のサブグラフにインデックスを付け、ブロックチェーンクライアントに接続し、サブグラフにインデックスを付け、インデックス付けしたデータをクエリで利用できるようにするためのリファレンス実装です。 -グラフノード(およびインデクサスタック全体)は、ベアメタルでもクラウド環境でも実行可能です。中央のインデックス作成コンポーネントのこの柔軟性は、グラフプロトコルの堅牢性にとって非常に重要です。同様に、グラフノードは[ソースからビルドすることができ](https://github.com/graphprotocol/graph-node)、インデクサーは[提供された Docker Image](https://hub.docker.com/r/graphprotocol/graph-node)の 1 つを使用することができます。また +グラフノード(およびインデクサスタック全体)は、ベアメタルでもクラウド環境でも実行可能です。中央のインデックス作成コンポーネントのこの柔軟性は、グラフプロトコルの堅牢性にとって非常に重要です。同様に、グラフノードは[ソースからビルドすることができ](https://github.com/graphprotocol/graph-node)、インデクサーは[提供されたDocker Image](https://hub.docker.com/r/graphprotocol/graph-node)の1つを使用することができます。また -### PostgreSQL データベース +### PostgreSQLデータベース -グラフノードのメインストアで、サブグラフデータ、サブグラフに関するメタデータ、ブロックキャッシュや eth_call キャッシュなどのサブグラフに依存しないネットワークデータが格納されます。 +グラフノードのメインストアで、サブグラフデータ、サブグラフに関するメタデータ、ブロックキャッシュやeth_callキャッシュなどのサブグラフに依存しないネットワークデータが格納されます。 ### ネットワーククライアント @@ -24,13 +24,13 @@ title: オペレーティンググラフノード **近日公開です。Network Firehoses** - Firehose は、順序付けられた、しかしフォークを意識したブロックのストリームを提供する gRPC サービスで、The Graph のコア開発者により、大規模で高性能なインデックス作成をより良くサポートするために開発されました。これは現在、インデクサーの要件ではありませんが、インデクサーは、ネットワークの完全サポートに先立って、この技術に慣れることが推奨されています。Firehose の詳細については、[こちら](https://firehose.streamingfast.io/)を参照してください。 -### IPFS ノード +### IPFSノード -IPFS ノード(バージョン 未満) - サブグラフのデプロイメタデータは IPFS ネットワーク上に保存されます。 グラフノードは、サブグラフのデプロイ時に主に IPFS ノードにアクセスし、サブグラフマニフェストと全てのリンクファイルを取得します。 ネットワーク・インデクサーは独自の IPFS ノードをホストする必要はありません。 ネットワーク用の IPFS ノードは、https://ipfs.network.thegraph.com でホストされています。 +IPFS ノード(バージョン 未満) - サブグラフのデプロイメタデータは IPFS ネットワーク上に保存されます。 グラフノードは、サブグラフのデプロイ時に主に IPFS ノードにアクセスし、サブグラフマニフェストと全てのリンクファイルを取得します。 ネットワーク・インデクサーは独自の IPFS ノードをホストする必要はありません。 ネットワーク用の IPFS ノードは、https://ipfs.network.thegraph.com でホストされています。 ### Prometheus メトリクスサーバー -監視とレポート作成を可能にするため、Graph Node はオプションで Prometheus のメトリクスサーバーにメトリクスを記録することができます。 +監視とレポート作成を可能にするため、Graph NodeはオプションでPrometheusのメトリクスサーバーにメトリクスを記録することができます。 ### ソースからのスタート @@ -96,21 +96,21 @@ cd graph-node/docker docker-compose up ``` -### Kubernetes を始めるにあたって +### Kubernetesを始めるにあたって -Kubernetes の完全な設定例は、[indexer リポジトリ](https://github.com/graphprotocol/indexer/tree/main/k8s)で見ることができます。 +Kubernetesの完全な設定例は、[indexerリポジトリ](https://github.com/graphprotocol/indexer/tree/main/k8s)で見ることができます。 ### Port グラフノードは起動時に以下のポートを公開します。 -| Port | Purpose | Routes | CLI Argument | Environment Variable | -| --- | --- | --- | --- | --- | -| 8000 | GraphQL HTTP server
    (for subgraph queries) | /subgraphs/id/...
    /subgraphs/name/.../... | --http-port | - | -| 8001 | GraphQL WS
    (for subgraph subscriptions) | /subgraphs/id/...
    /subgraphs/name/.../... | --ws-port | - | -| 8020 | JSON-RPC
    (for managing deployments) | / | --admin-port | - | -| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | -| 8040 | Prometheus metrics | /metrics | --metrics-port | - | +| Port | Purpose | Routes | CLI Argument | Environment Variable | +| ---- | ------------------------------------------------------- | ------------------------------------------------------ | ----------------- | -------------------- | +| 8000 | GraphQL HTTP server
    (for subgraph queries) | /subgraphs/id/...
    /subgraphs/name/.../... | --http-port | - | +| 8001 | GraphQL WS
    (for subgraph subscriptions) | /subgraphs/id/...
    /subgraphs/name/.../... | --ws-port | - | +| 8020 | JSON-RPC
    (for managing deployments) | / | --admin-port | - | +| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | +| 8040 | Prometheus metrics | /metrics | --metrics-port | - | > **重要**: ポートを公に公開する場合は注意してください。**管理ポート**はロックしておく必要があります。ノードの JSON-RPC エンドポイント @@ -126,7 +126,7 @@ Kubernetes の完全な設定例は、[indexer リポジトリ](https://github.c > 設定ファイルを使用する場合、-postgres-url、-postgres-secondary-hosts、および --postgres-host-weights オプションを使用することはできません。 -最小限の`config.toml`ファイルを提供することができます。以下のファイルは、-postgres-url コマンドラインオプションを使用することと同等です。 +最小限の`config.toml`ファイルを提供することができます。以下のファイルは、-postgres-urlコマンドラインオプションを使用することと同等です。 ```toml [store] @@ -143,7 +143,7 @@ indexers = [ "<.. list of all indexing nodes ..>" ] Graph Node indexing can scale horizontally, running multiple instances of Graph Node to split indexing and querying across different nodes. This can be done simply by running Graph Nodes configured with a different `node_id` on startup (e.g. in the Docker Compose file), which can then be used in the `config.toml` file to specify [dedicated query nodes](#dedicated-query-nodes), [block ingestors](#dedicated-block-ingestor), and splitting subgraphs across nodes with [deployment rules](#deployment-rules). -> なお、複数の Graph Node はすべて同じデータベースを使用するように設定することができ、Sharding によって水平方向に拡張することができます。 +> なお、複数のGraph Nodeはすべて同じデータベースを使用するように設定することができ、Shardingによって水平方向に拡張することができます。 #### デプロイメントルール @@ -192,21 +192,21 @@ query = "" #### シャーディングによるデータベースのスケーリング -ほとんどの場合、1 つの Postgres データベースでグラフノードインスタンスをサポートするのに十分です。グラフノードインスタンスが 1 つの Postgres データベースを使い切った場合、グラフノードデータを複数の Postgres データベースに分割して保存することが可能です。全てのデータベースが一緒になってグラフノードインスタンスのストアを形成します。個々のデータベースはシャード(shard)と呼ばれます。 +ほとんどの場合、1つのPostgresデータベースでグラフノードインスタンスをサポートするのに十分です。グラフノードインスタンスが1つのPostgresデータベースを使い切った場合、グラフノードデータを複数のPostgresデータベースに分割して保存することが可能です。全てのデータベースが一緒になってグラフノードインスタンスのストアを形成します。個々のデータベースはシャード(shard)と呼ばれます。 シャードは、サブグラフを複数のデータベースに分割するために使用することができ、また、データベース間でクエリの負荷を分散するためにレプリカを使用することができます。これには、各 `graph-node` が各データベースの接続プールに保持すべき、利用可能なデータベース接続の数の設定が含まれ、これはより多くのサブグラフがインデックス化されるにつれて、ますます重要になります。 グラフノードの負荷に既存のデータベースが追いつかず、これ以上データベースサイズを大きくすることができない場合に、シャーディングが有効になります。 -> 一般的には、シャードを作成する前に、単一のデータベースを可能な限り大きくすることをお勧めします。例外は、クエリのトラフィックがサブグラフ間で非常に不均一に分割される場合です。このような状況では、ボリュームの大きいサブグラフを 1 つのシャードに、それ以外を別のシャードに保存すると劇的に効果があります。この設定により、ボリュームの大きいサブグラフのデータが db 内部キャッシュに残り、ボリュームの小さいサブグラフからそれほど必要とされていないデータに置き換えられる可能性が少なくなるためです。 +> 一般的には、シャードを作成する前に、単一のデータベースを可能な限り大きくすることをお勧めします。例外は、クエリのトラフィックがサブグラフ間で非常に不均一に分割される場合です。このような状況では、ボリュームの大きいサブグラフを1つのシャードに、それ以外を別のシャードに保存すると劇的に効果があります。この設定により、ボリュームの大きいサブグラフのデータがdb内部キャッシュに残り、ボリュームの小さいサブグラフからそれほど必要とされていないデータに置き換えられる可能性が少なくなるためです。 -接続の設定に関しては、まず postgresql.conf の max_connections を 400(あるいは 200)に設定し、store_connection_wait_time_ms と store_connection_checkout_count Prometheus メトリクスを見てみてください。顕著な待ち時間(5ms 以上)は、利用可能な接続が少なすぎることを示しています。高い待ち時間は、データベースが非常に忙しいこと(CPU 負荷が高いなど)によっても引き起こされます。しかし、データベースが安定しているようであれば、待ち時間が長いのは接続数を増やす必要があることを示しています。設定上、各グラフノードインスタンスが使用できるコネクション数は上限であり、グラフノードは必要ないコネクションはオープンにしておきません。 +接続の設定に関しては、まずpostgresql.confのmax_connectionsを400(あるいは200)に設定し、store_connection_wait_time_msとstore_connection_checkout_count Prometheusメトリクスを見てみてください。顕著な待ち時間(5ms以上)は、利用可能な接続が少なすぎることを示しています。高い待ち時間は、データベースが非常に忙しいこと(CPU負荷が高いなど)によっても引き起こされます。しかし、データベースが安定しているようであれば、待ち時間が長いのは接続数を増やす必要があることを示しています。設定上、各グラフノードインスタンスが使用できるコネクション数は上限であり、グラフノードは必要ないコネクションはオープンにしておきません。 ストアコンフィギュレーションについて詳しくは[こちら](https://github.com/graphprotocol/graph-node/blob/master/docs/config.md#configuring-multiple-databases)をご覧ください。 #### 専用ブロックインジェスト -複数のノードが設定されている場合、設定されているすべてのインデックスノードがチェーンヘッドをポーリングしないように、新しいブロックの取り込みに責任を持つノードを 1 つ指定する必要があります。これは `chains` 名前空間の一部として行われ、ブロックの取り込みに使われる `node_id` を指定します。 +複数のノードが設定されている場合、設定されているすべてのインデックスノードがチェーンヘッドをポーリングしないように、新しいブロックの取り込みに責任を持つノードを1つ指定する必要があります。これは `chains` 名前空間の一部として行われ、ブロックの取り込みに使われる `node_id` を指定します。 ```toml [chains] @@ -215,13 +215,13 @@ ingestor = "block_ingestor_node" #### 複数のネットワークに対応 -Graph Protocol は、インデックス作成報酬のためにサポートされるネットワークの数を増やしており、インデックス作成者が処理したいと思うサポートされていないネットワークをインデックスしたサブグラフが多く存在します。`config.toml` ファイルは、表現力豊かで柔軟な設定を可能にします。 +Graph Protocolは、インデックス作成報酬のためにサポートされるネットワークの数を増やしており、インデックス作成者が処理したいと思うサポートされていないネットワークをインデックスしたサブグラフが多く存在します。`config.toml` ファイルは、表現力豊かで柔軟な設定を可能にします。 - 複数のネットワーク -- ネットワークごとに複数のプロバイダ(プロバイダ間で負荷を分割することができ、また、フルノードとアーカイブノードを構成することができ、作業負荷が許す限り、Graph Node はより安価なプロバイダを優先することができます)。 -- 機能、認証、プロバイダの種類など、プロバイダの詳細(実験的な Firehose のサポートのため) +- ネットワークごとに複数のプロバイダ(プロバイダ間で負荷を分割することができ、また、フルノードとアーカイブノードを構成することができ、作業負荷が許す限り、Graph Nodeはより安価なプロバイダを優先することができます)。 +- 機能、認証、プロバイダの種類など、プロバイダの詳細(実験的なFirehoseのサポートのため) -`[chains]`セクションは、graph-node が接続するイーサリアムプロバイダーと、各チェーンのブロックや他のメタデータが格納される場所を制御します。次の例では、mainnet と kovan の 2 つのチェーンを設定し、mainnet のブロックは vip シャードに、kovan のブロックは primary シャードに格納されます。mainnet チェーンでは 2 つの異なるプロバイダを使用できますが、kovan チェーンではプロバイダは 1 つだけです。 +`[chains]`セクションは、graph-nodeが接続するイーサリアムプロバイダーと、各チェーンのブロックや他のメタデータが格納される場所を制御します。次の例では、mainnet と kovan の 2 つのチェーンを設定し、mainnet のブロックは vip シャードに、kovan のブロックは primary シャードに格納されます。mainnet チェーンでは 2 つの異なるプロバイダを使用できますが、kovan チェーンではプロバイダは 1 つだけです。 ```toml [chains] @@ -247,8 +247,8 @@ provider = [ { label = "kovan", url = "http://..", features = [] } ] 高度な構成でスケーリングされたインデックス作成セットアップを運用しているユーザーは、Kubernetes を使用してグラフ ノードを管理することでメリットが得られる場合があります。 -- インデクサーリポジトリには、[Kubernetes リファレンス例](https://github.com/graphprotocol/indexer/tree/main/k8s)があります。 -- [Launchpad](https://docs.graphops.xyz/launchpad/intro) は、GraphOps が管理する Kubernetes 上で Graph Protocol Indexer を動作させるためのツールキットです。グラフノードのデプロイを管理するための Helm チャートのセットと CLI を提供します。 +- インデクサーリポジトリには、[Kubernetesリファレンス例](https://github.com/graphprotocol/indexer/tree/main/k8s)があります。 +- [Launchpad](https://docs.graphops.xyz/launchpad/intro) は、GraphOps が管理する Kubernetes 上で Graph Protocol Indexer を動作させるためのツールキットです。グラフノードのデプロイを管理するためのHelmチャートのセットとCLIを提供します。 ### グラフノードの管理 @@ -256,35 +256,35 @@ provider = [ { label = "kovan", url = "http://..", features = [] } ] #### ロギング -グラフノードのログは、グラフノードと特定のサブグラフのデバッグと最適化に役立つ情報を提供します。グラフノード e は、`GRAPH_LOG`環境変数によって、以下のレベルで、異なるログレベルをサポートします:エラー、警告、情報、デバッグ、トレース。 +グラフノードのログは、グラフノードと特定のサブグラフのデバッグと最適化に役立つ情報を提供します。グラフノードeは、`GRAPH_LOG`環境変数によって、以下のレベルで、異なるログレベルをサポートします:エラー、警告、情報、デバッグ、トレース。 -さらに、`GRAPH_LOG_QUERY_TIMING`を`gql`に設定すると、GraphQL クエリの実行方法についてより詳細に知ることができます(ただし、これは大量のログを生成することになります)。 +さらに、`GRAPH_LOG_QUERY_TIMING`を`gql`に設定すると、GraphQLクエリの実行方法についてより詳細に知ることができます(ただし、これは大量のログを生成することになります)。 #### モニタリングとアラート& -グラフノードは、デフォルトで 8040 ポートの Prometheus エンドポイント経由でメトリクスを提供します。そして、Grafana を使用してこれらのメトリクスを可視化することができます。 +グラフノードは、デフォルトで8040ポートのPrometheusエンドポイント経由でメトリクスを提供します。そして、Grafanaを使用してこれらのメトリクスを可視化することができます。 -インデクサーリポジトリでは、[Grafana の設定例](https://github.com/graphprotocol/indexer/blob/main/k8s/base/grafana.yaml)が提供されています。 +インデクサーリポジトリでは、[Grafanaの設定例](https://github.com/graphprotocol/indexer/blob/main/k8s/base/grafana.yaml)が提供されています。 #### Graphman `graphman`はグラフノードのメンテナンスツールで、日常的なタスクや例外的なタスクの診断と解決を支援します。 -graphman コマンドは公式コンテナに含まれており、グラフノードコンテナに docker exec することで実行できます。その際、`config.toml` ファイルが必要になります。 +graphmanコマンドは公式コンテナに含まれており、グラフノードコンテナにdocker execすることで実行できます。その際、`config.toml` ファイルが必要になります。 `graphman` コマンドの完全なドキュメントは グラフノードリポジトリにあります。グラフノードの `/docs` にある \[/docs/graphman.md\] (https://github.com/graphprotocol/graph-node/blob/master/docs/graphman.md) を参照してください。 ### サブグラフの操作 -#### インデックスステータス API +#### インデックスステータスAPI -デフォルトではポート 8030/graphql で利用可能な indexing status API は、異なるサブグラフの indexing status のチェック、indexing proof のチェック、サブグラフの特徴の検査など、様々なメソッドを公開しています。 +デフォルトではポート8030/graphqlで利用可能なindexing status APIは、異なるサブグラフのindexing statusのチェック、indexing proofのチェック、サブグラフの特徴の検査など、様々なメソッドを公開しています。 完全なスキーマは[こちら](https://github.com/graphprotocol/graph-node/blob/master/server/index-node/src/schema.graphql)から入手可能です。 #### インデックスのパフォーマンス -インデックス作成は、3 つのパートに分かれています: +インデックス作成は、3つのパートに分かれています: - プロバイダから興味のあるイベントを取得 - 適切なハンドラで順番にイベントを処理する(これには、状態のためにチェーンを呼び出したり、ストアからデータを取得したりすることが含まれます)。 @@ -307,7 +307,7 @@ graphman コマンドは公式コンテナに含まれており、グラフノ #### 失敗したサブグラフ -インデックス作成中、サブグラフは予期しないデータに遭遇したり、あるコンポーネントが期待通りに動作しなかったり、イベントハンドラや設定に何らかのバグがあったりすると、失敗することがあります。失敗には一般に 2 つのタイプがあります。 +インデックス作成中、サブグラフは予期しないデータに遭遇したり、あるコンポーネントが期待通りに動作しなかったり、イベントハンドラや設定に何らかのバグがあったりすると、失敗することがあります。失敗には一般に2つのタイプがあります。 - 決定論的失敗:再試行では解決できない失敗 - 非決定論的失敗:プロバイダの問題や、予期しないグラフノードのエラーに起因する可能性があります。非決定論的失敗が発生すると、グラフノードは失敗したハンドラを再試行し、時間をかけて後退させます。 @@ -322,7 +322,7 @@ graphman コマンドは公式コンテナに含まれており、グラフノ However, in some instances, if an Ethereum node has provided incorrect data for some period, that can make its way into the cache, leading to incorrect data or failed subgraphs. In this case indexers can use `graphman` to clear the poisoned cache, and then rewind the affected subgraphs, which will then fetch fresh data from the (hopefully) healthy provider. -TX 受信欠落イベントなど、ブロックキャッシュの不整合が疑われる場合。 +TX受信欠落イベントなど、ブロックキャッシュの不整合が疑われる場合。 1. `graphman chain list`でチェーン名を検索します。 2. `graphman chain check-blocks by-number ` は、キャッシュされたブロックがプロバイダにマッチするかをチェックし、マッチしない場合はキャッシュからブロックを削除します。 @@ -343,7 +343,7 @@ However, even with a dedicated query node and replicas, certain queries can take ##### クエリの分析 -問題のあるクエリが表面化するのは、ほとんどの場合、次の 2 つの方法のどちらかです。あるケースでは、ユーザー自身があるクエリが遅いと報告します。この場合、一般的な問題なのか、そのサブグラフやクエリに固有の問題なのか、遅さの理由を診断することが課題となります。そしてもちろん、可能であればそれを解決することです。 +問題のあるクエリが表面化するのは、ほとんどの場合、次の2つの方法のどちらかです。あるケースでは、ユーザー自身があるクエリが遅いと報告します。この場合、一般的な問題なのか、そのサブグラフやクエリに固有の問題なのか、遅さの理由を診断することが課題となります。そしてもちろん、可能であればそれを解決することです。 また、クエリノードでメモリ使用量が多いことが引き金になる場合もあり、その場合は、まず問題の原因となっているクエリを特定することが課題となります。 @@ -353,20 +353,20 @@ However, even with a dedicated query node and replicas, certain queries can take ##### アカウントライクな最適化 -エンティティを格納するデータベーステーブルには、一般に 2 つの種類があるようです。エンティティは一度作成されると更新されない「トランザクションライク」なもの、 つまり金融取引のリストのようなものを格納するものと、エンティティが頻繁に更新される「アカウント ライク」なもの、つまり取引が記録されるたびに変更される金融口座のようなものを格納するものである。口座のようなテーブルの特徴は、多くのバージョンの実体を含むが、異なる実体は 比較的少ないということである。このようなテーブルでは、別個のエンティティの数は行(エンティティバージョン)の総数の 1%であることがよくある。 +エンティティを格納するデータベーステーブルには、一般に2つの種類があるようです。エンティティは一度作成されると更新されない「トランザクションライク」なもの、 つまり金融取引のリストのようなものを格納するものと、エンティティが頻繁に更新される「アカウント ライク」なもの、つまり取引が記録されるたびに変更される金融口座のようなものを格納するものである。口座のようなテーブルの特徴は、多くのバージョンの実体を含むが、異なる実体は 比較的少ないということである。このようなテーブルでは、別個のエンティティの数は行(エンティティバージョン)の総数の1%であることがよくある。 -アカウントライクテーブルでは、`graph-node`は、Postgres がどのように高い変更率でデータを保存することになるかの詳細、つまり、最近のブロックのすべてのバージョンがそのテーブルのストレージ全体の小さなサブセクションにあるということを利用したクエリを生成することができます。 +アカウントライクテーブルでは、`graph-node`は、Postgresがどのように高い変更率でデータを保存することになるかの詳細、つまり、最近のブロックのすべてのバージョンがそのテーブルのストレージ全体の小さなサブセクションにあるということを利用したクエリを生成することができます。 コマンド `graphman stats show 展開内の各エンティティ タイプ/テーブルについて、個別のエンティティの数と、各テーブルに含まれるエンティティ バージョンの数を示します。このデータは Postgres 内部の見積もりに基づいているため、必然的に不正確であり、桁違いにずれている可能性があります。 `entities` 列の `-1` は、すべての行に別個のエンティティが含まれていると Postgres が認識していることを意味します。 -一般に、別個の実体の数が行/実体のバージョンの総数の 1%未満であるテーブルは、アカウントのような最適化の良い候補になります。`graphman stats show`の出力が、テーブルがこの最適化によって恩恵を受けるかもしれないことを示す場合、`graphman stats show ` はテーブルをフルカウントし、遅いかもしれませんが、全体のエンティティバージョンに対する distinct entities の比率を正確に測定することができます。 +一般に、別個の実体の数が行/実体のバージョンの総数の1%未満であるテーブルは、アカウントのような最適化の良い候補になります。`graphman stats show`の出力が、テーブルがこの最適化によって恩恵を受けるかもしれないことを示す場合、`graphman stats show
    ` はテーブルをフルカウントし、遅いかもしれませんが、全体のエンティティバージョンに対するdistinct entitiesの比率を正確に測定することができます。 -一旦テーブルがアカウントライクであると決定されると、`graphman stats account-like .
    ` を実行すると、そのテーブルに対するクエリのためにアカウントライクの最適化がオンになります。最適化は、`graphman stats account-like --clear .
    ` で再びオフにすることができます。最適化がオンまたはオフになったことにクエリノードが気付くまで、最大で 5 分間かかります。最適化をオンにした後、その変更によって実際にそのテーブルのクエリが遅くならないことを確認する必要があります。Postgres を監視するように Grafana を構成している場合、遅いクエリは `pg_stat_activity` に大量に表示され、数秒かかることになるはずです。その場合、最適化を再度オフにする必要があります。 +一旦テーブルがアカウントライクであると決定されると、`graphman stats account-like .
    ` を実行すると、そのテーブルに対するクエリのためにアカウントライクの最適化がオンになります。最適化は、`graphman stats account-like --clear .
    ` で再びオフにすることができます。最適化がオンまたはオフになったことにクエリノードが気付くまで、最大で5分間かかります。最適化をオンにした後、その変更によって実際にそのテーブルのクエリが遅くならないことを確認する必要があります。Postgres を監視するように Grafana を構成している場合、遅いクエリは `pg_stat_activity` に大量に表示され、数秒かかることになるはずです。その場合、最適化を再度オフにする必要があります。 Uniswap のようなサブグラフの場合、`pair` および `token` テーブルがこの最適化の最有力候補であり、データベースの負荷に劇的な影響を与える可能性があります。 #### サブグラフの削除 -> これは新しい機能で、Graph Node 0.29.x で利用可能になる予定です。 +> これは新しい機能で、Graph Node 0.29.xで利用可能になる予定です。 ある時点で、インデクサーは与えられたサブグラフを削除したいと思うかもしれません。これは、`graphman drop` によって簡単に行えます。これは、配置とそのインデックスされたデータを全て削除します。配置はサブグラフ名、IPFS ハッシュ `Qm..` またはデータベース名前空間 `sgdNNN` として指定することができます。詳しいドキュメントは、[こちら](https://github.com/graphprotocol/graph-node/blob/master/docs/graphman.md#-drop)にあります。 diff --git a/website/pages/ja/publishing/publishing-a-subgraph.mdx b/website/pages/ja/publishing/publishing-a-subgraph.mdx index 846ba7bd97b0..92a0f48caf98 100644 --- a/website/pages/ja/publishing/publishing-a-subgraph.mdx +++ b/website/pages/ja/publishing/publishing-a-subgraph.mdx @@ -22,9 +22,9 @@ title: 分散型ネットワークへのサブグラフの公開 ## Curating your subgraph -> 10,000GRT のサブグラフは、できるだけ早くインデックス化され、クエリに利用できるように、自分でキュレーションすることが推奨されます。 +> 10,000GRTのサブグラフは、できるだけ早くインデックス化され、クエリに利用できるように、自分でキュレーションすることが推奨されます。 -Subgraph Studio では、同じトランザクションで GRT をサブグラフのキュレーションプールに追加することにより、サブグラフを最初にキュレーションすることができます。サブグラフを公開する際には、"Be the first to signal on this subgraph "というボタンにチェックを入れてください。 +Subgraph Studioでは、同じトランザクションでGRTをサブグラフのキュレーションプールに追加することにより、サブグラフを最初にキュレーションすることができます。サブグラフを公開する際には、"Be the first to signal on this subgraph "というボタンにチェックを入れてください。 ![キュレーションプール](/img/curate-own-subgraph-tx.png) diff --git a/website/pages/ja/querying/graphql-api.mdx b/website/pages/ja/querying/graphql-api.mdx index 1bf1535f5daf..ad09087c3afa 100644 --- a/website/pages/ja/querying/graphql-api.mdx +++ b/website/pages/ja/querying/graphql-api.mdx @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| シンボル | オペレーター | 説明書き | -| --- | --- | --- | -| `&` | `と` | 複数の検索語を組み合わせて、指定したすべての検索語を含むエンティティをフィルタリングします。 | -| | | `Or` | 複数の検索語をオペレーターで区切って検索すると、指定した語のいずれかにマッチするすべてのエンティティが返されます。 | -| `<->` | `Follow by` | 2 つの単語の間の距離を指定します。 | -| `:*` | `プレフィックス` | プレフィックス検索語を使って、プレフィックスが一致する単語を検索します(2 文字必要) | +| シンボル | オペレーター | 説明書き | +| ----------- | ----------- | --------------------------------------------------------- | +| `&` | `と` | 複数の検索語を組み合わせて、指定したすべての検索語を含むエンティティをフィルタリングします。 | +| | | `Or` | 複数の検索語をオペレーターで区切って検索すると、指定した語のいずれかにマッチするすべてのエンティティが返されます。 | +| `<->` | `Follow by` | 2 つの単語の間の距離を指定します。 | +| `:*` | `プレフィックス` | プレフィックス検索語を使って、プレフィックスが一致する単語を検索します(2 文字必要) | #### Examples @@ -414,6 +414,6 @@ If a block is provided, the metadata is as of that block, if not the latest inde - hash: ブロックのハッシュ - number: ブロック番号 -- timestamp: 可能であれば、ブロックのタイムスタンプ (これは現在、EVM ネットワークのインデックスを作成するサブグラフでのみ利用可能) +- timestamp: 可能であれば、ブロックのタイムスタンプ (これは現在、EVMネットワークのインデックスを作成するサブグラフでのみ利用可能) `hasIndexingErrors` is a boolean identifying whether the subgraph encountered indexing errors at some past block diff --git a/website/pages/ja/release-notes/graphql-validations-migration-guide.mdx b/website/pages/ja/release-notes/graphql-validations-migration-guide.mdx index c35df34ff9b9..4712fb1fb7e6 100644 --- a/website/pages/ja/release-notes/graphql-validations-migration-guide.mdx +++ b/website/pages/ja/release-notes/graphql-validations-migration-guide.mdx @@ -40,9 +40,9 @@ npx @graphql-validate/cli -s https://api-next.thegraph.com/subgraphs/name/$GITHU **Notes:** -- Set or replace $GITHUB_USER, $SUBGRAPH_NAME with the appropriate values. Like: [`artblocks/art-blocks`](https://api.thegraph.com/subgraphs/name/artblocks/art-blocks) -- The preview schema URL (https://api-next.thegraph.com/) provided is heavily rate-limited and will be sunset once all users have migrated to the new version. **Do not use it in production.** -- Operations are identified in files with the following extensions [`.graphql`,](https://www.graphql-tools.com/docs/schema-loading#graphql-file-loader)[`.ts`, `.tsx`, `.js`, `jsx`](https://www.graphql-tools.com/docs/schema-loading#code-file-loader) (`-o` option). +- Set or replace $GITHUB_USER, $SUBGRAPH_NAME with the appropriate values. Like: [`artblocks/art-blocks`](https://api.thegraph.com/subgraphs/name/artblocks/art-blocks) +- The preview schema URL (https://api-next.thegraph.com/) provided is heavily rate-limited and will be sunset once all users have migrated to the new version. **Do not use it in production.** +- Operations are identified in files with the following extensions [`.graphql`,](https://www.graphql-tools.com/docs/schema-loading#graphql-file-loader)[`.ts`, `.tsx`, `.js`, `jsx`](https://www.graphql-tools.com/docs/schema-loading#code-file-loader) (`-o` option). ### CLI output @@ -58,11 +58,11 @@ We provide an endpoint `https://api-next.thegraph.com/` that runs a `graph-node` You can try out queries by sending them to: -- `https://api-next.thegraph.com/subgraphs/id/` +- `https://api-next.thegraph.com/subgraphs/id/` または -- `https://api-next.thegraph.com/subgraphs/name//` +- `https://api-next.thegraph.com/subgraphs/name//` To work on queries that have been flagged as having validation errors, you can use your favorite GraphQL query tool, like Altair or [GraphiQL](https://cloud.hasura.io/public/graphiql), and try your query out. Those tools will also mark those errors in their UI, even before you run it. @@ -362,8 +362,8 @@ query something { Also, a GraphQL field selection is only valid if the following is validated: -- An object field must-have selection set specified. -- An edge field (scalar, enum) must not have a selection set specified. +- An object field must-have selection set specified. +- An edge field (scalar, enum) must not have a selection set specified. Here are a few examples of violations of these rules with the following Schema: @@ -463,8 +463,8 @@ The GraphQL API will raise an error if any unknown type, variable, fragment, or Those unknown references must be fixed: -- rename if it was a typo -- otherwise, remove +- rename if it was a typo +- otherwise, remove ### Fragment: invalid spread or definition diff --git a/website/pages/ja/substreams/[[...slug]].mdx b/website/pages/ja/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/ja/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/ja/tokenomics.mdx b/website/pages/ja/tokenomics.mdx index c1e302d4e689..214e60c950fd 100644 --- a/website/pages/ja/tokenomics.mdx +++ b/website/pages/ja/tokenomics.mdx @@ -13,15 +13,15 @@ B2B2C モデルに似ていますが、参加者の分散型ネットワーク The Graph を使用することで、ユーザーはブロックチェーンのデータに簡単にアクセスでき、必要な特定の情報に対してのみ料金を支払うことができます。グラフは、今日の web3 エコシステムの多くの[人気のあるアプリケーション](https://thegraph.com/explorer)で使用されています。 -The Graph は、Google がウェブをインデックスするのと同様に、ブロックチェーンデータをインデックスします。実際、あなたは気づかないうちにすでに The Graph を利用しているかもしれません。サブグラフからデータを取得するダップのフロントエンドを見たことがあるなら、サブグラフからデータを照会したことになります。 +The Graphは、Googleがウェブをインデックスするのと同様に、ブロックチェーンデータをインデックスします。実際、あなたは気づかないうちにすでにThe Graphを利用しているかもしれません。サブグラフからデータを取得するダップのフロントエンドを見たことがあるなら、サブグラフからデータを照会したことになります。 グラフは、ブロックチェーンのデータをより身近なものにし、その交換のためのマーケットプレイスを実現するという重要な役割を担っています。 ## The Roles of Network Participants -主なネットワーク参加者は 4 つの種類があります: +主なネットワーク参加者は4つの種類があります: -1. デリゲーター - GRT をインデクサーに委任する & ネットワークを確保する +1. デリゲーター - GRTをインデクサーに委任する & ネットワークを確保する 2. キュレーター - インデクサーのために最適なサブグラフを見つける。 @@ -37,73 +37,73 @@ The Graph は、Google がウェブをインデックスするのと同様に、 インデクサーは、ネットワーク上のサブグラフでインデクサーのステークを増やす委任者によって GRT を委任されます。その見返りとして、委任者はすべてのクエリ料金とインデクサーからのインデックス作成報酬の一定の割合を獲得します。各インデクサーは、委任者に報いるカットを個別に設定し、委任者を引き付けるためにインデクサー間の競争を生み出します。ほとんどのインデクサーは、年間 9 ~ 12% のオファーを提供しています -例えば、デリゲーターが 10%の報酬を提供するインデクサーに 15000GRT を委任した場合、委任者は年間 1500GRT の報酬を受け取ることになります。 +例えば、デリゲーターが10%の報酬を提供するインデクサーに15000GRTを委任した場合、委任者は年間1500GRTの報酬を受け取ることになります。 -0.5%のデリゲーター税は、デリゲーターがネットワーク上で GRT を委任するたびにバーンされます。デリゲーターが委任された GRT を撤回する場合、デリゲーターは 28 エポックのアンボンド期間を待つ必要があります。各エポックは 6,646 ブロックであり、28 エポックは約 26 日間になります。 +0.5%のデリゲーター税は、デリゲーターがネットワーク上でGRTを委任するたびにバーンされます。デリゲーターが委任されたGRTを撤回する場合、デリゲーターは28エポックのアンボンド期間を待つ必要があります。各エポックは6,646ブロックであり、28エポックは約26日間になります。 -これを読んでいる方は、[ネットワーク参加者ページ](https://thegraph.com/explorer/participants/indexers)にアクセスして、GRT を自分の選んだインデクサーに委任することで、今すぐデリゲーターになることができるのです。 +これを読んでいる方は、[ネットワーク参加者ページ](https://thegraph.com/explorer/participants/indexers)にアクセスして、GRTを自分の選んだインデクサーに委任することで、今すぐデリゲーターになることができるのです。 ## Curators (Earn GRT) -キュレーターは、高品質のサブグラフを特定し、それを「キュレーション」(GRT シグナルを送ること)することで、そのサブグラフから将来発生する全てのクエリ料の一定割合を保証するキュレーションシェアを獲得します。独立したネットワーク参加者であれば誰でもキュレーターになることができますが、通常、サブグラフの開発者は、自分のサブグラフがインデックスされることを保証したいため、自分のサブグラフの最初のキュレーターの一人になります。 +キュレーターは、高品質のサブグラフを特定し、それを「キュレーション」(GRTシグナルを送ること)することで、そのサブグラフから将来発生する全てのクエリ料の一定割合を保証するキュレーションシェアを獲得します。独立したネットワーク参加者であれば誰でもキュレーターになることができますが、通常、サブグラフの開発者は、自分のサブグラフがインデックスされることを保証したいため、自分のサブグラフの最初のキュレーターの一人になります。 -2022 年 12 月現在、サブグラフ開発者は、少なくとも 10,000GRT でサブグラフをキュレーションすることが推奨されています。ただし、この数値はネットワーク活動やコミュニティ参加によって影響を受ける可能性があります。 +2022年12月現在、サブグラフ開発者は、少なくとも10,000GRTでサブグラフをキュレーションすることが推奨されています。ただし、この数値はネットワーク活動やコミュニティ参加によって影響を受ける可能性があります。 -キュレーターは、新しいサブグラフをキュレーションするときに 1%のキュレーション税を支払います。このキュレーション税はバーンされ、GRT の供給量を減少させます。 +キュレーターは、新しいサブグラフをキュレーションするときに1%のキュレーション税を支払います。このキュレーション税はバーンされ、GRTの供給量を減少させます。 ## Developers -ディベロッパーは、ブロックチェーンのデータを取得するためにサブグラフを構築し、クエリを実行します。サブグラフはオープンソースであるため、ディベロッパーは既存のサブグラフに問い合わせを行い、ブロックチェーンのデータを自分の Dapps にロードすることができます。ディベロッパーは、クエリを実行する際に、ネットワーク参加者に配布される GRT で支払いを行う +ディベロッパーは、ブロックチェーンのデータを取得するためにサブグラフを構築し、クエリを実行します。サブグラフはオープンソースであるため、ディベロッパーは既存のサブグラフに問い合わせを行い、ブロックチェーンのデータを自分のDappsにロードすることができます。ディベロッパーは、クエリを実行する際に、ネットワーク参加者に配布されるGRTで支払いを行う ### Creating a subgraph ディベロッパーは[サブグラフ](/developing/creating-a-subgraph/)を作成し、ブロックチェーン上のデータをインデックス化することができます。サブグラフは、どのデータをコンシューマーに提供すべきかについて、インデクサーに指示するものです。 -サブグラフの構築とテストが完了したら、開発者は[The Graph の分散型ネットワークでサブグラフを公開することができます](/publishing/publishing-a-subgraph/)。 +サブグラフの構築とテストが完了したら、開発者は[The Graphの分散型ネットワークでサブグラフを公開することができます](/publishing/publishing-a-subgraph/)。 ### Querying an existing subgraph サブグラフが The Graph の分散型ネットワークに[公開](https://thegraph.com/docs/en/publishing/publishing-a-subgraph/)されると、誰でも API キーを作成し、 GRT を請求残高に追加し、サブグラフをクエリします。 -サブグラフは[GraphQL](/querying/querying-the-graph/)でクエリされ、クエリ料は[Subgraph Studio](https://thegraph.com/studio/)で GRT で支払われます。クエリ料は、プロトコルへの貢献度に応じてネットワーク参加者に分配されます。 +サブグラフは[GraphQL](/querying/querying-the-graph/)でクエリされ、クエリ料は[Subgraph Studio](https://thegraph.com/studio/)でGRTで支払われます。クエリ料は、プロトコルへの貢献度に応じてネットワーク参加者に分配されます。 -ネットワークに支払われるクエリーフィーの 1%がバーンされます。 +ネットワークに支払われるクエリーフィーの1%がバーンされます。 ## Indexers (Earn GRT) -インデクサーは、The Graph のバックボーンです。彼らは、The Graph の分散型ネットワークを支える独立したハードウェアとソフトウェアを操作しています。インデクサーは、サブグラフからの指示に基づいてコンシューマーにデータを提供します。 +インデクサーは、The Graphのバックボーンです。彼らは、The Graphの分散型ネットワークを支える独立したハードウェアとソフトウェアを操作しています。インデクサーは、サブグラフからの指示に基づいてコンシューマーにデータを提供します。 -インデクサーは、2 つの方法で GRT 報酬を獲得することができます: +インデクサーは、2つの方法でGRT報酬を獲得することができます: -1. クエリ料:サブグラフデータのクエリに対して、開発者またはユーザが支払う GRT。クエリ料はリベートプールに預けられ、インデクサに分配されます。 +1. クエリ料:サブグラフデータのクエリに対して、開発者またはユーザが支払うGRT。クエリ料はリベートプールに預けられ、インデクサに分配されます。 -2. インデックス作成報酬:年間 3%の発行額は、インデックスを作成しているサブグラフの数に応じて、インデクサーに分配されます。この報酬は、インデクサーのインセンティブとなり、時にはクエリ料が機能する前にサブグラフのインデックスを作成し、データを正確にインデックスしたことを証明する POI(Proofs of Indexing)を蓄積して提出します。 +2. インデックス作成報酬:年間3%の発行額は、インデックスを作成しているサブグラフの数に応じて、インデクサーに分配されます。この報酬は、インデクサーのインセンティブとなり、時にはクエリ料が機能する前にサブグラフのインデックスを作成し、データを正確にインデックスしたことを証明するPOI(Proofs of Indexing)を蓄積して提出します。 各サブグラフは、そのサブグラフのキュレーションシグナルの量に基づき、ネットワークトークン発行総額の一部が割り当てられます。そして、その量は、サブグラフに割り当てられたステークに基づき、インデクサーに報酬として支払われます。 -インデックスノードを運営するために、インデクサーはネットワークに 100,000GRT 以上の出資をする必要があります。インデクサーは、提供するクエリの量に比例して、GRT をステークするインセンティブを得ます。 +インデックスノードを運営するために、インデクサーはネットワークに100,000GRT以上の出資をする必要があります。インデクサーは、提供するクエリの量に比例して、GRTをステークするインセンティブを得ます。 -インデクサーは、デリゲーターからの GRT の委任を受け入れることで、サブグラフ上の GRT 割り当てを増やすことができ、最大で初期ステークスの 16 倍を受け入れることができます。もし、インデクサーが「過剰委任」(つまり、初期出資額の 16 倍以上)になった場合、ネットワークへの出資額を増やすまで、デリゲーターからの追加 GRT を使用することができなくなります。 +インデクサーは、デリゲーターからのGRTの委任を受け入れることで、サブグラフ上のGRT割り当てを増やすことができ、最大で初期ステークスの16倍を受け入れることができます。もし、インデクサーが「過剰委任」(つまり、初期出資額の16倍以上)になった場合、ネットワークへの出資額を増やすまで、デリゲーターからの追加GRTを使用することができなくなります。 -インデクサーが受け取る報酬の量は、最初のステーク、受け入れられた委任、サービスの質、その他多くの要因に基づいて変化する可能性があります。以下のグラフは、The Graph の分散型ネットワーク上でアクティブなインデクサーから公開されたデータです。 +インデクサーが受け取る報酬の量は、最初のステーク、受け入れられた委任、サービスの質、その他多くの要因に基づいて変化する可能性があります。以下のグラフは、The Graphの分散型ネットワーク上でアクティブなインデクサーから公開されたデータです。 ### The Indexer stake & reward of allnodes-com.eth ![インデキシングステークと報酬](/img/indexing-stake-and-income.png) -本データは、2021 年 2 月から 2022 年 9 月までのものです。 +本データは、2021年2月から2022年9月までのものです。 -> なお、[Arbitrum の移行](https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551)が完了すると改善され、ガス代はネットワークに参加するための負担が大幅に軽減されることになります。 +> なお、[Arbitrumの移行](https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551)が完了すると改善され、ガス代はネットワークに参加するための負担が大幅に軽減されることになります。 ## Token Supply: Burning & Issuance -最初のトークン供給量は 100 億 GRT で、サブグラフにステークを割り当てる Indexer に報いるため、毎年 3%の新規発行を目標としています。つまり、GRT トークンの総供給量は、ネットワークへの貢献に対してインデクサーに新しいトークンが発行されることにより、毎年 3%ずつ増加することになります。 +最初のトークン供給量は100億GRTで、サブグラフにステークを割り当てるIndexerに報いるため、毎年3%の新規発行を目標としています。つまり、GRTトークンの総供給量は、ネットワークへの貢献に対してインデクサーに新しいトークンが発行されることにより、毎年3%ずつ増加することになります。 -グラフは、新しいトークン発行を相殺するために、複数のバーンメカニズムで設計されています。GRT の供給量の約 1%が、ネットワーク上の様々な活動を通じて毎年バーンされ、この数はネットワークの活動が成長し続けるにつれて増加しています。これらのバーン活動には、デリゲーターが GRT をインデクサーに委任するたびに 0.5%のデリゲーション税、キュレーターがサブグラフにシグナルを送るときに 1%のキュレーション税、ブロックチェーンデータのクエリー料金の 1%が含まれます。 +グラフは、新しいトークン発行を相殺するために、複数のバーンメカニズムで設計されています。GRTの供給量の約1%が、ネットワーク上の様々な活動を通じて毎年バーンされ、この数はネットワークの活動が成長し続けるにつれて増加しています。これらのバーン活動には、デリゲーターがGRTをインデクサーに委任するたびに0.5%のデリゲーション税、キュレーターがサブグラフにシグナルを送るときに1%のキュレーション税、ブロックチェーンデータのクエリー料金の1%が含まれます。 ![バーンGRTの合計](/img/total-burned-grt.jpeg) -このような定期的に発生するバーニング活動に加え、GRT トークンには、インデクサーの悪意ある行動や無責任な行動にペナルティを与えるスラッシングの仕組みも用意されています。インデクサーがスラッシングされた場合、そのエポックのインデックス報酬の 50%が焼却され(残りの半分は漁師に渡る)、自己ステークは 2.5%スラッシングされ、その半分がバーンされます。これにより、インデクサーはネットワークの最善の利益のために行動し、そのセキュリティと安定性に貢献するという強いインセンティブを確保することができます。 +このような定期的に発生するバーニング活動に加え、GRTトークンには、インデクサーの悪意ある行動や無責任な行動にペナルティを与えるスラッシングの仕組みも用意されています。インデクサーがスラッシングされた場合、そのエポックのインデックス報酬の50%が焼却され(残りの半分は漁師に渡る)、自己ステークは2.5%スラッシングされ、その半分がバーンされます。これにより、インデクサーはネットワークの最善の利益のために行動し、そのセキュリティと安定性に貢献するという強いインセンティブを確保することができます。 ## Improving the Protocol diff --git a/website/pages/ko/cookbook/arweave.mdx b/website/pages/ko/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/ko/cookbook/arweave.mdx +++ b/website/pages/ko/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/ko/cookbook/cosmos.mdx b/website/pages/ko/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/ko/cookbook/cosmos.mdx +++ b/website/pages/ko/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/ko/cookbook/near.mdx b/website/pages/ko/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/ko/cookbook/near.mdx +++ b/website/pages/ko/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/ko/cookbook/subgraph-debug-forking.mdx b/website/pages/ko/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/ko/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/ko/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/ko/developing/creating-a-subgraph.mdx b/website/pages/ko/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/ko/developing/creating-a-subgraph.mdx +++ b/website/pages/ko/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/ko/glossary.mdx b/website/pages/ko/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/ko/glossary.mdx +++ b/website/pages/ko/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/ko/network/explorer.mdx b/website/pages/ko/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/ko/network/explorer.mdx +++ b/website/pages/ko/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/ko/substreams/[[...slug]].mdx b/website/pages/ko/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/ko/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/mr/cookbook/arweave.mdx b/website/pages/mr/cookbook/arweave.mdx index 052b741747d6..dbdfb367fda4 100644 --- a/website/pages/mr/cookbook/arweave.mdx +++ b/website/pages/mr/cookbook/arweave.mdx @@ -166,7 +166,7 @@ Arweave subgraphs साठी GraphQL एंडपॉइंट विद्य Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/mr/cookbook/cosmos.mdx b/website/pages/mr/cookbook/cosmos.mdx index c681104820ac..8d461b2bcb0f 100644 --- a/website/pages/mr/cookbook/cosmos.mdx +++ b/website/pages/mr/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi हे लक्षात घेणे महत्त्वाचे आहे की कॉसमॉस संदेश साखळी-विशिष्ट असतात आणि ते अनुक्रमित [प्रोटोकॉल बफर्स](https://developers.google.com/protocol-buffers/) च्या स्वरूपात सबग्राफवर पाठवले जातात पेलोड. परिणामी, संदेश डेटावर प्रक्रिया करण्यापूर्वी मॅपिंग फंक्शनमध्ये डीकोड करणे आवश्यक आहे. -सबग्राफमध्ये संदेश डेटा कसा डीकोड करायचा याचे उदाहरण [ आढळू शकते. येथे](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/mr/cookbook/near.mdx b/website/pages/mr/cookbook/near.mdx index 302d625990ee..9f06b6cb2054 100644 --- a/website/pages/mr/cookbook/near.mdx +++ b/website/pages/mr/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/mr/cookbook/subgraph-debug-forking.mdx b/website/pages/mr/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/mr/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/mr/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/mr/developing/creating-a-subgraph.mdx b/website/pages/mr/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/mr/developing/creating-a-subgraph.mdx +++ b/website/pages/mr/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/mr/glossary.mdx b/website/pages/mr/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/mr/glossary.mdx +++ b/website/pages/mr/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/mr/network/explorer.mdx b/website/pages/mr/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/mr/network/explorer.mdx +++ b/website/pages/mr/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/mr/substreams/[[...slug]].mdx b/website/pages/mr/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/mr/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/nl/cookbook/arweave.mdx b/website/pages/nl/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/nl/cookbook/arweave.mdx +++ b/website/pages/nl/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/nl/cookbook/cosmos.mdx b/website/pages/nl/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/nl/cookbook/cosmos.mdx +++ b/website/pages/nl/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/nl/cookbook/near.mdx b/website/pages/nl/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/nl/cookbook/near.mdx +++ b/website/pages/nl/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/nl/cookbook/subgraph-debug-forking.mdx b/website/pages/nl/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/nl/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/nl/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/nl/developing/creating-a-subgraph.mdx b/website/pages/nl/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/nl/developing/creating-a-subgraph.mdx +++ b/website/pages/nl/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/nl/glossary.mdx b/website/pages/nl/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/nl/glossary.mdx +++ b/website/pages/nl/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/nl/network/explorer.mdx b/website/pages/nl/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/nl/network/explorer.mdx +++ b/website/pages/nl/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/nl/substreams/[[...slug]].mdx b/website/pages/nl/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/nl/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/pl/cookbook/arweave.mdx b/website/pages/pl/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/pl/cookbook/arweave.mdx +++ b/website/pages/pl/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/pl/cookbook/cosmos.mdx b/website/pages/pl/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/pl/cookbook/cosmos.mdx +++ b/website/pages/pl/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/pl/cookbook/near.mdx b/website/pages/pl/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/pl/cookbook/near.mdx +++ b/website/pages/pl/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/pl/cookbook/subgraph-debug-forking.mdx b/website/pages/pl/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/pl/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/pl/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/pl/developing/creating-a-subgraph.mdx b/website/pages/pl/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/pl/developing/creating-a-subgraph.mdx +++ b/website/pages/pl/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/pl/glossary.mdx b/website/pages/pl/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/pl/glossary.mdx +++ b/website/pages/pl/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/pl/network/explorer.mdx b/website/pages/pl/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/pl/network/explorer.mdx +++ b/website/pages/pl/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/pl/substreams/[[...slug]].mdx b/website/pages/pl/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/pl/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/pt/cookbook/arweave.mdx b/website/pages/pt/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/pt/cookbook/arweave.mdx +++ b/website/pages/pt/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/pt/cookbook/cosmos.mdx b/website/pages/pt/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/pt/cookbook/cosmos.mdx +++ b/website/pages/pt/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/pt/cookbook/near.mdx b/website/pages/pt/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/pt/cookbook/near.mdx +++ b/website/pages/pt/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/pt/cookbook/subgraph-debug-forking.mdx b/website/pages/pt/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/pt/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/pt/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/pt/developing/creating-a-subgraph.mdx b/website/pages/pt/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/pt/developing/creating-a-subgraph.mdx +++ b/website/pages/pt/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/pt/glossary.mdx b/website/pages/pt/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/pt/glossary.mdx +++ b/website/pages/pt/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/pt/network/explorer.mdx b/website/pages/pt/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/pt/network/explorer.mdx +++ b/website/pages/pt/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/pt/operating-graph-node.mdx b/website/pages/pt/operating-graph-node.mdx index 0d2bbdd3bc52..4d4dc6c5bf84 100644 --- a/website/pages/pt/operating-graph-node.mdx +++ b/website/pages/pt/operating-graph-node.mdx @@ -104,13 +104,13 @@ A complete Kubernetes example configuration can be found in the [indexer reposit When it is running Graph Node exposes the following ports: -| Port | Purpose | Routes | CLI Argument | Environment Variable | -| --- | --- | --- | --- | --- | -| 8000 | GraphQL HTTP server
    (for subgraph queries) | /subgraphs/id/...
    /subgraphs/name/.../... | --http-port | - | -| 8001 | GraphQL WS
    (for subgraph subscriptions) | /subgraphs/id/...
    /subgraphs/name/.../... | --ws-port | - | -| 8020 | JSON-RPC
    (for managing deployments) | / | --admin-port | - | -| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | -| 8040 | Prometheus metrics | /metrics | --metrics-port | - | +| Port | Purpose | Routes | CLI Argument | Environment Variable | +| ---- | ----------------------------------------------------- | ---------------------------------------------------- | ----------------- | -------------------- | +| 8000 | GraphQL HTTP server
    (for subgraph queries) | /subgraphs/id/...
    /subgraphs/name/.../... | --http-port | - | +| 8001 | GraphQL WS
    (for subgraph subscriptions) | /subgraphs/id/...
    /subgraphs/name/.../... | --ws-port | - | +| 8020 | JSON-RPC
    (for managing deployments) | / | --admin-port | - | +| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | +| 8040 | Prometheus metrics | /metrics | --metrics-port | - | > **Important**: Be careful about exposing ports publicly - **administration ports** should be kept locked down. This includes the the Graph Node JSON-RPC endpoint. diff --git a/website/pages/pt/querying/graphql-api.mdx b/website/pages/pt/querying/graphql-api.mdx index 89cda460d58f..33bdce152375 100644 --- a/website/pages/pt/querying/graphql-api.mdx +++ b/website/pages/pt/querying/graphql-api.mdx @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| Symbol | Operator | Description | -| --- | --- | --- | -| `&` | `And` | For combining multiple search terms into a filter for entities that include all of the provided terms | -| | | `Or` | Queries with multiple search terms separated by the or operator will return all entities with a match from any of the provided terms | -| `<->` | `Follow by` | Specify the distance between two words. | -| `:*` | `Prefix` | Use the prefix search term to find words whose prefix match (2 characters required.) | +| Symbol | Operator | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `&` | `And` | For combining multiple search terms into a filter for entities that include all of the provided terms | +| | | `Or` | Queries with multiple search terms separated by the or operator will return all entities with a match from any of the provided terms | +| `<->` | `Follow by` | Specify the distance between two words. | +| `:*` | `Prefix` | Use the prefix search term to find words whose prefix match (2 characters required.) | #### Examples diff --git a/website/pages/pt/substreams/[[...slug]].mdx b/website/pages/pt/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/pt/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/ru/cookbook/arweave.mdx b/website/pages/ru/cookbook/arweave.mdx index 6a176511b0ba..9a2e939b200f 100644 --- a/website/pages/ru/cookbook/arweave.mdx +++ b/website/pages/ru/cookbook/arweave.mdx @@ -166,7 +166,7 @@ graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph Вот пример подграфа для справки: -- [Пример подграфа для Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Пример подграфа для Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## Часто задаваемые вопросы diff --git a/website/pages/ru/cookbook/cosmos.mdx b/website/pages/ru/cookbook/cosmos.mdx index 87eb8bb10f82..cdf98ee8d86e 100644 --- a/website/pages/ru/cookbook/cosmos.mdx +++ b/website/pages/ru/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ class Any { Важно отметить, что сообщения Cosmos зависят от специфики чейна и передаются в субграф в виде серийной полезной нагрузки [Protocol Buffers](https://developers.google.com/protocol-buffers/). В результате данные сообщения необходимо декодировать в функции отображения, прежде чем их можно будет обработать. -Пример того, как расшифровываются данные сообщения в субграфе, можно найти [здесь](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Создание и построение субграфа на Cosmos @@ -250,10 +250,10 @@ graph deploy subgraph-name --node http://localhost:8020/ --ipfs http://localhost Вот несколько примеров субграфов для справки: -[Пример фильтрации блоков](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Пример фильтрации блоков](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Пример вознаграждения валидатора](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Пример вознаграждения валидатора](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Пример делегирования валидатора](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Пример делегирования валидатора](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Пример свопа токенов Osmosis](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Пример свопа токенов Osmosis](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/ru/cookbook/near.mdx b/website/pages/ru/cookbook/near.mdx index 4374feaf4ffd..12b2d21aa500 100644 --- a/website/pages/ru/cookbook/near.mdx +++ b/website/pages/ru/cookbook/near.mdx @@ -1,8 +1,8 @@ --- -title: Создание подграфов на NEAR +title: Создание субграфов на NEAR --- -> NEAR поддерживается в Graph Node и на размещенном сервисе находится в бета-версии: пожалуйста, свяжитесь near@thegraph.com по любым вопросам о создании подграфов на NEAR! +> NEAR поддерживается в Graph Node и на размещенном сервисе находится в бета-версии: пожалуйста, свяжитесь near@thegraph.com по любым вопросам о создании субграфов на NEAR! Это руководство представляет собой введение в построение подграфов, индексирующих смарт-контракты на [блокчейне NEAR](https://docs.near.org/). @@ -12,9 +12,9 @@ title: Создание подграфов на NEAR ## Что такое NEAR подграфы? -The Graph предоставляет разработчикам инструменты для обработки событий блокчейна и делает результирующие данные легко доступными через GraphQL API, известный индивидуально как подграф. [Graph Node](https://github.com/graphprotocol/graph-node) теперь способен обрабатывать события NEAR, что означает, что разработчики NEAR теперь могут создавать подграфы для индексации своих смарт-контрактов. +The Graph предоставляет разработчикам инструменты для обработки событий блокчейна и делает результирующие данные легко доступными через GraphQL API, известный индивидуально как субграф. [Graph Node](https://github.com/graphprotocol/graph-node) теперь способен обрабатывать события NEAR, что означает, что разработчики NEAR теперь могут создавать субграфы для индексации своих смарт-контрактов. -Подграфы основаны на событиях, что означает, что они отслеживают и затем обрабатывают события в сети. В настоящее время для подграфов NEAR поддерживаются два типа обработчиков: +Субграфы основаны на событиях, что означает, что они отслеживают и затем обрабатывают события в сети. В настоящее время для подграфов NEAR поддерживаются два типа обработчиков: - Обработчики блоков: они запускаются для каждого нового блока - Обработчики квитанций: запускаются каждый раз, когда сообщение выполняется в указанной учетной записи @@ -25,13 +25,13 @@ The Graph предоставляет разработчикам инструме ## Создание NEAR подграфа -`@graphprotocol/graph-cli` - это инструмент командной строки для построения и развертывания подграфов. +`@graphprotocol/graph-cli` - это инструмент командной строки для построения и развертывания субграфов. -`@graphprotocol/graph-ts` - это библиотека типов, специфичных для подграфов. +`@graphprotocol/graph-ts` - это библиотека типов, специфичных для субграфов. -Для разработки NEAR подграфа требуется `graph-cli` выше версии `0.23.0` и `graph-ts` выше версии `0.23.0`. +Для разработки NEAR субграфа требуется `graph-cli` выше версии `0.23.0` и `graph-ts` выше версии `0.23.0`. -> Построение NEAR подграфа очень похоже на построение подграфа, индексирующего Ethereum. +> Построение NEAR сабграфа очень похоже на построение сабграфа, индексирующего Ethereum. Существует три аспекта определения подграфа: @@ -167,20 +167,20 @@ class ReceiptWithOutcome { - Обработчики блоков получат `Block` - Обработчики квитанций получат `ReceiptWithOutcome` -В противном случае остальная часть [AssemblyScript API](/developing/assemblyscript-api) доступна разработчикам NEAR подграфа во время выполнения сопоставления. +В противном случае остальная часть [AssemblyScript API](/developing/assemblyscript-api) доступна разработчикам NEAR субграфа во время выполнения сопоставления. Это включает в себя новую функцию синтаксического анализа JSON - журналы на NEAR часто выдаются в виде stringified JSONs. Новая функция `json.fromString(...)` доступна как часть [JSON API](/developing/assemblyscript-api#json-api), позволяющая разработчикам легко обрабатывать эти журналы. -## Развертывание NEAR подграфа +## Развертывание NEAR субграфа -Как только у вас будет построенный подграф, пришло время развернуть его в Graph Node для индексации. NEAR подграфы могут быть развернуты на любой ноде Graph `>=v0.26.x` (эта версия еще не была помечена & выпущена). +Как только у вас будет построенный субграф, пришло время развернуть его в Graph Node для индексации. NEAR субграфы могут быть развернуты на любой ноде Graph `>=v0.26.x` (эта версия еще не была помечена & выпущена). Размещенный сервис The Graph в настоящее время поддерживает индексацию NEAR с mainnet и testnet в бета-версии со следующими сетевыми именами: - `near-mainnet` - `near-testnet` -Дополнительную информацию о создании и развертывании сабграфов в размещенной службе можно найти [здесь](/deploying/deploying-a-subgraph-to-hosted). +Дополнительную информацию о создании и развертывании субграфов в размещенной службе можно найти [здесь](/deploying/deploying-a-subgraph-to-hosted). В качестве краткого примера - первым шагом является "создание" вашего подграфа - это нужно сделать только один раз. В размещенном сервисе это можно сделать в [вашем Dashboard](https://thegraph.com/hosted-service/dashboard): "Add Subgraph". @@ -205,7 +205,7 @@ graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ``` -Как только ваш подграф будет развернут, он будет проиндексирован Graph Node. Вы можете проверить его прогресс, сделав запрос к самому подграфу: +Как только ваш подграф будет развернут, он будет проиндексирован Graph Node. Вы можете проверить его прогресс, сделав запрос к самому субграфу: ```graphql { @@ -235,9 +235,9 @@ graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 Вот несколько примеров подграфов для справки: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## Часто задаваемые вопросы @@ -273,11 +273,11 @@ accounts: ### Ethereum subgraphs support "pending" and "current" versions, how can I deploy a "pending" version of a NEAR subgraph? -Ожидающая функциональность еще не поддерживается для NEAR подграфов. Тем временем вы можете развернуть новую версию на другом "именованном" подграфе, а затем, когда она будет синхронизирована с заголовком цепочки, вы можете повторно развернуть ее на свой основной "именованный" подграф, который будет использовать тот же базовый идентификатор развертывания, поэтому основной подграф будет мгновенно синхронизирован. +Ожидающая функциональность еще не поддерживается для NEAR подграфов. Тем временем вы можете развернуть новую версию на другом "именованном" подграфе, а затем, когда она будет синхронизирована с заголовком чейна, вы можете повторно развернуть ее на свой основной "именованный" подграф, который будет использовать тот же базовый идентификатор развертывания, поэтому основной субграф будет мгновенно синхронизирован. ### My question hasn't been answered, where can I get more help building NEAR subgraphs? -Если это общий вопрос о разработке подграфа, то гораздо больше информации содержится в остальной части [документации разработчика](/cookbook/quick-start). В противном случае пожалуйста, присоединяйтесь [The Graph Protocol Discord](https://discord.gg/vtvv7FP) и задайте вопрос в канале #near или по электронной почте near@thegraph.com. +Если это общий вопрос о разработке субграфа, то гораздо больше информации содержится в остальной части [документации разработчика](/cookbook/quick-start). В противном случае пожалуйста, присоединяйтесь [The Graph Protocol Discord](https://discord.gg/vtvv7FP) и задайте вопрос в канале #near или по электронной почте near@thegraph.com. ## Ссылки diff --git a/website/pages/ru/cookbook/subgraph-debug-forking.mdx b/website/pages/ru/cookbook/subgraph-debug-forking.mdx index 6a01a9acf8fc..cf4a664e2f49 100644 --- a/website/pages/ru/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/ru/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ title: Быстрая и простая отладка подграфа с ис ## Пожалуйста, покажите мне какой-нибудь код! -Чтобы оставаться сосредоточенным на отладке подграфа, давайте сделаем все просто и запустим вместе с [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) индексирование смарт-контракта Ethereum Gravity. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Вот обработчики, установленные для индексирования `Gravatar`s, совершенно без ошибок: diff --git a/website/pages/ru/developing/creating-a-subgraph.mdx b/website/pages/ru/developing/creating-a-subgraph.mdx index 7ecce778b167..83644aa85b49 100644 --- a/website/pages/ru/developing/creating-a-subgraph.mdx +++ b/website/pages/ru/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Описание | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Описание | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/ru/glossary.mdx b/website/pages/ru/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/ru/glossary.mdx +++ b/website/pages/ru/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/ru/network/explorer.mdx b/website/pages/ru/network/explorer.mdx index 78e087a7eccb..02ec69b224e6 100644 --- a/website/pages/ru/network/explorer.mdx +++ b/website/pages/ru/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/ru/querying/graphql-api.mdx b/website/pages/ru/querying/graphql-api.mdx index 045a14c5063a..a0937ab51664 100644 --- a/website/pages/ru/querying/graphql-api.mdx +++ b/website/pages/ru/querying/graphql-api.mdx @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| Символ | Оператор | Описание | -| --- | --- | --- | -| `&` | `And` | Для объединения нескольких условий поиска в фильтр для объектов, которые включают все указанные условия | -| | | `Or` | Запросы с несколькими условиями поиска, разделенные оператором or, вернут все объекты, которые соответствуют любому из предоставленных условий | -| `<->` | `Follow by` | Укажите расстояние между двумя словами. | -| `:*` | `Prefix` | Используйте поисковый запрос по префиксу, чтобы найти слова с соответствующим префиксом (необходимо 2 символа) | +| Символ | Оператор | Описание | +| ----------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `&` | `And` | Для объединения нескольких условий поиска в фильтр для объектов, которые включают все указанные условия | +| | | `Or` | Запросы с несколькими условиями поиска, разделенные оператором or, вернут все объекты, которые соответствуют любому из предоставленных условий | +| `<->` | `Follow by` | Укажите расстояние между двумя словами. | +| `:*` | `Prefix` | Используйте поисковый запрос по префиксу, чтобы найти слова с соответствующим префиксом (необходимо 2 символа) | #### Examples diff --git a/website/pages/ru/substreams/[[...slug]].mdx b/website/pages/ru/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/ru/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/ru/tokenomics.mdx b/website/pages/ru/tokenomics.mdx index 04203a020575..36aae7ee7ea2 100644 --- a/website/pages/ru/tokenomics.mdx +++ b/website/pages/ru/tokenomics.mdx @@ -17,7 +17,7 @@ The Graph индексирует данные блокчейна так же, к The Graph играет решающую роль в том, чтобы сделать данные блокчейна более доступными и создать площадку для их обмена. -## The Roles of Network Participants +## Роли участников сети Есть четыре основных участника сети: @@ -33,7 +33,7 @@ The Graph играет решающую роль в том, чтобы сдел ![Диаграмма токеномики](/img/updated-tokenomics-image.png) -## Delegators (Passively earn GRT) +## Делегаторы (Возможность пассивного дохода в GRT) Делегаторы делегируют Индексаторам GRT, увеличивая стейк Индексатора в субграфах в сети. Взамен Делегаторы получают процент от всех сборов за запросы и вознаграждения за индексирование от Индексатора. Каждый Индексатор самостоятельно устанавливает размер вознаграждения для Делегаторов, что создает конкуренцию между Индексаторами за привлечение Делегаторов. Большинство Индексаторов предлагают от 9 до 12% годовых. @@ -43,7 +43,7 @@ The Graph играет решающую роль в том, чтобы сдел Если Вы читаете это, Вы можете стать Делегатором прямо сейчас, перейдя на [страницу участников сети](https://thegraph.com/explorer/participants/indexers) и делегировав GRT Индексатору по Вашему выбору. -## Curators (Earn GRT) +## Кураторы (Заработок GRT) Кураторы определяют высококачественные субграфы и "курируют" их (т. е. сигнализируют о них GRT), чтобы получать комиссии кураторства, которые гарантируют процент от всех будущих сборов за запросы, сгенерированные субграфом. В то время как Куратором может быть любой независимый участник сети, обычно разработчики субграфов являются одними из первых Кураторов своих собственных субграфов, потому что они хотят убедиться, что их субграф проиндексирован. @@ -51,59 +51,59 @@ The Graph играет решающую роль в том, чтобы сдел Кураторы платят комиссию за кураторство в размере 1%, когда они курируют новый субграф. Эта комиссия сжигается, уменьшая предложение GRT. -## Developers +## Разработчики Разработчики создают и запрашивают субграфы для получения данных блокчейна. Поскольку субграфы имеют открытый исходный код, разработчики могут делать запросы к существующим субграфам, чтобы загрузить данные блокчейна в свои dapps. Разработчики платят за запросы, которые они выполняют, в GRT, распределяемых среди участников сети. -### Creating a subgraph +### Создание субграфа -Разработчики могут [создать подграф](/developing/creating-a-subgraph/) для индексации данных в блокчейне. Подграфы - это инструкции для индексаторов о том, какие данные должны предоставляться потребителям. +Разработчики могут [создать субграф](/developing/creating-a-subgraph/) для индексации данных в блокчейне. Субграфы - это инструкции для индексаторов о том, какие данные должны предоставляться потребителям. -После того как разработчики создали и протестировали свой подграф, они могут [ опубликовать свой подграф](/publishing/publishing-a-subgraph/) в децентрализованной сети The Graph. +После того как разработчики создали и протестировали свой субграф, они могут [ опубликовать его](/publishing/publishing-a-subgraph/) в децентрализованной сети The Graph. -### Querying an existing subgraph +### Запрос к существующему субграфу -Как только подграф [ опубликован](https://thegraph.com/docs/en/publishing/publishing-a-subgraph/) в децентрализованной сети The Graph, любой может создать ключ API, добавить GRT к своему платежному балансу и сделать запрос на подграф. +Как только субграф будет [ опубликован](https://thegraph.com/docs/en/publishing/publishing-a-subgraph/) в децентрализованной сети The Graph, любой может создать ключ API, добавить GRT к своему платежному балансу и сделать запрос на субграф. -Подграфы [запрашиваются с помощью GraphQL](/querying/querying-the-graph/), а плата за запрос оплачивается с помощью GRT в [Subgraph Studi](https://thegraph.com/studio/). Плата за запрос распределяется между участниками сети на основе их вклада в протокол. +Субграфы [запрашиваются с помощью GraphQL](/querying/querying-the-graph/), а плата за запрос производится с помощью GRT в [Subgraph Studio](https://thegraph.com/studio/). Плата за запрос распределяется между участниками сети на основе их вклада в протокол. 1% от платы за запрос, выплаченной в сети, сжигается. -## Indexers (Earn GRT) +## Индексаторы (Заработок GRT) -Индексаторы являются основой сети The Graph. Они управляют независимым аппаратным и программным обеспечением, питающим децентрализованную сеть The Graph. Индексаторы предоставляют данные потребителям на основе инструкций из подграфов. +Индексаторы являются основой сети The Graph. Они управляют независимым аппаратным и программным обеспечением, питающим децентрализованную сеть The Graph. Индексаторы предоставляют данные потребителям на основе инструкций из субграфов. Индексаторы могут зарабатывать GRT двумя путями: -1. Плата за запрос: GRT, выплачиваемая разработчиками или пользователями за запросы к данным подграфа. Плата за запрос зачисляется в rebate pool и распределяется среди индексаторов. +1. Комиссия за запросы: GRT, выплачиваемые разработчиками или пользователями за запросы к данным субграфа. Плата за запрос зачисляется в пул скидок и распределяется среди Индексаторов. -2. Вознаграждения за индексирование: ежегодная эмиссия в размере 3% распределяется между индексаторами в зависимости от количества индексируемых ими подграфов. Эти вознаграждения стимулируют индексаторов индексировать подграфы, иногда до начала сборов за запросы, чтобы накопить и отправить доказательства индексирования (POI), подтверждающие, что они точно проиндексировали данные. +2. Вознаграждения за индексирование: ежегодная эмиссия в размере 3% распределяется между Индексаторами в зависимости от количества индексируемых ими субграфов. Эти вознаграждения стимулируют Индексаторов индексировать субграфы, иногда до начала сборов за запросы, чтобы накопить и отправить доказательства индексирования (POI), подтверждающие, что они точно проиндексировали данные. -Каждому подграфу выделяется часть от общего объема выдачи токенов сетью, основанная на количестве сигнала курирования подграфа. Затем эта сумма присуждается индексаторам на основе их выделенного стейка на подграфе. +Каждому субграфу выделяется часть общей эмиссии сетевых токенов, основанная на количестве сигналов курирования субграфа. Затем эта сумма присуждается индексаторам на основе их выделенного стейка на субграфе. -Чтобы запустить индексаторскую ноду, Индексаторы должны застейкать в сети 100 000 GRT или более. Индексаторы стимулируются стейкать GRT пропорционально количеству запросов, которые они обслуживают. +Чтобы запустить индексаторскую ноду, Индексаторы должны застейкать в сети 100 000 GRT или более. Индексаторы заинтересованы в том, чтобы делать ставки GRT пропорционально количеству запросов, которые они обслуживают. -Индексаторы могут увеличить свои аллокации GRT на подграфах, приняв делегации GRT от Делегаторов, и они могут принять в 16 раз больше своей первоначальной суммы стейка. Если Индексатор становится "чрезмерно делегированным" (т.е. более чем в 16 раз превышает свою первоначальную сумму стейка), он не сможет получать дополнительные токены GRT от Делегаторов, пока не увеличит свой стейка в сети снова. +Индексаторы могут увеличить свои аллокации GRT на субграфах, приняв делегации GRT от Делегаторов, при этом они могут принять в 16 раз больше своей первоначальной ставки. Если Индексатор становится "чрезмерно делегированным" (т.е. более чем в 16 раз превышает свою первоначальную сумму стейка), он не сможет использовать дополнительные токены GRT от Делегаторов, пока не увеличит свою долю в сети. -Размер вознаграждений, которые получает Индексатор, может варьироваться в зависимости от начального стейка, полученной делегации, качества обслуживания и многих других факторов. Следующая диаграмма представляет собой общедоступные данные от активного Индексатора в децентрализованной сети The Graph. +Размер вознаграждений, которые получает Индексатор, может варьироваться в зависимости от первоначального стейка, полученного делегирования, качества обслуживания и многих других факторов. На следующей диаграмме представлены общедоступные данные активного Индексатора в децентрализованной сети The Graph. ### The Indexer stake & reward of allnodes-com.eth -![Награды за индексирование](/img/indexing-stake-and-income.png) +![Индексация ставок и вознаграждения](/img/indexing-stake-and-income.png) Эти данные относятся к периоду с февраля 2021 по сентябрь 2022 года. -> Пожалуйста, обратите внимание, что это улучшится после завершения миграции [Arbitrum'а](https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551), что значительно снизит затраты на газ для участия в сети. +> Пожалуйста, обратите внимание на то, что после завершения миграции [Arbitrum'а](https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551) произойдут улучшения, которые приведут к значительному снижению затрат на газ для участия в сети. ## Token Supply: Burning & Issuance -Первоначальное предложение токенов составляет 10 миллиардов GRT, с целью выпуска 3% новых токенов ежегодно, чтобы вознаградить Индексаторов за распределение стейка на подграфах. Это означает, что общий объем токенов GRT будет увеличиваться на 3% каждый год по мере выпуска новых токенов Индексаторам за их вклад в сеть. +Первоначальное предложение токенов составляет 10 миллиардов GRT, с целью ежегодного выпуска 3% новых токенов для вознаграждения Индексаторов за распределение стейка на субграфах. Это означает, что общий объем токенов GRT будет увеличиваться на 3% каждый год по мере того, как Индексаторам будут выдаваться новые токены за их вклад в сеть. -The Graph разработан с использованием нескольких механизмов сжигания токенов, чтобы компенсировать выпуск новых токенов. Примерно 1% от общего объема GRT ежегодно сжигается в результате различных действий в сети, и это число увеличивается по мере того, как сетевая активность продолжает расти. Эти текущие действия включают комиссию на делегирование в размере 0,5% всякий раз, когда Делегатор делегирует GRT Индексатору, комиссию на кураторство в размере 1%, когда Кураторы сигнализируют о подграфе, и плату за запрос данных блокчейна в размере 1%. +The Graph разработан с использованием нескольких механизмов сжигания токенов, чтобы компенсировать выпуск новых токенов. Примерно 1% от общего объема GRT ежегодно сжигается в результате различных действий в сети, и это число увеличивается по мере того, как сетевая активность продолжает расти. Эти текущие действия включают комиссию на делегирование в размере 0,5% всякий раз, когда Делегатор делегирует GRT Индексатору, комиссию на кураторство в размере 1%, когда Кураторы сигнализируют о субграфе, и плату за запрос данных блокчейна в размере 1%. ![Количество сожженных GRT](/img/total-burned-grt.jpeg) -В дополнение к этим регулярно происходящим действиям по сжиганию токенов, токен GRT также имеет механизм слэшинга для наказания за злонамеренное или безответственное поведение Индексаторов. Если Индексатор заслэшен, 50% его вознаграждения за индексацию за эпоху сжигается (в то время как другая половина достается fisherman), а его собственная сумма стейка уменьшается на 2,5%, причем половина этой суммы сжигается. Это помогает гарантировать, что у Индексаторов есть сильный стимул действовать в наилучших интересах сети и вносить свой вклад в ее безопасность и стабильность. +В дополнение к этим регулярно происходящим действиям по сжиганию токенов, токен GRT также имеет механизм слэшинга для наказания за злонамеренное или безответственное поведение Индексаторов. Если Индексатор заслэшен, 50% его вознаграждения за индексацию за эпоху сжигается (в то время как другая половина достается Рыбаку), а его собственная сумма стейка уменьшается на 2,5%, причем половина этой суммы сгорает. Это помогает гарантировать, что у Индексаторов есть сильный стимул действовать в наилучших интересах сети и вносить свой вклад в ее безопасность и стабильность. ## Improving the Protocol diff --git a/website/pages/sv/cookbook/arweave.mdx b/website/pages/sv/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/sv/cookbook/arweave.mdx +++ b/website/pages/sv/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/sv/cookbook/cosmos.mdx b/website/pages/sv/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/sv/cookbook/cosmos.mdx +++ b/website/pages/sv/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/sv/cookbook/near.mdx b/website/pages/sv/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/sv/cookbook/near.mdx +++ b/website/pages/sv/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/sv/cookbook/subgraph-debug-forking.mdx b/website/pages/sv/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/sv/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/sv/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/sv/developing/creating-a-subgraph.mdx b/website/pages/sv/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/sv/developing/creating-a-subgraph.mdx +++ b/website/pages/sv/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/sv/glossary.mdx b/website/pages/sv/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/sv/glossary.mdx +++ b/website/pages/sv/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/sv/network/explorer.mdx b/website/pages/sv/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/sv/network/explorer.mdx +++ b/website/pages/sv/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/sv/substreams/[[...slug]].mdx b/website/pages/sv/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/sv/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/tr/cookbook/arweave.mdx b/website/pages/tr/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/tr/cookbook/arweave.mdx +++ b/website/pages/tr/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/tr/cookbook/cosmos.mdx b/website/pages/tr/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/tr/cookbook/cosmos.mdx +++ b/website/pages/tr/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/tr/cookbook/near.mdx b/website/pages/tr/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/tr/cookbook/near.mdx +++ b/website/pages/tr/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/tr/cookbook/subgraph-debug-forking.mdx b/website/pages/tr/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/tr/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/tr/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/tr/developing/creating-a-subgraph.mdx b/website/pages/tr/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/tr/developing/creating-a-subgraph.mdx +++ b/website/pages/tr/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/tr/glossary.mdx b/website/pages/tr/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/tr/glossary.mdx +++ b/website/pages/tr/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/tr/network/explorer.mdx b/website/pages/tr/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/tr/network/explorer.mdx +++ b/website/pages/tr/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/tr/substreams/[[...slug]].mdx b/website/pages/tr/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/tr/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/uk/cookbook/arweave.mdx b/website/pages/uk/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/uk/cookbook/arweave.mdx +++ b/website/pages/uk/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/uk/cookbook/cosmos.mdx b/website/pages/uk/cookbook/cosmos.mdx index f454cfcf628b..d1c171814941 100644 --- a/website/pages/uk/cookbook/cosmos.mdx +++ b/website/pages/uk/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/uk/cookbook/near.mdx b/website/pages/uk/cookbook/near.mdx index 53d9b06c0a45..654e13633503 100644 --- a/website/pages/uk/cookbook/near.mdx +++ b/website/pages/uk/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/uk/cookbook/subgraph-debug-forking.mdx b/website/pages/uk/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/uk/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/uk/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/uk/developing/creating-a-subgraph.mdx b/website/pages/uk/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/uk/developing/creating-a-subgraph.mdx +++ b/website/pages/uk/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/uk/glossary.mdx b/website/pages/uk/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/uk/glossary.mdx +++ b/website/pages/uk/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/uk/network/explorer.mdx b/website/pages/uk/network/explorer.mdx index a6d928e9e72e..6f11bccdfea8 100644 --- a/website/pages/uk/network/explorer.mdx +++ b/website/pages/uk/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/uk/substreams/[[...slug]].mdx b/website/pages/uk/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/uk/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/ur/cookbook/arweave.mdx b/website/pages/ur/cookbook/arweave.mdx index bb55f351ca62..6a53ae342eef 100644 --- a/website/pages/ur/cookbook/arweave.mdx +++ b/website/pages/ur/cookbook/arweave.mdx @@ -166,7 +166,7 @@ graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph حوالہ کے لیے سب گراف کی ایک مثال یہ ہے: -- [آرویو کے لیے سب گراف کی مثال](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [آرویو کے لیے سب گراف کی مثال](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/ur/cookbook/cosmos.mdx b/website/pages/ur/cookbook/cosmos.mdx index b6fe03308d55..d36973efc1e7 100644 --- a/website/pages/ur/cookbook/cosmos.mdx +++ b/website/pages/ur/cookbook/cosmos.mdx @@ -165,7 +165,7 @@ class Any { ہر ہینڈلر کی قسم اس کے اپنے ڈیٹا ڈھانچے کے ساتھ آتی ہے جو میپنگ فنکشن کی دلیل کے طور پر پاس کی جاتی ہے. -- بلاک ہینڈلرز کو `Block` قسم موصول ہوتی ہے. +- بلاک ہینڈلرز کو ` Block ` قسم موصول ہوتی ہے. - ایونٹ ہینڈلرز کو `EventData` قسم موصول ہوتی ہے. - ٹرانزیکشن ہینڈلرز کو `TransactionData` قسم موصول ہوتی ہے. - میسج ہینڈلرز کو `MessageData` قسم موصول ہوتی ہے. @@ -178,7 +178,7 @@ class Any { یہ نوٹ کرنا ضروری ہے کہ کوزموس پیغامات سلسلہ کے لحاظ سے مخصوص ہوتے ہیں اور انہیں سیریلائزڈ [پروٹوکول بفرز](https://developers.google.com/protocol-buffers/) کی شکل میں سب گراف میں منتقل کیا جاتا ہے۔ > پے لوڈ۔ نتیجے کے طور پر، میسج ڈیٹا کو میپنگ فنکشن میں ڈی کوڈ کرنے کی ضرورت ہے اس سے پہلے کہ اس پر کارروائی کی جا سکے. -سب گراف میں پیغام کے ڈیٹا کو ڈی کوڈ کرنے کے طریقے کی ایک مثال [ یہاں](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts) مل سکتی ہے. +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## کوزموس سب گراف بنانا اور تعمیر کرنا @@ -250,10 +250,10 @@ graph deploy subgraph-name --node http://localhost:8020/ --ipfs http://localhost حوالہ کے لیے ذیل میں کچھ مثالیں ہیں: -[بلاک فلٹرنگ کی مثال](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[بلاک فلٹرنگ کی مثال](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[ویلیڈیٹر کے انعامات کی مثال](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[ویلیڈیٹر کے انعامات کی مثال](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[ویلیڈیٹر ڈیلیگیشنز کی مثال](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[ویلیڈیٹر ڈیلیگیشنز کی مثال](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[اوسموسس ٹوکن سویپس کی مثال](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[اوسموسس ٹوکن سویپس کی مثال](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/ur/cookbook/near.mdx b/website/pages/ur/cookbook/near.mdx index 24bd70305d5b..f2f11cdbbbad 100644 --- a/website/pages/ur/cookbook/near.mdx +++ b/website/pages/ur/cookbook/near.mdx @@ -235,9 +235,9 @@ NEAR سب گراف کے لیے گراف کیو ایل اینڈ پوائنٹ کا حوالہ کے لیے ذیل میں کچھ مثالیں ہیں: -[NEAR بلاکس](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR بلاکس](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR ریسیپٹس](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR ریسیپٹس](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## عمومی سوالات @@ -255,7 +255,7 @@ NEAR سپورٹ بیٹا میں ہے، جس کا مطلب ہے کہ API میں ### Will receipt handlers trigger for accounts and their sub-accounts? -اگر ایک `اکاؤنٹ` متعین کیا گیا ہے، تو وہ صرف صحیح اکاؤنٹ کے نام سے مماثل ہوگا۔ مثال کے طور پر، اکاؤنٹس اور سب اکاؤنٹس سے ملنے کے لیے مخصوص `prefixes` اور ` suffixes` کے ساتھ، `accounts` فیلڈ کی وضاحت کرکے سب اکاؤنٹس کو ملانا ممکن ہے۔ درج ذیل تمام `mintbase1.near` سب اکاؤنٹس سے مماثل ہوں گے: +اگر ایک `اکاؤنٹ` متعین کیا گیا ہے، تو وہ صرف صحیح اکاؤنٹ کے نام سے مماثل ہوگا۔ مثال کے طور پر، اکاؤنٹس اور سب اکاؤنٹس سے ملنے کے لیے مخصوص ` prefixes ` اور ` suffixes` کے ساتھ، `accounts` فیلڈ کی وضاحت کرکے سب اکاؤنٹس کو ملانا ممکن ہے۔ درج ذیل تمام `mintbase1.near` سب اکاؤنٹس سے مماثل ہوں گے: ```yaml accounts: diff --git a/website/pages/ur/cookbook/subgraph-debug-forking.mdx b/website/pages/ur/cookbook/subgraph-debug-forking.mdx index 39e52e658222..b784594420cf 100644 --- a/website/pages/ur/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/ur/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ title: فورکس کا استعمال کرتے ہوۓ تیز اور آسان ڈ ## براۓ مہربانی، مجہے کچھ کوڈ دکھائیں! -سب گراف ڈیبگنگ پر توجہ مرکوز رکھنے کے لیے، آئیے چیزوں کو سادہ رکھیں اور [مثالی- سب گراف](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) کے ساتھ چلائیں۔ > ایتھرئم گریویٹی سمارٹ کنٹریکٹ کی انڈیکس کرنا. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. یہاں `Gravatar` کی انڈیکسنگ کے لیے بیان کردہ ہینڈلرز ہیں، بغیر کسی بگ کے: @@ -44,7 +44,7 @@ export function handleUpdatedGravatar(event: UpdatedGravatar): void { } ``` -افوہ، کتنی بدقسمتی کی بات ہے، جب میں اپنے بہترین نظر آنے والے سب گراف کو [ہوسٹڈ سروس](https://thegraph.com/hosted-service/) میں تعینات کرتا ہوں تو یہ _"گراوتار نہیں ملا!"_ خرابی. +افوہ، کتنی بدقسمتی کی بات ہے، جب میں اپنے بہترین نظر آنے والے سب گراف کو [ہوسٹڈ سروس](https://thegraph.com/hosted-service/) میں تعینات کرتا ہوں تو یہ *"گراوتار نہیں ملا!"* خرابی. درست کرنے کی کوشش کرنے کا معمول کا طریقہ یہ ہے: diff --git a/website/pages/ur/developing/creating-a-subgraph.mdx b/website/pages/ur/developing/creating-a-subgraph.mdx index aa9895f5e099..651c6605eaa6 100644 --- a/website/pages/ur/developing/creating-a-subgraph.mdx +++ b/website/pages/ur/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ Options: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ type GravatarDeclined @entity { ہم اپنے GraphQL API میں درج ذیل اسکیلرز کی حمایت کرتے ہیں: -| قسم | تفصیل | -| --- | --- | -| `Bytes` | Byte array، ایک ہیکساڈیسیمل سٹرنگ کے طور پر پیش کیا جاتا ہے. عام طور پر Ethereum hashes اور ایڈریسیس کے لیے استعمال ہوتا ہے. | -| `String` | `string` ویلیوز کے لیے اسکیلر. خالی حروف تعاون یافتہ نہیں ہیں اور خود بخود ہٹا دیے جاتے ہیں. | -| `Boolean` | `Boolean` ویلیوز کے لیے اسکیلر. | -| `Int` | GraphQL spec `Int` کی وضاحت کرتا ہے جس کا سائز 32 bytes ہے. | -| `BigInt` | بڑے integers۔ Ethereum کی `uint32`، `int64`، `uint64`، ..., `uint256` اقسام کے لیے استعمال کیا جاتا ہے. نوٹ: `uint32` کے نیچے ہر چیز، جیسے `int32`، `uint24` یا `int8` کو `i32` کے طور پر دکھایا گیا ہے. | -| `BigDecimal` | `BigDecimal` اعلی درستگی والے اعشاریہ ایک significand اور ایک exponent کے طور پر پیش کیا جاتے ہہیں. Exponent رینج −6143 سے +6144 تک ہے۔ 34 سگنیفیکینڈ ہندسوں پر rounded کیا گیا۔. | +| قسم | تفصیل | +| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Bytes` | Byte array، ایک ہیکساڈیسیمل سٹرنگ کے طور پر پیش کیا جاتا ہے. عام طور پر Ethereum hashes اور ایڈریسیس کے لیے استعمال ہوتا ہے. | +| `String` | `string` ویلیوز کے لیے اسکیلر. خالی حروف تعاون یافتہ نہیں ہیں اور خود بخود ہٹا دیے جاتے ہیں. | +| `Boolean` | `Boolean` ویلیوز کے لیے اسکیلر. | +| `Int` | GraphQL spec `Int` کی وضاحت کرتا ہے جس کا سائز 32 bytes ہے. | +| `BigInt` | بڑے integers۔ Ethereum کی `uint32`، `int64`، `uint64`، ..., `uint256` اقسام کے لیے استعمال کیا جاتا ہے. نوٹ: `uint32` کے نیچے ہر چیز، جیسے `int32`، `uint24` یا `int8` کو `i32` کے طور پر دکھایا گیا ہے. | +| `BigDecimal` | `BigDecimal` اعلی درستگی والے اعشاریہ ایک significand اور ایک exponent کے طور پر پیش کیا جاتے ہہیں. Exponent رینج −6143 سے +6144 تک ہے۔ 34 سگنیفیکینڈ ہندسوں پر rounded کیا گیا۔. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **نوٹ:** ایک نیا ڈیٹا سورس صرف اس بلاک کے لیے کالز اور ایونٹس پر کارروائی کرے گا جس میں اسے بنایا گیا تھا اور تمام مندرجہ ذیل بلاکس، لیکن تاریخی ڈیٹا، یعنی ڈیٹا پر کارروائی نہیں کرے گا جو پہلے سے بلاکس میں موجود ہے. -> +> > اگر پہلے والے بلاکس میں نئے ڈیٹا سورس سے متعلقہ ڈیٹا ہوتا ہے، تو یہ بہترین ہے کہ کنٹریکٹ کی موجودہ حالت کو پڑھ کر اور ڈیٹا کا نیا سورس بننے کے وقت اس سٹیٹ کی نمائندگی کرنے والی اینٹیٹیز بنا کر اس ڈیٹا کو انڈیکس کریں. ### ڈیٹا سورس سیاق و سباق @@ -703,7 +703,7 @@ dataSources: ``` > **نوٹ:** کنٹریکٹ تخلیق والے بلاک کو Etherscan پر تیزی سے دیکھا جا سکتا ہے: -> +> > 1. سرچ بار میں اس کا ایڈریس درج کرکے کنٹریکٹ کو تلاش کریں. > 2. `Contract Creator` سیکشن میں creation transaction hash پر کلک کریں. > 3. ٹرانزیکشن کی تفصیلات کا صفحہ لوڈ کریں جہاں آپ کو اس کنٹریکٹ کے لیے اسٹارٹ بلاک ملے گا. diff --git a/website/pages/ur/glossary.mdx b/website/pages/ur/glossary.mdx index 4a400694a32b..19e1f37b6120 100644 --- a/website/pages/ur/glossary.mdx +++ b/website/pages/ur/glossary.mdx @@ -8,6 +8,8 @@ title: لغت - **گراف کیو ایل**: APIs کے لیے کیوری کی زبان اور آپ کے موجودہ ڈیٹا کے ساتھ ان کیوریز کو پورا کرنے کے لیے رن ٹائم۔ گراف سب گراف سے کیوری کرنے کے لیے گراف کیو ایل کا استعمال کرتا ہے. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **سب گراف**: ایک حسب ضرورت API جو بلاکچین ڈیٹا پر بنایا گیا ہے جس سے [گراف کیو ایل](https://graphql.org/) کا استعمال کر کے کیوری کیا جا سکتا ہے۔ ڈیولپرز گراف کے ڈیسینٹرالائزڈ نیٹ ورک پر سب گراف بنا، تعینات اور شائع کر سکتے ہیں۔ اس کے بعد، انڈیکسرز سب گرافوں کو انڈیکس کرنا شروع کر سکتے ہیں تاکہ انہیں سب گراف صارفین کی طرف سے کیوری کرنے کے لیے دستیاب ہو سکے. - **ہوسٹڈ سروس**: گراف کے ڈیسینٹرالائزڈ نیٹ ورک کے طور پر سب گراف کی تعمیر اور کیوری کے لیے ایک عارضی سہاروں کی خدمت اس کی سروس کی لاگت، سروس کے معیار، اور ڈویلپر کے تجربے کو پختہ کر رہی ہے. diff --git a/website/pages/ur/network/explorer.mdx b/website/pages/ur/network/explorer.mdx index 5b4c95a8a5f7..e658ca7ba5e1 100644 --- a/website/pages/ur/network/explorer.mdx +++ b/website/pages/ur/network/explorer.mdx @@ -87,7 +87,7 @@ title: گراف ایکسپلورر - پروٹوکول میں ان کے پاس موجود GRT کی کل رقم - جس تاریخ کو انہوں نے آخری بار ڈیلیگیٹ کیا تھا -اگر آپ ڈیلیگیٹر بننے کے طریقے کے بارے میں مزید جاننا چاہتے ہیں تو مزید نہ دیکھیں! آپ کو صرف یہ کرنا ہے کہ [آفیشل دستاویزات](/network/delegating) یا [گراف اکیڈمی](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## نیٹ ورک diff --git a/website/pages/ur/querying/graphql-api.mdx b/website/pages/ur/querying/graphql-api.mdx index 18b6781f348a..5d6e10c2ad45 100644 --- a/website/pages/ur/querying/graphql-api.mdx +++ b/website/pages/ur/querying/graphql-api.mdx @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| علامت | آپریٹر | تفصیل | -| --- | --- | --- | -| `&` | `And` | ایک سے زیادہ تلاش کی اصطلاحات کو ایک فلٹر میں یکجا کرنے کے لیے ان ہستیوں کے لیے جس میں فراہم کردہ تمام اصطلاحات شامل ہوں | -| | | `Or` | Or آپریٹر کے ذریعہ الگ کردہ متعدد تلاش کی اصطلاحات کے ساتھ کیوریز فراہم کردہ شرائط میں سے کسی سے بھی مماثلت کے ساتھ تمام ہستیوں کو واپس کریں گے | -| `<>` | `Follow by` | دو الفاظ کے درمیان فاصلہ بتائیں. | -| `:*` | `Prefix` | ایسے الفاظ تلاش کرنے کے لیے پریفکس ​​تلاش کی اصطلاح استعمال کریں جن کا سابقہ ​​مماثل ہو (۲ حروف درکار ہیں.) | +| علامت | آپریٹر | تفصیل | +| ---------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `&` | `And` | ایک سے زیادہ تلاش کی اصطلاحات کو ایک فلٹر میں یکجا کرنے کے لیے ان ہستیوں کے لیے جس میں فراہم کردہ تمام اصطلاحات شامل ہوں | +| | | `Or` | Or آپریٹر کے ذریعہ الگ کردہ متعدد تلاش کی اصطلاحات کے ساتھ کیوریز فراہم کردہ شرائط میں سے کسی سے بھی مماثلت کے ساتھ تمام ہستیوں کو واپس کریں گے | +| `<>` | `Follow by` | دو الفاظ کے درمیان فاصلہ بتائیں. | +| `:*` | `Prefix` | ایسے الفاظ تلاش کرنے کے لیے پریفکس ​​تلاش کی اصطلاح استعمال کریں جن کا سابقہ ​​مماثل ہو (۲ حروف درکار ہیں.) | #### Examples diff --git a/website/pages/ur/substreams/[[...slug]].mdx b/website/pages/ur/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/ur/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/vi/cookbook/arweave.mdx b/website/pages/vi/cookbook/arweave.mdx index 3710f7632ba2..319ad2f760a7 100644 --- a/website/pages/vi/cookbook/arweave.mdx +++ b/website/pages/vi/cookbook/arweave.mdx @@ -166,7 +166,7 @@ The GraphQL endpoint for Arweave subgraphs is determined by the schema definitio Here is an example subgraph for reference: -- [Example subgraph for Arweave](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Example subgraph for Arweave](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## FAQ diff --git a/website/pages/vi/cookbook/cosmos.mdx b/website/pages/vi/cookbook/cosmos.mdx index 49d29dffdd8a..ef21e4bc0855 100644 --- a/website/pages/vi/cookbook/cosmos.mdx +++ b/website/pages/vi/cookbook/cosmos.mdx @@ -178,7 +178,7 @@ You can find the full list of types for the Cosmos integration [here](https://gi It's important to note that Cosmos messages are chain-specific and they are passed to a subgraph in the form of a serialized [Protocol Buffers](https://developers.google.com/protocol-buffers/) payload. As a result, the message data needs to be decoded in a mapping function before it can be processed. -An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts). +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## Creating and building a Cosmos subgraph @@ -250,10 +250,10 @@ Osmosis mainnet is `osmosis-1`. Osmosis current testnet is `osmo-test-4`. Here are some example subgraphs for reference: -[Block Filtering Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[Block Filtering Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator Rewards Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator Rewards Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis Token Swaps Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis Token Swaps Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/vi/cookbook/near.mdx b/website/pages/vi/cookbook/near.mdx index 33ef5e56c213..6c2f253187ca 100644 --- a/website/pages/vi/cookbook/near.mdx +++ b/website/pages/vi/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, Here are some example subgraphs for reference: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## FAQ diff --git a/website/pages/vi/cookbook/subgraph-debug-forking.mdx b/website/pages/vi/cookbook/subgraph-debug-forking.mdx index 5f214139646a..7ac3bf96ca10 100644 --- a/website/pages/vi/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/vi/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. Here are the handlers defined for indexing `Gravatar`s, with no bugs whatsoever: diff --git a/website/pages/vi/developing/creating-a-subgraph.mdx b/website/pages/vi/developing/creating-a-subgraph.mdx index b2e9801b28fb..1b5e5403d59d 100644 --- a/website/pages/vi/developing/creating-a-subgraph.mdx +++ b/website/pages/vi/developing/creating-a-subgraph.mdx @@ -98,7 +98,7 @@ For the example subgraph, `subgraph.yaml` is: ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| Type | Description | -| --- | --- | -| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Bytes` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `String` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### Enums @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > If prior blocks contain data relevant to the new data source, it is best to index that data by reading the current state of the contract and creating entities representing that state at the time the new data source is created. ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. Search for the contract by entering its address in the search bar. > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. Load the transaction details page where you'll find the start block for that contract. diff --git a/website/pages/vi/glossary.mdx b/website/pages/vi/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/vi/glossary.mdx +++ b/website/pages/vi/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/vi/network/explorer.mdx b/website/pages/vi/network/explorer.mdx index ee8de0ad96b5..059f6fdf5fa5 100644 --- a/website/pages/vi/network/explorer.mdx +++ b/website/pages/vi/network/explorer.mdx @@ -87,7 +87,7 @@ The Delegators table will allow you to see the active Delegators in the communit - Total amount of GRT they have currently in the protocol - The date they last delegated at -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network diff --git a/website/pages/vi/substreams/[[...slug]].mdx b/website/pages/vi/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/vi/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/zh/cookbook/arweave.mdx b/website/pages/zh/cookbook/arweave.mdx index 3cc474722a8a..8d5eb90a1e91 100644 --- a/website/pages/zh/cookbook/arweave.mdx +++ b/website/pages/zh/cookbook/arweave.mdx @@ -2,11 +2,11 @@ title: 在 Arweave 上构建子图 --- -> Graph 节点和托管服务中对 Arweave 的支持目前处于测试阶段:任何有关构建 Arweave 子图的任何问题,请联系 Arweave@https://discord.gg/rC8rBuRtbH! +> Graph 节点和托管服务中对Arweave的支持目前处于测试阶段:任何有关构建 Arweave 子图的任何问题,请联系Arweave@https://discord.gg/rC8rBuRtbH! -在本指南中,您将学习如何构建和部署子图以索引 Arweave 区块链。 +在本指南中,您将学习如何构建和部署子图以索引Arweave区块链。 -## Arweave 是什么? +## Arweave是什么? Arweave 协议允许开发者永久存储数据,这是 Arweave 和 IPFS 的主要区别,IPFS 没有这个特性,永久性和存储在 Arweave 上的文件不能被更改或删除。 @@ -15,18 +15,18 @@ Arweave 已经构建了许多库,用于将协议集成到许多不同的编程 - [Arwiki](https://arwiki.wiki/#/en/main) - [Arweave Resources](https://www.arweave.org/build) -## Arweave 子图是什么? +## Arweave子图是什么? Graph 允许您构建称为“子图 ”的自定义开放 API。子图用于告诉索引人(服务器操作员) 在区块链上索引哪些数据,并保存在他们的服务器上,以便您能够在任何时候使用 [GraphQL](https://graphql.org/) 查询它。 -[Graph 节点](https://github.com/graphprotocol/graph-node) 现在能够在 Arweave 协议上索引数据。当前的集成只是索引 Arweave 作为一个区块链(区块和交易) ,它还没有索引存储的文件。 +[Graph节点](https://github.com/graphprotocol/graph-node) 现在能够在 Arweave 协议上索引数据。当前的集成只是索引 Arweave 作为一个区块链(区块和交易) ,它还没有索引存储的文件。 ## 构建 Arweave 子图 为了能够构建和部署 Arweave 子图,您需要两个包: -1. `@graphprotocol/graph-cli` 高于 0.30.2 版本-这是一个用于构建和部署子图的命令行工具。[点击这里](https://www.npmjs.com/package/@graphprotocol/graph-cli)下载使用 `npm`。 -2. `@ graph protocol/graph-ts` 0.27.0 以上版本-这是子图特定类型的库。[点击这里](https://www.npmjs.com/package/@graphprotocol/graph-ts)下载使用 `npm`。 +1. `@graphprotocol/graph-cli` 高于0.30.2版本-这是一个用于构建和部署子图的命令行工具。[点击这里](https://www.npmjs.com/package/@graphprotocol/graph-cli)下载使用 `npm`。 +2. `@ graph protocol/graph-ts` 0.27.0以上版本-这是子图特定类型的库。[点击这里](https://www.npmjs.com/package/@graphprotocol/graph-ts)下载使用 `npm`。 ## 子图的组成部分 @@ -34,7 +34,7 @@ Graph 允许您构建称为“子图 ”的自定义开放 API。子图用于告 ### 1. 数据源明细 - `subgraph.yaml` -定义感兴趣的数据源,以及如何处理它们。Arweave 是一种新型数据源。 +定义感兴趣的数据源,以及如何处理它们。Arweave是一种新型数据源。 ### 2. 数据查询结构- `schema.graphql` @@ -82,8 +82,8 @@ dataSources: - handler: handleTx # the function name in the mapping file ``` -- Arweave 子图引入了一种新的数据源(`arweave`) -- 网络应该对应于托管 Graph 节点上的网络。在托管服务上,Arweave 的主网是 `Arweave-mainnet` +- Arweave子图引入了一种新的数据源(`arweave`) +- 网络应该对应于托管Graph节点上的网络。在托管服务上,Arweave 的主网是 `Arweave-mainnet` - Arweave 数据源引入了一个可选的 source. owner 字段,它是 Arweave 钱包的公钥 Arweave 数据源支持两种类型的处理程序: @@ -166,7 +166,7 @@ Arweave 子图的 GraphQL 端点由模式定义和现有的 API 接口决定。 下面是一个子图的例子,以供参考: -- [Arweave 的子图示例](https://github.com/graphprotocol/example-subgraphs/tree/main/arweave/blocks-transactions) +- [Arweave 的子图示例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/arweave-blocks-transactions) ## 常见问题 @@ -184,11 +184,11 @@ Arweave 子图的 GraphQL 端点由模式定义和现有的 API 接口决定。 ### 如何筛选特定账户的交易? -Source.owner 可以是用户的公钥或账户地址。 +Source.owner可以是用户的公钥或账户地址。 ### 当前的加密格式是什么? -数据通常以字节的形式传递到映射中,如果直接存储字节,则以`十六进制`格式(例如,区块和和交易 hashes)返回。您可能希望在映射中转换为 `base64`或 `base64 URL` 安全格式,以便与 [Arweave Explorer](https://viewblock.io/arweave/) 等区块浏览器中显示的内容相匹配。 +数据通常以字节的形式传递到映射中,如果直接存储字节,则以`十六进制`格式(例如,区块和和交易hashes)返回。您可能希望在映射中转换为 `base64`或 `base64 URL` 安全格式,以便与 [Arweave Explorer](https://viewblock.io/arweave/) 等区块浏览器中显示的内容相匹配。 可以使用以下 `bytesToBase64(字节: Uint8Array,urlSafe: boolean): string` 辅助函数,并将其添加到 `graph-ts`: diff --git a/website/pages/zh/cookbook/base-testnet.mdx b/website/pages/zh/cookbook/base-testnet.mdx index c5b20bd6eda1..aa111162c38a 100644 --- a/website/pages/zh/cookbook/base-testnet.mdx +++ b/website/pages/zh/cookbook/base-testnet.mdx @@ -6,12 +6,12 @@ This guide will quickly take you through how to initialize, create, and deploy y What you'll need: -- A Base testnet contract address -- A crypto wallet (e.g. MetaMask or Coinbase Wallet) +- A Base testnet contract address +- A crypto wallet (e.g. MetaMask or Coinbase Wallet) ## 子图工作室 -### 1. Install the Graph CLI +### 1. Install the Graph CLI The Graph CLI (>=v0.41.0) is written in JavaScript and you will need to have either `npm` or `yarn` installed to use it. @@ -23,7 +23,7 @@ npm install -g @graphprotocol/graph-cli yarn global add @graphprotocol/graph-cli ``` -### 2. Create your subgraph in the Subgraph Studio +### 2. Create your subgraph in the Subgraph Studio Go to the [Subgraph Studio](https://thegraph.com/studio/) and connect your crypto wallet. @@ -31,7 +31,7 @@ Once connected, click "Create a Subgraph" and enter a name for your subgraph. Select "Base (testnet)" as the indexed blockchain and click Create Subgraph. -### 3. Initialize your Subgraph +### 3. 初始化子图 > You can find specific commands for your subgraph in the Subgraph Studio. @@ -49,29 +49,29 @@ graph init --studio Your subgraph slug is an identifier for your subgraph. The CLI tool will walk you through the steps for creating a subgraph, including: -- Protocol: ethereum -- Subgraph slug: `` -- Directory to create the subgraph in: `` -- Ethereum network: base-testnet \_ Contract address: `` -- Start block (optional) -- Contract name: `` -- Yes/no to indexing events (yes means your subgraph will be bootstrapped with entities in the schema and simple mappings for emitted events) +- Protocol: ethereum +- Subgraph slug: `` +- Directory to create the subgraph in: `` +- Ethereum network: base-testnet \_ Contract address: `` +- Start block (optional) +- Contract name: `` +- Yes/no to indexing events (yes means your subgraph will be bootstrapped with entities in the schema and simple mappings for emitted events) -### 3. Write your Subgraph +### 3. Write your Subgraph > If emitted events are the only thing you want to index, then no additional work is required, and you can skip to the next step. The previous command creates a scaffold subgraph that you can use as a starting point for building your subgraph. When making changes to the subgraph, you will mainly work with three files: -- Manifest (subgraph.yaml) - The manifest defines what datasources your subgraphs will index. Make sure to add `base-testnet` as the network name in manifest file to deploy your subgraph on Base testnet. -- Schema (schema.graphql) - The GraphQL schema defines what data you wish to retreive from the subgraph. -- AssemblyScript 映射(mapping.ts)--将数据源中的数据转换为模式中定义的实体的代码。 +- Manifest (subgraph.yaml) - The manifest defines what datasources your subgraphs will index. Make sure to add `base-testnet` as the network name in manifest file to deploy your subgraph on Base testnet. +- Schema (schema.graphql) - The GraphQL schema defines what data you wish to retreive from the subgraph. +- AssemblyScript 映射(mapping.ts)--将数据源中的数据转换为模式中定义的实体的代码。 If you want to index additional data, you will need extend the manifest, schema and mappings. For more information on how to write your subgraph, see [Creating a Subgraph](/developing/creating-a-subgraph). -### 4. Deploy to the Subgraph Studio +### 4. Deploy to the Subgraph Studio Before you can deploy your subgraph, you will need to authenticate with the Subgraph Studio. You can do this by running the following command: @@ -103,7 +103,7 @@ graph deploy --studio ``` ```` -### 5. Query your subgraph +### 5. Query your subgraph Once your subgraph is deployed, you can query it from your dapp using the `Development Query URL` in the Subgraph Studio. diff --git a/website/pages/zh/cookbook/cosmos.mdx b/website/pages/zh/cookbook/cosmos.mdx index 03ebe903355e..23ac4eba6e48 100644 --- a/website/pages/zh/cookbook/cosmos.mdx +++ b/website/pages/zh/cookbook/cosmos.mdx @@ -15,7 +15,7 @@ Cosmos 子图目前支持四种类型的处理程序: - **交易处理程序**在发生交易时运行。 - **消息处理程序**在发生特定消息时运行。 -根据[Cosmos 的正式文件](https://docs.cosmos.network/): +根据[Cosmos的正式文件](https://docs.cosmos.network/): > [Events](https://docs.cosmos.network/main/core/events) are objects that contain information about the execution of the application. They are mainly used by service providers like block explorers and wallets to track the execution of various messages and index transactions. @@ -74,8 +74,8 @@ dataSources: file: ./src/mapping.ts # link to the file with the Assemblyscript mappings ``` -- Cosmos 子图引入了一`种`新的数据源(`Cosmos`)。 -- 该`网络`应该对应于 Cosmos 生态系统中的一个链。在示例中,使用了 Cosmos Hub 主网。 +- Cosmos子图引入了一`种`新的数据源(`Cosmos`)。 +- 该`网络`应该对应于 Cosmos 生态系统中的一个链。在示例中,使用了Cosmos Hub主网。 ### 模式定义 @@ -178,7 +178,7 @@ class Any { 值得注意的是,Cosmos 消息是链特定的,以序列化的[协议缓冲](https://developers.google.com/protocol-buffers/)有效载荷的形式传递给子图。因此,在处理消息数据之前,需要在映射函数中对消息数据进行解码。 -如何在子图中解码消息数据的示例可以在[这里](https://github.com/graphprotocol/example-subgraphs/blob/main/cosmos/validator-delegations/src/decoding.ts)找到。 +An example of how to decode message data in a subgraph can be found [here](https://github.com/graphprotocol/graph-tooling/blob/main/examples/cosmos-validator-delegations/src/decoding.ts). ## 创建和构建 Cosmos 子图 @@ -222,13 +222,13 @@ graph deploy subgraph-name --node http://localhost:8020/ --ipfs http://localhost The GraphQL endpoint for Cosmos subgraphs is determined by the schema definition, with the existing API interface. Please visit the [GraphQL API documentation](/querying/graphql-api/) for more information. -## 受支持的 Cosmos 区块链 +## 受支持的Cosmos区块链 ### Cosmos Hub -#### 什么是 Cosmos Hub? +#### 什么是Cosmos Hub? -[Cosmos Hub 区块链](https://hub.cosmos.network/)是[Cosmos](https://cosmos.network/)生态系统中的第一个区块链。您可以访问[官方文档](https://docs.cosmos.network/)以获得更多信息。 +[Cosmos Hub区块链](https://hub.cosmos.network/)是[Cosmos](https://cosmos.network/)生态系统中的第一个区块链。您可以访问[官方文档](https://docs.cosmos.network/)以获得更多信息。 #### 网络 @@ -238,7 +238,7 @@ Cosmos Hub 主网是 `cosmoshub-4`. Cosmos Hub 当前测试网是 `theta-testnet > Osmosis support in Graph Node and on the Hosted Service is in beta: please contact the graph team with any questions about building Osmosis subgraphs! -#### Osmosis 是什么? +#### Osmosis是什么? [Osmosis](https://osmosis.zone/)是一个去中心化的,协议建立在 Cosmos SDK 之上的跨链自动做市商(AMM)。它允许用户创建自定义流动性池并交易支持 IBC 的代币。您可以访问[官方文档](https://docs.osmosis.zone/)以获得更多信息。 @@ -250,10 +250,10 @@ Osmosis 主网是 `osmosis-1`. Osmosis 当前测试网是`osmo-test-4`. 以下是一些示例子图供参考: -[区块过滤示例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/block-filtering) +[区块过滤示例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-block-filtering) -[Validator 奖励示例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-rewards) +[Validator 奖励示例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards) -[Validator Delegations Example](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/validator-delegations) +[Validator Delegations Example](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-delegations) -[Osmosis 代币交换示例](https://github.com/graphprotocol/example-subgraphs/tree/main/cosmos/osmosis-token-swaps) +[Osmosis代币交换示例](https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-osmosis-token-swaps) diff --git a/website/pages/zh/cookbook/near.mdx b/website/pages/zh/cookbook/near.mdx index f723bdcbc97a..18e54ba64d24 100644 --- a/website/pages/zh/cookbook/near.mdx +++ b/website/pages/zh/cookbook/near.mdx @@ -235,9 +235,9 @@ The GraphQL endpoint for NEAR subgraphs is determined by the schema definition, 以下是一些示例子图供参考: -[NEAR Blocks](https://github.com/graphprotocol/example-subgraphs/tree/main/near/blocks-example) +[NEAR Blocks](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-blocks) -[NEAR Receipts](https://github.com/graphprotocol/example-subgraphs/tree/main/near/receipts-example) +[NEAR Receipts](https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts) ## 常见问题 diff --git a/website/pages/zh/cookbook/quick-start.mdx b/website/pages/zh/cookbook/quick-start.mdx index bc95134ad8ac..094a6a85de84 100644 --- a/website/pages/zh/cookbook/quick-start.mdx +++ b/website/pages/zh/cookbook/quick-start.mdx @@ -6,23 +6,23 @@ title: 快速开始 确保您的子图将索引来自[支持的网络](/developing/supported-networks)的数据。 -This guide is written assuming that you have: +本指南是在假设您具备以下条件的情况下编写的: -- A smart contract address on the network of your choice -- GRT to curate your subgraph -- A crypto wallet +- 您选择的网络上的智能合约地址 +- GRT来策划你的子图 +- 一个加密钱包 -## 1. Create a subgraph on Subgraph Studio +## 1. 在子图工作室中创建子图 进入子图工作室 [https://thegraph.com/studio/](https://thegraph.com/studio/) 并连接钱包。 -Once connected, you can begin by clicking “create a subgraph.” Select the network of your choice and click continue. +连接后,您可以单击“创建子图”开始。选择您选择的网络,然后单击“继续”。 -## 2. Install the Graph CLI +## 2. 安装 Graph CLI Graph CLI 是用 JavaScript 编写的,需要安装`npm` 或`yarn` 来使用。 -On your local machine, run one of the following commands: +在本地计算机上,运行以下命令之一: ```sh # NPM @@ -32,34 +32,34 @@ $ npm install -g @graphprotocol/graph-cli $ yarn global add @graphprotocol/graph-cli ``` -## 3. Initialize your Subgraph +## 3. 初始化子图 -> You can find commands for your specific subgraph on the subgraph page in [Subgraph Studio](https://thegraph.com/studio/). +> 您可以在[subgraph Studio](https://thegraph.com/studio/)的子图页面上找到子图的特定命令。 -When you initialize your subgraph, the CLI tool will ask you for the following information: +初始化子图时,CLI工具会要求您提供以下信息: -- Protocol: choose the protocol your subgraph will be indexing data from +- 协议:选择子图索引数据的协议 - Subgraph slug: create a name for your subgraph. Your subgraph slug is an identifier for your subgraph. -- Directory to create the subgraph in: choose your local directory -- Ethereum network(optional): you may need to specify which EVM-compatible network your subgraph will be indexing data from -- Contract address: Locate the smart contract address you’d like to query data from -- ABI: If the ABI is not autopopulated, you will need to input it manually as a JSON file -- Start Block: it is suggested that you input the start block to save time while your subgraph indexes blockchain data. You can locate the start block by finding the block where your contract was deployed. -- Contract Name: input the name of your contract -- Index contract events as entities: it is suggested that you set this to true as it will automatically add mappings to your subgraph for every emitted event -- Add another contract(optional): you can add another contract +- 创建子图的目录:选择您的本地目录 +- 以太坊网络(可选):您可能需要指定子图将从哪个EVM兼容网络索引数据 +- 合约地址:找到要查询数据的智能合约地址 +- ABI:如果ABI不是自动填充的,则需要将其手动输入为JSON文件 +- 起始区块:建议您在子图索引区块链数据时输入起始区块以节省时间。您可以通过查找部署合约区块来定位起始区块。 +- 合约名称:输入您的合约名称 +- 将合约事件作为实体进行索引:建议您将其设置为true,因为它将自动为每个发出的事件向子图添加映射 +- 添加其他合约(可选):您可以添加其他合约 -Initialize your subgraph from an existing contract by running the following command: +通过运行以下命令从现有合约初始化子图: ```sh graph init --studio ``` -See the following screenshot for an example for what to expect when initializing your subgraph: +请参阅下面的屏幕截图,以获取初始化子图时所需的示例: ![子图命令](/img/subgraph-init-example.png) -## 4. Write your Subgraph +## 4. 编写子图 前面的命令创建了一个原始子图,可以将其用作构建子图的起点。当对子图进行更改时,将主要使用三个文件: @@ -69,9 +69,9 @@ See the following screenshot for an example for what to expect when initializing 关于如何编写子图的更多信息,请参见 [创建子图](/developing/creating-a-subgraph) -## 5. Deploy to the Subgraph Studio +## 5. 部署到子图工作室 -Once your subgraph is written, run the following commands: +一旦您的子图被编写好,请运行以下命令: ```sh $ graph codegen @@ -85,17 +85,17 @@ $ graph auth --studio $ graph deploy --studio ``` -You will be asked for a version label. It's strongly recommended to use [semver](https://semver.org/) for versioning like `0.0.1`. That said, you are free to choose any string as version such as:`v1`, `version1`, `asdf`. +您将被要求提供版本标签。强烈建议使用[semver](https://semver.org/)进行版本控制,如`0.0.1`。也就是说,您可以自由选择任何字符串作为版本,例如:`v1`、`version1`、`asdf`。 -## 6. Test your subgraph +## 6. 测试子图 -You can test your subgraph by making a sample query in the playground section. +您可以通过在playground部分进行示例查询来测试子图。 -The logs will tell you if there are any errors with your subgraph. The logs of an operational subgraph will look like this: +日志会告诉你你的子图是否有任何错误。操作子图的日志如下所示: -![Subgraph logs](/img/subgraph-logs-image.png) +![子图日志](/img/subgraph-logs-image.png) -If your subgraph is failing, you can query the subgraph health by using the GraphiQL Playground. Note that you can leverage the query below and input your deployment ID for your subgraph. In this case, `Qm...` is the deployment ID (which can be located on the Subgraph page under **Details**). The query below will tell you when a subgraph fails, so you can debug accordingly: +如果子图失败了,可以通过使用 GraphiQL Playground查询子图的健康状况。注意,你可以利用下面的查询,输入你的子图的部署 ID。在这种情况下,`Qm... `是部署 ID(可以在子图页面的**详细信息**下找到)。下面的查询会提示,当一个子图失败时,则可进行相应调试。 ```graphql { @@ -139,26 +139,26 @@ If your subgraph is failing, you can query the subgraph health by using the Grap } ``` -## 7. Publish Your Subgraph to The Graph’s Decentralized Network +## 7. 将你的子图发布到Graph的去中心化网络 -Once your subgraph has been deployed to the Subgraph Studio, you have tested it out, and are ready to put it into production, you can then publish it to the decentralized network. +一旦你的子图被部署到子图工作室,你已经测试了它,并准备把它投入生产,你就可以把它发布到去中心化的网络。 -In the Subgraph Studio, click on your subgraph. On the subgraph’s page, you will be able to click the publish button on the top right. +在子图工作室中,单击您的子图。在子图的页面上,您可以单击右上角的发布按钮。 -Select the network you would like to publish your subgraph to. It is recommended to publish subgraphs to Arbitrum One to take advantage of the [faster transaction speeds and lower gas costs](../arbitrum-faq). +选择要发布子图的网络。建议将子图发布到Arbitrum One,以利用[更快的交易速度和更低的gas成本](../arbitrum-faq)。 -Before you can query your subgraph, Indexers need to begin serving queries on it. In order to streamline this process, you can curate your own subgraph using GRT. +在你可以查询你的子图之前,索引人需要开始在上面提供查询。为了简化这个过程,你可以使用GRT来策展你自己的子图。 -At the time of writing, it is recommended that you curate your own subgraph with 10,000 GRT to ensure that it is indexed and available for querying as soon as possible. +在撰写本文时,建议您用10000 GRT策展自己的子图,以确保它被索引并可尽快查询。 -To save on gas costs, you can curate your subgraph in the same transaction that you published it by selecting this button when you publish your subgraph to The Graph’s decentralized network: +为了节省gas成本,您可以在将子图发布到Graph的去中心化网络时选择此按钮,在发布子图的同一交易中策展子图: -![Subgraph publish](/img/publish-and-signal-tx.png) +![子图发布](/img/publish-and-signal-tx.png) -## 8. Query your Subgraph +## 8. 查询子图 -Now, you can query your subgraph by sending GraphQL queries to your subgraph’s Query URL, which you can find by clicking on the query button. +现在,您可以通过将GraphQL查询发送到子图的查询URL来查询子图,您可以单击查询按钮找到该查询URL。 -You can query from your dapp if you don't have your API key via the free, rate-limited temporary query URL that can be used for development and staging. +如果你没有你的API密钥,你可以通过免费的、速率有限的临时查询URL从你的去中心化应用查询,该URL可用于开发和暂存。 -For more information about querying data from your subgraph, read more [here](../querying/querying-the-graph/). +有关从子图查询数据的更多信息,请在此处阅读更多信息。

    diff --git a/website/pages/zh/cookbook/subgraph-debug-forking.mdx b/website/pages/zh/cookbook/subgraph-debug-forking.mdx index 48ed6cb0d18a..6973443971e1 100644 --- a/website/pages/zh/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/zh/cookbook/subgraph-debug-forking.mdx @@ -18,7 +18,7 @@ In a nutshell, we are going to _fork the failing subgraph_ from a remote Graph n ## Please, show me some code! -To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/example-subgraphs/tree/main/ethereum/gravatar) indexing the Ethereum Gravity smart contract. +To stay focused on subgraph debugging, let's keep things simple and run along with the [example-subgraph](https://github.com/graphprotocol/graph-tooling/tree/main/examples/ethereum-gravatar) indexing the Ethereum Gravity smart contract. 以下是索引 `Gravatar` 定义的处理程序,没有任何错误: @@ -44,7 +44,7 @@ export function handleUpdatedGravatar(event: UpdatedGravatar): void { } ``` -糟糕,不幸的是,当我将完美的子图部署到 [托管服务](https://thegraph.com/hosted-service/) 时,它会报*“未找到 Gravatar!”* 的错误。 +糟糕,不幸的是,当我将完美的子图部署到 [托管服务](https://thegraph.com/hosted-service/) 时,它会报_“未找到 Gravatar!”_ 的错误。 The usual way to attempt a fix is: @@ -69,7 +69,7 @@ Now, you may have 2 questions: And I answer: -1. `子分叉集` 是“基础”URL,例如将 _子图 id_ 添加到结果 URL (`<子分叉集>/`) ,就是一个合法的子图 GraphQL 访问端口。 +1. `子分叉集` 是“基础”URL,例如将 _子图 id_ 添加到结果 URL (`<子分叉集>/`) ,就是一个合法的子图GraphQL访问端口。 2. Forking is easy, no need to sweat: ```bash @@ -80,7 +80,7 @@ Also, don't forget to set the `dataSources.source.startBlock` field in the subgr 所以,我是这么做的: -0. 我启动一个本地 Graph 节点([这里是如何做到的](https://github.com/graphprotocol/graph-node#running-a-local-graph-node)) 将 `子分叉集` 选项设为:`https://api.thegraph.com/subgraphs/id/`,因为我将从 [托管服务](https://thegraph.com/hosted-service/)分叉子图,即之前部署有问题的子图。 +0. 我启动一个本地Graph节点([这里是如何做到的](https://github.com/graphprotocol/graph-node#running-a-local-graph-node)) 将 `子分叉集` 选项设为:`https://api.thegraph.com/subgraphs/id/`,因为我将从 [托管服务](https://thegraph.com/hosted-service/)分叉子图,即之前部署有问题的子图。 ``` $ cargo run -p graph-node --release -- \ diff --git a/website/pages/zh/deploying/subgraph-studio-faqs.mdx b/website/pages/zh/deploying/subgraph-studio-faqs.mdx index 52b170ef59d9..18c0ae968db2 100644 --- a/website/pages/zh/deploying/subgraph-studio-faqs.mdx +++ b/website/pages/zh/deploying/subgraph-studio-faqs.mdx @@ -8,7 +8,7 @@ title: Subgraph Studio FAQs ## 2. How do I create an API Key? -要创建 API,请导航到 Subgraph Studio 并连接您的钱包。您将能够单击顶部的 API 密钥选项卡。在那里,您将能够创建 API 密钥。 +要创建API,请导航到Subgraph Studio并连接您的钱包。您将能够单击顶部的API密钥选项卡。在那里,您将能够创建API密钥。 ## 3. Can I create multiple API Keys? diff --git a/website/pages/zh/developing/creating-a-subgraph.mdx b/website/pages/zh/developing/creating-a-subgraph.mdx index cd86514acec5..e890c123c878 100644 --- a/website/pages/zh/developing/creating-a-subgraph.mdx +++ b/website/pages/zh/developing/creating-a-subgraph.mdx @@ -14,7 +14,7 @@ title: 创建子图 - `AssemblyScript映射`: 将事件数据转换为模式中定义的实体(例如本教程中的`mapping.ts`)的 [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) 代码 -> 为了在 Graph 的去中心化网络上使用子图,您需要[创建一个 API 密钥](/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key)。建议您将至少[10000 GRT](/network-transition-faq/#how-can-i-ensure-that-my-subgraph-will-be-picked-up-by-indexer-on-the-graph-network)的[信号添加](/network/curating/#how-to-signal)到子图中。 +> 为了在Graph的去中心化网络上使用子图,您需要[创建一个API密钥](/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key)。建议您将至少[10000 GRT](/network-transition-faq/#how-can-i-ensure-that-my-subgraph-will-be-picked-up-by-indexer-on-the-graph-network)的[信号添加](/network/curating/#how-to-signal)到子图中。 在详细了解清单文件的内容之前,您需要安装[Graph CLI](https://github.com/graphprotocol/graph-cli),以构建和部署子图。 @@ -98,7 +98,7 @@ The contract `address` will be written to the `networks.json` for the relevant n ```yaml specVersion: 0.0.4 description: Gravatar for Ethereum -repository: https://github.com/graphprotocol/example-subgraphs +repository: https://github.com/graphprotocol/graph-tooling schema: file: ./schema.graphql dataSources: @@ -236,14 +236,14 @@ For some entity types the `id` is constructed from the id's of two other entitie We support the following scalars in our GraphQL API: -| 类型 | 描述 | -| --- | --- | -| `字节` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | -| `字符串` | Scalar for `string` values. Null characters are not supported and are automatically removed. | -| `Boolean` | Scalar for `boolean` values. | -| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | -| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | -| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | +| 类型 | 描述 | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `字节` | Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. | +| `字符串` | Scalar for `string` values. Null characters are not supported and are automatically removed. | +| `Boolean` | Scalar for `boolean` values. | +| `Int` | The GraphQL spec defines `Int` to have a size of 32 bytes. | +| `BigInt` | Large integers. Used for Ethereum's `uint32`, `int64`, `uint64`, ..., `uint256` types. Note: Everything below `uint32`, such as `int32`, `uint24` or `int8` is represented as `i32`. | +| `BigDecimal` | `BigDecimal` High precision decimals represented as a significand and an exponent. The exponent range is from −6143 to +6144. Rounded to 34 significant digits. | #### 枚举类型 @@ -445,33 +445,33 @@ Choosing a different language will have a definitive, though sometimes subtle, e Supported language dictionaries: -| 代码 | 词典 | +| 代码 | 词典 | | ------ | ---------- | -| simple | 通用 | -| da | 丹麦语 | -| nl | 荷兰语 | -| en | 英语 | -| fi | 芬兰语 | -| fr | 法语 | -| de | 德语 | -| hu | 匈牙利语 | -| it | 意大利语 | -| no | 挪威语 | +| simple | 通用 | +| da | 丹麦语 | +| nl | 荷兰语 | +| en | 英语 | +| fi | 芬兰语 | +| fr | 法语 | +| de | 德语 | +| hu | 匈牙利语 | +| it | 意大利语 | +| no | 挪威语 | | pt | Portuguese | -| ro | 罗马尼亚语 | -| ru | 俄语 | -| es | 西班牙语 | -| sv | 瑞典语 | -| tr | 土耳其语 | +| ro | 罗马尼亚语 | +| ru | 俄语 | +| es | 西班牙语 | +| sv | 瑞典语 | +| tr | 土耳其语 | ### 排序算法 Supported algorithms for ordering results: -| 算法 | 描述 | -| ------------- | --------------------------------------------- | +| 算法 | 描述 | +| ------------- | -------------------------- | | rank | 使用全文查询的匹配质量 (0-1) 对结果进行排序。 | -| proximityRank | 与 rank 类似,但也包括匹配的接近程度。 | +| proximityRank | 与 rank 类似,但也包括匹配的接近程度。 | ## 编写映射 @@ -646,7 +646,7 @@ export function handleNewExchange(event: NewExchange): void { ``` > **Note:** A new data source will only process the calls and events for the block in which it was created and all following blocks, but will not process historical data, i.e., data that is contained in prior blocks. -> +> > 如果先前的区块包含与新数据源相关的数据,最好通过读取合约的当前状态,并在创建新数据源时创建表示该状态的实体来索引该数据。 ### Data Source Context @@ -703,7 +703,7 @@ dataSources: ``` > **Note:** The contract creation block can be quickly looked up on Etherscan: -> +> > 1. 通过在搜索栏中输入合约地址来搜索合约。 > 2. Click on the creation transaction hash in the `Contract Creator` section. > 3. 加载交易详情页面,您将在其中找到该合约的起始区块。 @@ -852,12 +852,12 @@ Inside the handler function, the receipt can be accessed in the `Event.receipt` Starting from `specVersion` `0.0.4`, subgraph features must be explicitly declared in the `features` section at the top level of the manifest file, using their `camelCase` name, as listed in the table below: -| 特征 | 名称 | +| 特征 | 名称 | | ---------------------------------------------------- | --------------------------------------------------- | | [Non-fatal errors](#non-fatal-errors) | `nonFatalErrors` | | [Full-text Search](#defining-fulltext-search-fields) | `fullTextSearch` | | [Grafting](#grafting-onto-existing-subgraphs) | `grafting` | -| [以太坊合约上的 IPFS](#ipfs-on-ethereum-contracts) | `ipfsOnEthereumContracts` or `nonDeterministicIpfs` | +| [以太坊合约上的IPFS](#ipfs-on-ethereum-contracts) | `ipfsOnEthereumContracts` or `nonDeterministicIpfs` | For instance, if a subgraph uses the **Full-Text Search** and the **Non-fatal Errors** features, the `features` field in the manifest should be: @@ -872,13 +872,13 @@ dataSources: ... Note that using a feature without declaring it will incur a **validation error** during subgraph deployment, but no errors will occur if a feature is declared but not used. -### 以太坊合约上的 IPFS +### 以太坊合约上的IPFS A common use case for combining IPFS with Ethereum is to store data on IPFS that would be too expensive to maintain on-chain, and reference the IPFS hash in Ethereum contracts. Given such IPFS hashes, subgraphs can read the corresponding files from IPFS using `ipfs.cat` and `ipfs.map`. To do this reliably, it is required that these files are pinned to an IPFS node with high availability, so that the [hosted service](https://thegraph.com/hosted-service) IPFS node can find them during indexing. -> **注意:** Graph 网络暂不支持`ipfs.cat`和`ipfs.map`,开发者请勿部署使用该功能的子图通过 Studio 连接到网络。 +> **注意:** Graph网络暂不支持`ipfs.cat`和`ipfs.map`,开发者请勿部署使用该功能的子图通过 Studio 连接到网络。 > **[Feature Management](#experimental-features):** `ipfsOnEthereumContracts` must be declared under `features` in the subgraph manifest. For non EVM chains, the `nonDeterministicIpfs` alias can also be used for the same purpose. diff --git a/website/pages/zh/developing/developer-faqs.mdx b/website/pages/zh/developing/developer-faqs.mdx index 9450a2143f01..453cc9ae8bff 100644 --- a/website/pages/zh/developing/developer-faqs.mdx +++ b/website/pages/zh/developing/developer-faqs.mdx @@ -8,7 +8,7 @@ A subgraph is a custom API built on blockchain data. Subgraphs are queried using ## 2. Can I delete my subgraph? -子图一旦创建就无法删除。 +It is not possible to delete subgraphs once they are created. ## 3. Can I change my subgraph name? diff --git a/website/pages/zh/glossary.mdx b/website/pages/zh/glossary.mdx index 2a7c0b281197..85dedd761fe6 100644 --- a/website/pages/zh/glossary.mdx +++ b/website/pages/zh/glossary.mdx @@ -8,6 +8,8 @@ title: Glossary - **GraphQL**: A query language for APIs and a runtime for fulfilling those queries with your existing data. The Graph uses GraphQL to query subgraphs. +- **Endpoint**: A URL that can be used to query a subgraph. The testing endpoint for Subgraph Studio is `https://api.studio.thegraph.com/query///` and the Graph Explorer endpoint is `https://gateway.thegraph.com/api//subgraphs/id/`. The Graph Explorer endpoint is used to query subgraphs on The Graph's decentralized network. + - **Subgraph**: A custom API built on blockchain data that can be queried using [GraphQL](https://graphql.org/). Developers can build, deploy and publish subgraphs to The Graph's decentralized network. Then, Indexers can begin indexing subgraphs to make them available to be queried by subgraph consumers. - **Hosted Service**: A temporary scaffold service for building and querying subgraphs as The Graph's decentralized network is maturing its cost of service, quality of service, and developer experience. diff --git a/website/pages/zh/managing/deprecating-a-subgraph.mdx b/website/pages/zh/managing/deprecating-a-subgraph.mdx index 8908f672753e..7ff325048f72 100644 --- a/website/pages/zh/managing/deprecating-a-subgraph.mdx +++ b/website/pages/zh/managing/deprecating-a-subgraph.mdx @@ -2,17 +2,17 @@ title: Deprecating a Subgraph --- -如果您想在 Graph 浏览器上弃用您的子图,您来对地方了! 请按照以下步骤操作: +如果您想在 Graph浏览器上弃用您的子图,您来对地方了! 请按照以下步骤操作: 1. 在[这里](https://etherscan.io/address/0xadca0dd4729c8ba3acf3e99f3a9f471ef37b6825#writeProxyContract)访问合约地址 -2. Call `deprecateSubgraph` with your `SubgraphID` as your argument. -3. Voilà! Your subgraph will no longer show up on searches on The Graph Explorer. +2. 使用`SubgraphID`作为参数调用` deprecateSubgraph `。 +3. 瞧! 您的子图将不再显示在Graph浏览器上的搜索中。 -Please note the following: +请注意以下事项: -- The `deprecateSubgraph` function should be called by the owner's wallet. -- Curators will not be able to signal on the subgraph anymore. -- Curators that already signaled on the subgraph will be able to withdraw their signal at an average share price. -- Deprecated subgraphs will be indicated with an error message. +- `deprecateSubgraph`函数应该由所有者的钱包调用。 +- 策展人将无法再对该子图发出信号. +- 已经在该子图上发出信号的策展人,将能够以平均价格撤回他们的信号. +- 弃用的子图将显示错误消息。 如果您与现已弃用的子图进行交互,您将能够分别在“子图”、“索引”或“策展”选项卡下的您的用户资料中找到它。 diff --git a/website/pages/zh/network/benefits.mdx b/website/pages/zh/network/benefits.mdx index a70f738469a8..c73c04424c39 100644 --- a/website/pages/zh/network/benefits.mdx +++ b/website/pages/zh/network/benefits.mdx @@ -3,89 +3,89 @@ title: The Graph Network vs. Self Hosting socialImage: https://thegraph.com/docs/img/seo/benefits.jpg --- -The Graph’s decentralized network has been engineered and refined to create a robust indexing and querying experience—and it’s getting better every day thanks to thousands of contributors around the world. +The Graph的去中心化网络经过精心设计和完善,创造了强大的索引和查询体验,由于世界各地成千上万的贡献者,它每天都在变得更好。 -The benefits of this decentralized protocol cannot be replicated by running a `graph-node` locally. The Graph Network is more reliable, more efficient, and less expensive. +这种去中心化协议的好处无法通过在本地运行`graph-节点`来复制。Graph网络更可靠、更高效、更便宜。 -Here is an analysis: +以下是分析: -## 为什么要使用 Graph 网络 +## 为什么要使用Graph网络 -- 60-98% lower monthly cost -- $0 infrastructure setup costs +- 每月成本降低60-98% +- 基础设施设置成本为0美元 - Superior uptime -- Access to 438 Indexers (and counting) -- 24/7 technical support by global community +- 访问438个索引人(还在增加) +- 全球社区24/7的技术支持 ## The Benefits Explained -### Lower & more Flexible Cost Structure - -No contracts. No monthly fees. Only pay for the queries you use—with an average cost-per-query of $0.0002. Queries are priced in USD and paid in GRT. - -Query costs may vary; the quoted cost is the average at time of publication (December 2022). - -## Low Volume User (less than 30,000 queries per month) - -| Cost Comparison | Self Hosted | Graph Network | -| :-: | :-: | :-: | -| Monthly server cost\* | $350 per month | $0 | -| Query costs | $0+ | ~$15 per month | -| Engineering time | $400 per month | None, built into the network with globally distributed Indexers | -| Queries per month | Limited to infra capabilities | 30,000 (autoscaling) | -| Cost per query | $0 | $0.0005 | -| 基础设施 | Centralized | Decentralized | -| Geographic redundancy | $750+ per additional node | Included | -| Uptime | Varies | 99.9%+ | -| Total Monthly Costs | $750+ | ~$15 | - -## Medium Volume User (3,000,000+ queries per month) - -| Cost Comparison | Self Hosted | Graph Network | -| :-: | :-: | :-: | -| Monthly server cost\* | $350 per month | $0 | -| Query costs | $500 per month | $750 per month | -| Engineering time | $800 per month | None, built into the network with globally distributed Indexers | -| Queries per month | Limited to infra capabilities | 3,000,000+ | -| Cost per query | $0 | $0.00025 | -| 基础设施 | Centralized | Decentralized | -| Engineering expense | $200 per hour | Included | -| Geographic redundancy | $1,200 in total costs per additional node | Included | -| Uptime | Varies | 99.9%+ | -| Total Monthly Costs | $1,650+ | $750 | +### 更低& 更灵活的成本结构 + +没有合约。没有月费。只为您使用的查询付费,每次查询的平均成本为0.0002美元。查询以美元计价,以GRT支付。 + +查询成本可能有所不同;报价成本为出版时(2022年12月)的平均值。 + +## 低容量用户(每月少于30,000次查询) + +| 成本比较 | 自托管 | Graph网络 | +|:---------------------:|:---------------------------------------:|:---------------------:| +| 每月服务器费用 \* | 每月350美元 | 0美元 | +| 查询成本 | $0+ | ~15美元每月 | +| 工程时间 | 400美元每月 | 没有,内置在具有全球去中心化索引者的网络中 | +| 每月查询 | 受限于基础设施能力 | 30,000 (autoscaling) | +| 每个查询的成本 | 0美元 | $0.0005 | +| 基础设施 | 中心化 | 去中心化 | +| Geographic redundancy | 每个额外节点 $750 + | 包括在内 | +| 正常工作时间 | 变量 | 99.9%+ | +| 每月总成本 | $750+ | ~$15 | + +## 中等容量用户(每月超过3,000,000次查询) + +| 成本比较 | 自托管 | Graph网络 | +|:---------------------:|:-------------------------------------------:|:---------------------:| +| 每月服务器费用 \* | 每月350美元 | 0美元 | +| 查询成本 | 每月500美元 | 每月750美元 | +| 工程时间 | 每月800美元 | 没有,内置在具有全球去中心化索引者的网络中 | +| 每月查询 | 受限于基础设施能力 | 3,000,000+ | +| 每个查询的成本 | 0美元 | 0.00025美元 | +| 基础设施 | 中心化 | 去中心化 | +| 工程费用 | 每小时200美元 | 包括在内 | +| Geographic redundancy | 每个额外节点的总成本为1200美元 | 包括在内 | +| 正常工作时间 | 变量 | 99.9%+ | +| 每月总成本 | 1650美元以上 | 750美元 | ## High Volume User (30,000,000+ queries per month) -| Cost Comparison | Self Hosted | Graph Network | -| :-: | :-: | :-: | -| Monthly server cost\* | $1100 per month, per node | $0 | -| Query costs | $4000 | $4,500 per month | -| Number of nodes needed | 10 | Not applicable | -| Engineering time | $6,000 or more per month | None, built into the network with globally distributed Indexers | -| Queries per month | Limited to infra capabilities | 30,000,000+ | -| Cost per query | $0 | $0.00015 | -| 基础设施 | Centralized | Decentralized | -| Geographic redundancy | $1,200 in total costs per additional node | Included | -| Uptime | Varies | 99.9%+ | -| Total Monthly Costs | $11,000+ | $4,500 | +| 成本比较 | 自托管 | Graph网络 | +|:----------------------:|:-------------------------------------------:|:---------------------:| +| 每月服务器费用 \* | $1100 per month, per node | 0美元 | +| 查询成本 | 4000美元 | 4500美元每月 | +| Number of nodes needed | 10 | 不适用 | +| 工程时间 | 每月6000美元或以上 | 没有,内置在具有全球去中心化索引者的网络中 | +| 每月查询 | 受限于基础设施能力 | 30,000,000+ | +| 每个查询的成本 | 0美元 | 0.00015美元 | +| 基础设施 | 中心化 | 去中心化 | +| Geographic redundancy | 每个额外节点的总成本为1200美元 | 包括在内 | +| 正常工作时间 | 变量 | 99.9%+ | +| 每月总成本 | 11000+美元 | 4500美元 | -\*including costs for backup: $50-$100 per month +* 包括后备费用: 每月$50-$100美元 -Engineering time based on $200 per hour assumption +按每小时200美元的假设计算的工程时间 -using the max query budget function in the budget billing tab, while maintaining high quality of service +使用预算账单标签中的最大查询预算函数,同时保持高质量的服务 Estimated costs are only for Ethereum Mainnet subgraphs — costs are even higher when self hosting a `graph-node` on other networks. -Curating signal on a subgraph is an optional one-time, net-zero cost (e.g., $1k in signal can be curated on a subgraph, and later withdrawn—with potential to earn returns in the process). +在一个子图上策划信号是一个可选一次性净零成本(例如,1千美元的信号可以在一个子图上管理,然后撤回ーー在这个过程中有可能获得回报)。 -Some users may need to upgrade subgraphs. Due to Ethereum gas fees, upgrades cost ~$50 per upgrade at time of this writing. +一些用户可能需要升级子图。由于以太坊gas费用,在撰写本文时,每次升级的费用约为50美元。 -## No Setup Costs & Greater Operational Efficiency +## 无安装成本和更高的运行效率 -Zero setup fees. Get started immediately with no setup or overhead costs. No hardware requirements. No outages due to centralized infrastructure, and more time to concentrate on your core product . No need for backup servers, troubleshooting, or expensive engineering resources. +零安装费。立即开始,没有设置或间接费用。没有硬件要求。没有由于集中式基础设施而导致的中断,并且有更多的时间专注于您的核心产品。不需要备份服务器、故障排除或昂贵的工程资源。 -## Reliability & Resiliency +## 可靠性和弹性 The Graph’s decentralized network gives users access to geographic redundancy that does not exist when self-hosting a `graph-node`. Queries are served reliably thanks to 99.9%+ uptime, achieved by 168 Indexers (and counting) securing the network globally. diff --git a/website/pages/zh/network/explorer.mdx b/website/pages/zh/network/explorer.mdx index a2c1c7bd8bb1..d347cf2c2d37 100644 --- a/website/pages/zh/network/explorer.mdx +++ b/website/pages/zh/network/explorer.mdx @@ -87,7 +87,7 @@ If you want to learn more about the Curator role, you can do so by visiting the - 目前在协议中的 GRT 总量 - 上次授权的日期 -If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/network/delegators). +If you want to learn more about how to become a Delegator, look no further! All you have to do is to head over to the [official documentation](/network/delegating) or [The Graph Academy](https://docs.thegraph.academy/official-docs/delegator/choosing-indexers). ## Network @@ -158,7 +158,7 @@ Now that we’ve talked about the network stats, let’s move on to your persona ### 委托标签 -委托人对 Graph 网络很重要。 委托人必须利用他们的知识来选择能够提供健康回报的索引人。 在这里,您可以找到您的活动和历史委托的详细信息,以及您委托给的索引人的指标。 +委托人对Graph 网络很重要。 委托人必须利用他们的知识来选择能够提供健康回报的索引人。 在这里,您可以找到您的活动和历史委托的详细信息,以及您委托给的索引人的指标。 在页面的前半部分,您可以看到您的委托图表,以及仅奖励图表。 在左侧,您可以看到反映您当前委托指标的 KPI。 @@ -178,7 +178,7 @@ Keep in mind that this chart is horizontally scrollable, so if you scroll all th ### 策展标签 -在 策展选项卡中,您将找到您正在发送信号的所有子图(从而使您能够接收查询费用)。 信号允许策展人向索引人突出显示哪些子图有价值和值得信赖,从而表明它们需要被索引。 +在策展选项卡中,您将找到您正在发送信号的所有子图(从而使您能够接收查询费用)。 信号允许策展人向索引人突出显示哪些子图有价值和值得信赖,从而表明它们需要被索引。 在此选项卡中,您将找到以下内容的概述: diff --git a/website/pages/zh/operating-graph-node.mdx b/website/pages/zh/operating-graph-node.mdx index 782764793c3a..6ecc96a0e9fb 100644 --- a/website/pages/zh/operating-graph-node.mdx +++ b/website/pages/zh/operating-graph-node.mdx @@ -4,17 +4,17 @@ title: Operating Graph Node Graph Node is the component which indexes subgraphs, and makes the resulting data available to query via a GraphQL API. As such it is central to the indexer stack, and correct operation of Graph Node is crucial to running a successful indexer. -这提供了 Graph 节点的背景概述,以及索引人可用的一些更高级的选项。可以在[Graph 节点存储库](https://github.com/graphprotocol/graph-node)中找到详细的文档和说明。 +这提供了Graph节点的背景概述,以及索引人可用的一些更高级的选项。可以在[Graph 节点存储库](https://github.com/graphprotocol/graph-node)中找到详细的文档和说明。 ## Graph 节点 -[Graph Node](https://github.com/graphprotocol/graph-node)是 Graph Network 上索引子图、连接到区块链客户端、索引子图并使索引数据可供查询的参考实现。 +[Graph Node](https://github.com/graphprotocol/graph-node)是Graph Network上索引子图、连接到区块链客户端、索引子图并使索引数据可供查询的参考实现。 -Graph Node(以及整个索引人堆栈)可以在裸机上运行,也可以在云环境中运行。中央索引组件的这种灵活性对于图形协议的有力性至关重要。类似地,Graph Node 可以从[源代码构建](https://github.com/graphprotocol/graph-node),或者索引人可以使用[提供的 Docker Images](https://hub.docker.com/r/graphprotocol/graph-node)之一。 +Graph Node(以及整个索引人堆栈)可以在裸机上运行,也可以在云环境中运行。中央索引组件的这种灵活性对于图形协议的有力性至关重要。类似地,Graph Node可以从[源代码构建](https://github.com/graphprotocol/graph-node),或者索引人可以使用[提供的Docker Images](https://hub.docker.com/r/graphprotocol/graph-node)之一。 ### PostgreSQL 数据库 -Graph 节点的主存储区,这是存储子图数据、子图元数据以及子图不可知的网络数据(如区块缓存和 eth_call 缓存)的地方。 +Graph节点的主存储区,这是存储子图数据、子图元数据以及子图不可知的网络数据(如区块缓存和eth_call缓存)的地方。 ### 网络客户端 @@ -24,9 +24,9 @@ While some subgraphs may just require a full node, some may have indexing featur **Upcoming: Network Firehoses** - a Firehose is a gRPC service providing an ordered, yet fork-aware, stream of blocks, developed by The Graph's core developers to better support performant indexing at scale. This is not currently an indexer requirement, but Indexers are encouraged to familiarise themselves with the technology, ahead of full network support. Learn more about the Firehose [here](https://firehose.streamingfast.io/). -### IPFS 节点 +### IPFS节点 -子图部署元数据存储在 IPFS 网络上。Graph 节点主要在子图部署期间访问 IPFS 节点,以获取子图清单和所有链接文件。网络索引者不需要托管自己的 IPFS 节点。网络的 IPFS 节点托管于https://ipfs.network.thegraph.com。 +子图部署元数据存储在IPFS网络上。Graph节点主要在子图部署期间访问IPFS节点,以获取子图清单和所有链接文件。网络索引者不需要托管自己的IPFS节点。网络的IPFS节点托管于https://ipfs.network.thegraph.com。 ### Prometheus metrics server @@ -73,7 +73,7 @@ cargo run -p graph-node --release -- \ #### 先决条件 -- **以太坊节点**-在默认情况下,docker compose 设置将使用 mainnet:[http://host.docker.internal:8545](http://host.docker.internal:8545)连接到主机上的以太坊节点。您可以通过更新`docker-compose.yml`来替换此网络名称和 url。 +- **以太坊节点**-在默认情况下,docker compose设置将使用mainnet:[http://host.docker.internal:8545](http://host.docker.internal:8545)连接到主机上的以太坊节点。您可以通过更新`docker-compose.yml`来替换此网络名称和url。 #### 设置 @@ -96,37 +96,37 @@ cd graph-node/docker docker-compose up ``` -### Kubernetes 入门 +### Kubernetes入门 -完整的 Kubernetes 示例配置可以在[索引人存储库](https://github.com/graphprotocol/indexer/tree/main/k8s)中找到。 +完整的Kubernetes示例配置可以在[索引人存储库](https://github.com/graphprotocol/indexer/tree/main/k8s)中找到。 ### 端口 -当运行 Graph Node 时,会暴露以下端口: +当运行Graph Node时,会暴露以下端口: -| 端口 | 用途 | 路径 | CLI 参数 | Environment Variable | -| --- | --- | --- | --- | --- | -| 8000 | GraphQL HTTP 服务
    (用于子图查询) | /subgraphs/id/...

    /subgraphs/name/.../... | --http-port | - | -| 8001 | GraphQL WS
    (用于子图订阅) | /subgraphs/id/...

    /subgraphs/name/.../... | --ws-port | - | -| 8020 | JSON-RPC
    (用于管理部署) | / | --admin-port | - | -| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | -| 8040 | Prometheus 指标 | /metrics | --metrics-port | - | +| 端口 | 用途 | 路径 | CLI 参数 | Environment Variable | +| ---- | ------------------------------------ | ------------------------------------------------------------------- | ----------------- | -------------------- | +| 8000 | GraphQL HTTP 服务
    (用于子图查询) | /subgraphs/id/...

    /subgraphs/name/.../... | --http-port | - | +| 8001 | GraphQL WS
    (用于子图订阅) | /subgraphs/id/...

    /subgraphs/name/.../... | --ws-port | - | +| 8020 | JSON-RPC
    (用于管理部署) | / | --admin-port | - | +| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - | +| 8040 | Prometheus 指标 | /metrics | --metrics-port | - | > **重要**: 公开暴露端口时要小心 - **管理端口** 应保持锁定。 这包括下面详述的 Graph 节点 JSON-RPC 和索引人管理端点。 ## Advanced Graph Node configuration -最简单的是,Graph 节点可以使用 Graph 节点的单个实例、单个 PostgreSQL 数据库、IPFS 节点和要索引的子图所需的网络客户端来操作。 +最简单的是,Graph节点可以使用Graph节点的单个实例、单个PostgreSQL数据库、IPFS节点和要索引的子图所需的网络客户端来操作。 This setup can be scaled horizontally, by adding multiple Graph Nodes, and multiple databases to support those Graph Nodes. Advanced users may want to take advantage of some of the horizontal scaling capabilities of Graph Node, as well as some of the more advanced configuration options, via the `config.toml` file and Graph Node's environment variables. ### `config.toml` -[TOML](https://toml.io/en/)配置文件可用于设置比 CLI 中公开的配置更复杂的配置。文件的位置通过--config 命令行开关传递。 +[TOML](https://toml.io/en/)配置文件可用于设置比CLI中公开的配置更复杂的配置。文件的位置通过--config命令行开关传递。 -> 使用配置文件时,不能使用选项--postgres-url、--postgres-secondary-hosts 和--postgres-host-weights。 +> 使用配置文件时,不能使用选项--postgres-url、--postgres-secondary-hosts和--postgres-host-weights。 -可以提供最小的`config.toml`文件;以下文件等效于使用--postgres-url 命令行选项: +可以提供最小的`config.toml`文件;以下文件等效于使用--postgres-url命令行选项: ```toml [store] @@ -137,11 +137,11 @@ connection="<.. postgres-url argument ..>" indexers = [ "<.. list of all indexing nodes ..>" ] ``` -`config.toml`的完整文档可以在[Graph Node 文档](https://github.com/graphprotocol/graph-node/blob/master/docs/config.md)中找到。 +`config.toml`的完整文档可以在[Graph Node文档](https://github.com/graphprotocol/graph-node/blob/master/docs/config.md)中找到。 #### Multiple Graph Nodes -Graph 节点索引可以水平扩展,运行 Graph 节点的多个实例以在不同节点之间拆分索引和查询。这只需在启动时运行配置有不同`node_id`的 Graph Nodes(例如 Docker Compose 文件中)即可完成,然后可以在`config.toml`文件中使用该节点来[指定专用查询节点](#dedicated-query-nodes)、[区块摄取器](#dedicated-block-ingestor),并使用[部署规则](#deployment-rules)在节点之间拆分子图。 +Graph节点索引可以水平扩展,运行Graph节点的多个实例以在不同节点之间拆分索引和查询。这只需在启动时运行配置有不同`node_id`的Graph Nodes(例如Docker Compose文件中)即可完成,然后可以在`config.toml`文件中使用该节点来[指定专用查询节点](#dedicated-query-nodes)、[区块摄取器](#dedicated-block-ingestor),并使用[部署规则](#deployment-rules)在节点之间拆分子图。 > Note that multiple Graph Nodes can all be configured to use the same database, which itself can be horizontally scaled via sharding. @@ -188,7 +188,7 @@ indexers = [ query = "" ``` -任何--node-id 与正则表达式匹配的节点都将被设置为只响应查询。 +任何--node-id与正则表达式匹配的节点都将被设置为只响应查询。 #### 通过分片扩展数据库 @@ -215,11 +215,11 @@ ingestor = "block_ingestor_node" #### 支持多个网络 -Graph 协议正在增加支持索引奖励的网络数量,并且存在许多索引不支持的网络的子图,索引人希望处理这些子图。`config.toml`文件允许表达和灵活配置: +Graph协议正在增加支持索引奖励的网络数量,并且存在许多索引不支持的网络的子图,索引人希望处理这些子图。`config.toml`文件允许表达和灵活配置: - 多个网络。 - Multiple providers per network (this can allow splitting of load across providers, and can also allow for configuration of full nodes as well as archive nodes, with Graph Node preferring cheaper providers if a given workload allows). -- 其他提供商详细信息,如特征、身份验证和提供程序类型(用于实验性 Firehose 支持)。 +- 其他提供商详细信息,如特征、身份验证和提供程序类型(用于实验性Firehose支持)。 The `[chains]` section controls the ethereum providers that graph-node connects to, and where blocks and other metadata for each chain are stored. The following example configures two chains, mainnet and kovan, where blocks for mainnet are stored in the vip shard and blocks for kovan are stored in the primary shard. The mainnet chain can use two different providers, whereas kovan only has one provider. @@ -241,44 +241,44 @@ provider = [ { label = "kovan", url = "http://..", features = [] } ] ### Environment variables -Graph 节点支持一系列环境变量,这些变量可以启用特征或更改 Graph 节点的行为。这些都记录在[这里](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md)。 +Graph节点支持一系列环境变量,这些变量可以启用特征或更改Graph节点的行为。这些都记录在[这里](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md)。 ### 持续部署 -使用高级配置操作缩放索引设置的用户可以从使用 Kubernetes 管理 Graph 节点中受益。 +使用高级配置操作缩放索引设置的用户可以从使用Kubernetes管理Graph节点中受益。 -- 索引者存储库有一个示例[Kubernetes 引用](https://github.com/graphprotocol/indexer/tree/main/k8s) -- [Launchpad](https://docs.graphops.xyz/launchpad/intro)是一个工具包,用于在 GraphOps 维护的 Kubernetes 上运行 Graph Protocol Indexer。它提供了一组 Helm 图表和一个 CLI 来管理 Graph Node 部署。 +- 索引者存储库有一个示例[Kubernetes引用](https://github.com/graphprotocol/indexer/tree/main/k8s) +- [Launchpad](https://docs.graphops.xyz/launchpad/intro)是一个工具包,用于在GraphOps维护的Kubernetes上运行Graph Protocol Indexer。它提供了一组Helm图表和一个CLI来管理Graph Node部署。 -### 管理 Graph 节点 +### 管理Graph节点 Given a running Graph Node (or Graph Nodes!), the challenge is then to manage deployed subgraphs across those nodes. Graph Node surfaces a range of tools to help with managing subgraphs. #### 日志 -Graph 节点的日志可以为 Graph 节点和特定子图的调试和优化提供有用的信息。Graph 节点通过`GRAPH_LOG`环境变量支持不同的日志级别,具有以下级别:错误、警告、信息、调试或跟踪。 +Graph节点的日志可以为Graph节点和特定子图的调试和优化提供有用的信息。Graph节点通过`GRAPH_LOG`环境变量支持不同的日志级别,具有以下级别:错误、警告、信息、调试或跟踪。 -此外,将`GRAPH_LOG_QUERY_TIMING`设置为`gql`提供了有关 GraphQL 查询如何运行的更多详细信息(尽管这将生成大量日志)。 +此外,将`GRAPH_LOG_QUERY_TIMING`设置为`gql`提供了有关GraphQL查询如何运行的更多详细信息(尽管这将生成大量日志)。 #### 监控& 警报 Graph Node provides the metrics via Prometheus endpoint on 8040 port by default. Grafana can then be used to visualise these metrics. -索引人存储库提供了[Grafana 配置示例](https://github.com/graphprotocol/indexer/blob/main/k8s/base/grafana.yaml)。 +索引人存储库提供了[Grafana配置示例](https://github.com/graphprotocol/indexer/blob/main/k8s/base/grafana.yaml)。 #### Graphman -`graphman`是 Graph 节点的维护工具,帮助诊断和解决不同的日常和异常任务。 +`graphman`是Graph节点的维护工具,帮助诊断和解决不同的日常和异常任务。 The graphman command is included in the official containers, and you can docker exec into your graph-node container to run it. It requires a `config.toml` file. -Graph 节点存储库中提供了`graphman`命令的完整文档。参见\[/docs/graphman.md\] (https://github.com/graphprotocol/graph-node/blob/master/docs/graphman.md)Graph节点`/docs` +Graph节点存储库中提供了`graphman`命令的完整文档。参见\[/docs/graphman.md\] (https://github.com/graphprotocol/graph-node/blob/master/docs/graphman.md)Graph节点`/docs` ### 使用子图 -#### 索引状态 API +#### 索引状态API -默认情况下,在端口 8030/graphql 上可用,索引状态 API 公开了一系列方法,用于检查不同子图的索引状态、检查索引证明、检查子图特征等。 +默认情况下,在端口8030/graphql上可用,索引状态API公开了一系列方法,用于检查不同子图的索引状态、检查索引证明、检查子图特征等。 [此处](https://github.com/graphprotocol/graph-node/blob/master/server/index-node/src/schema.graphql)提供完整的模式。 @@ -310,19 +310,19 @@ Subgraph indexing metrics can help diagnose the root cause of indexing slowness. 在为子图编制索引期间,如果遇到意外数据、某些组件未按预期工作,或者事件处理程序或配置中存在错误,则子图可能会失败。有两种常见的故障类型: - 确定性故障:这些故障不会通过重试解决 -- 非确定性故障:这些故障可能是由于提供程序的问题,或者是一些意外的 Graph 节点错误。当发生非确定性故障时,Graph 节点将重试失败的处理程序,并随着时间的推移而后退。 +- 非确定性故障:这些故障可能是由于提供程序的问题,或者是一些意外的Graph节点错误。当发生非确定性故障时,Graph节点将重试失败的处理程序,并随着时间的推移而后退。 在某些情况下,索引人可能会解决故障(例如,如果错误是由于没有正确类型的提供程序导致的,则添加所需的提供程序将允许继续索引)。然而,在其他情况下,需要更改子图代码。 -> 确定性故障被视为“最终”,并为故障区块生成索引证明,而非确定性故障则不是,因为子图可能会“可靠”并继续索引。在某些情况下,非确定性标签是不正确的,子图永远无法克服错误;此类故障应报告为 Graph 节点存储库中的问题。 +> 确定性故障被视为“最终”,并为故障区块生成索引证明,而非确定性故障则不是,因为子图可能会“可靠”并继续索引。在某些情况下,非确定性标签是不正确的,子图永远无法克服错误;此类故障应报告为Graph节点存储库中的问题。 #### Block and call cache -Graph 节点在存储中缓存某些数据,以保存来自提供程序的重新绘制。区块被缓存,`eth_calls`的结果也被缓存(后者作为特定区块被缓存)。这种缓存可以在稍微改变的子图的“重新同步”期间显著提高索引速度。 +Graph节点在存储中缓存某些数据,以保存来自提供程序的重新绘制。区块被缓存,`eth_calls`的结果也被缓存(后者作为特定区块被缓存)。这种缓存可以在稍微改变的子图的“重新同步”期间显著提高索引速度。 However, in some instances, if an Ethereum node has provided incorrect data for some period, that can make its way into the cache, leading to incorrect data or failed subgraphs. In this case indexers can use `graphman` to clear the poisoned cache, and then rewind the affected subgraphs, which will then fetch fresh data from the (hopefully) healthy provider. -如果怀疑区块缓存不一致,例如 tx 收据丢失事件: +如果怀疑区块缓存不一致,例如tx收据丢失事件: 1. `graphman链列表`以查找链名称。 2. `graphman chain check-blocks by-number ` 将检查缓存的块是否与提供程序匹配,如果不匹配,则从缓存中删除该块。 @@ -339,7 +339,7 @@ There is not one "silver bullet", but a range of tools for preventing, diagnosin ##### 查询缓存 -默认情况下,Graph 节点缓存 GraphQL 查询,这可以显著减少数据库负载。这可以进一步使用`GRAPH_QUERY_CACHE_BLOCKS`和`GRAPH_QUERY_CACHE-MAX_MEM`设置进行配置-请在[此处](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md#graphql-caching)阅读更多信息。 +默认情况下,Graph 节点缓存GraphQL查询,这可以显著减少数据库负载。这可以进一步使用`GRAPH_QUERY_CACHE_BLOCKS`和`GRAPH_QUERY_CACHE-MAX_MEM`设置进行配置-请在[此处](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md#graphql-caching)阅读更多信息。 ##### 分析查询 @@ -353,20 +353,20 @@ Given a slow query, indexers have a few options. Of course they can alter their ##### 账户式优化 -存储实体的数据库表通常有两种类型:“类交易”,即实体一旦创建,就永远不会更新,即存储类似于金融交易列表的内容;“类账户”,即经常更新实体,即存储每次记录交易时都会修改的类似金融账户的内容。类账户表的特点是,它们包含大量实体版本,但不同的实体相对较少。通常,在这种表中,不同实体的数量是行总数的 1%(实体版本)。 +存储实体的数据库表通常有两种类型:“类交易”,即实体一旦创建,就永远不会更新,即存储类似于金融交易列表的内容;“类账户”,即经常更新实体,即存储每次记录交易时都会修改的类似金融账户的内容。类账户表的特点是,它们包含大量实体版本,但不同的实体相对较少。通常,在这种表中,不同实体的数量是行总数的1%(实体版本)。 -对于类似账户的表,`graph-node` 可以生成查询,利用 Postgres 如何以如此高的变化率存储数据的细节,即最近区块的所有版本都位于此类表的总存储的一小部分中。 +对于类似账户的表,`graph-node` 可以生成查询,利用Postgres如何以如此高的变化率存储数据的细节,即最近区块的所有版本都位于此类表的总存储的一小部分中。 The command `graphman stats show shows, for each entity type/table in a deployment, how many distinct entities, and how many entity versions each table contains. That data is based on Postgres-internal estimates, and is therefore necessarily imprecise, and can be off by an order of magnitude. A `-1` in the `entities` column means that Postgres believes that all rows contain a distinct entity. -通常,不同实体的数量小于行/实体版本总数的 1%的表是类似账户的优化的好候选表。当`graphman stats show`的输出表明表可能从该优化中受益时,运行`graphman stats show
    `将执行表的完整计数-这可能会很慢,但可以精确测量不同实体与整体实体版本的比率。 +通常,不同实体的数量小于行/实体版本总数的1%的表是类似账户的优化的好候选表。当`graphman stats show`的输出表明表可能从该优化中受益时,运行`graphman stats show
    `将执行表的完整计数-这可能会很慢,但可以精确测量不同实体与整体实体版本的比率。 Once a table has been determined to be account-like, running `graphman stats account-like .
    ` will turn on the account-like optimization for queries against that table. The optimization can be turned off again with `graphman stats account-like --clear .
    ` It takes up to 5 minutes for query nodes to notice that the optimization has been turned on or off. After turning the optimization on, it is necessary to verify that the change does not in fact make queries slower for that table. If you have configured Grafana to monitor Postgres, slow queries would show up in `pg_stat_activity`in large numbers, taking several seconds. In that case, the optimization needs to be turned off again. -对于类似 Uniswap 的子图,`pair` 和 `token`表是这种优化的主要候选项,并且可以对数据库负载产生显著影响。 +对于类似Uniswap的子图,`pair` 和 `token`表是这种优化的主要候选项,并且可以对数据库负载产生显著影响。 #### 删除子图 -> 这是一项新功能,将在 Graph Node 0.29.x 中提供。 +> 这是一项新功能,将在Graph Node 0.29.x中提供。 在某个时刻,索引人可能想要删除给定的子图。这可以通过删除部署及其所有索引数据的`graphman drop`, 轻松完成。部署可以被指定为子图名称、IPFS has、`Qm..`,或数据库命名空间`sgdNNN`。[此处](https://github.com/graphprotocol/graph-node/blob/master/docs/graphman.md#-drop)提供了更多文档。 diff --git a/website/pages/zh/querying/graphql-api.mdx b/website/pages/zh/querying/graphql-api.mdx index 92dfa1cd6d22..02cd527bc2dd 100644 --- a/website/pages/zh/querying/graphql-api.mdx +++ b/website/pages/zh/querying/graphql-api.mdx @@ -191,7 +191,7 @@ This can be useful if you are looking to fetch only entities whose child-level e As of Graph Node [`v0.30.0`](https://github.com/graphprotocol/graph-node/releases/tag/v0.30.0) you can group multiple parameters in the same `where` argument using the `and` or the `or` operators to filter results based on more than one criteria. -##### `AND` Operator +##### `AND`运算符 In the following example, we are filtering for challenges with `outcome` `succeeded` and `number` greater than or equal to `100`. @@ -208,7 +208,7 @@ In the following example, we are filtering for challenges with `outcome` `succee ``` > **Syntactic sugar:** You can simplify the above query by removing the `and` operator by passing a sub-expression separated by commas. -> +> > ```graphql > { > challenges(where: { number_gte: 100, outcome: "succeeded" }) { @@ -322,12 +322,12 @@ Fulltext search queries have one required field, `text`, for supplying search te Fulltext search operators: -| 符号 | 运算符 | 描述 | -| ------ | ----------- | ---------------------------------------------------------------------- | -| `&` | `And` | 用于将多个搜索词组合到包含所有提供词条的实体的过滤器中 | -| | | `Or` | 由 or 运算符分隔的多个搜索词的查询,将返回与任何提供的词匹配的所有实体 | -| `<->` | `Follow by` | 指定两个单词之间的距离。 | -| `:*` | `Prefix` | 使用前缀搜索词查找前缀匹配的单词(需要 2 个字符) | +| 符号 | 运算符 | 描述 | +| ----------- | ----------- | ------------------------------------- | +| `&` | `And` | 用于将多个搜索词组合到包含所有提供词条的实体的过滤器中 | +| | | `Or` | 由 or 运算符分隔的多个搜索词的查询,将返回与任何提供的词匹配的所有实体 | +| `<->` | `Follow by` | 指定两个单词之间的距离。 | +| `:*` | `Prefix` | 使用前缀搜索词查找前缀匹配的单词(需要 2 个字符) | #### Examples diff --git a/website/pages/zh/querying/querying-the-hosted-service.mdx b/website/pages/zh/querying/querying-the-hosted-service.mdx index 66926b1bb387..883207bf0a8c 100644 --- a/website/pages/zh/querying/querying-the-hosted-service.mdx +++ b/website/pages/zh/querying/querying-the-hosted-service.mdx @@ -21,7 +21,7 @@ This query lists all the counters our mapping has created. Since we only create ## Using The Hosted Service -Graph 浏览器及其 GraphQL playground 是探索和查询托管服务上部署的子图的有用方式。 +Graph浏览器及其 GraphQL playground 是探索和查询托管服务上部署的子图的有用方式。 下面详细介绍了一些主要功能: diff --git a/website/pages/zh/substreams/[[...slug]].mdx b/website/pages/zh/substreams/[[...slug]].mdx new file mode 100644 index 000000000000..b491d88dfbf4 --- /dev/null +++ b/website/pages/zh/substreams/[[...slug]].mdx @@ -0,0 +1,66 @@ +import { visit } from 'unist-util-visit' +import { RemoteContent } from 'nextra/data' +import { buildDynamicMDX } from 'nextra/remote' +import { listFiles } from './_meta.js' +import { getPageMap } from '@/components/get-page-map' + +export async function getStaticPaths() { + const files = await listFiles() + return { + fallback: false, + paths: files.map((filePath) => ({ + params: { + slug: filePath.replace(/\.mdx?/, '').split('/'), + }, + })), + } +} +export async function getStaticProps({ params: { slug = ['README'] } }) { + const baseURL = 'https://raw.githubusercontent.com/streamingfast/substreams/develop/docs/' + const paths = slug.join('/') + let response = await fetch(`${baseURL}${paths}.md`) + if (response.status === 404 && paths !== 'README') { + response = await fetch(`${baseURL}${paths}/README.md`) + } + const data = await response.text() + const mdx = await buildDynamicMDX(data, { + mdxOptions: { + format: 'md', + remarkPlugins: [ + () => (tree, _file, done) => { + const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ + visit(tree, 'paragraph', (node) => { + for (const child of node.children) { + if (child.value) { + child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') + } + } + }) + visit(tree, 'link', (node) => { + if (node.url.startsWith('./')) { + node.url = node.url.slice(2) + } + if (node.url.startsWith('/')) { + // (foo)[/foo/bar] + node.url = node.url.replace('/', '/substreams/') + } else if (!node.url.includes('/') && node.url.endsWith('.md')) { + // (foo)[foo.md] + node.url = [...slug.slice(0, -1), node.url].join('/') + } + }) + done() + }, + ], + }, + codeHighlight: false, + }) + return { + props: { + ...mdx, + __nextra_pageMap: await getPageMap('en'), + hideLocaleSwitcher: true, + }, + } +} + + diff --git a/website/pages/zh/tokenomics.mdx b/website/pages/zh/tokenomics.mdx index 08e9c10fce91..cd435da56e3d 100644 --- a/website/pages/zh/tokenomics.mdx +++ b/website/pages/zh/tokenomics.mdx @@ -9,7 +9,7 @@ description: The Graph Network is incentivized by powerful tokenomics. Here’s The Graph is a decentralized protocol that enables easy access to blockchain data. -它类似于 B2B2C 模式,只是由去中心化的参与者网络提供支持。网络参与者共同向最终用户提供数据,以换取 GRT 奖励。GRT 是协调数据提供者和消费者的工作工具代币。GRT 作为协调网络内数据提供商和消费者的工具,并激励协议参与者有效组织数据。 +它类似于B2B2C模式,只是由去中心化的参与者网络提供支持。网络参与者共同向最终用户提供数据,以换取GRT奖励。GRT是协调数据提供者和消费者的工作工具代币。GRT作为协调网络内数据提供商和消费者的工具,并激励协议参与者有效组织数据。 By using The Graph, users can easily access data from the blockchain, paying only for the specific information they need. The Graph is used by many [popular applications](https://thegraph.com/explorer) in the web3 ecosystem today.