diff --git a/.remarkrc.cjs b/.remarkrc.cjs index b5b908449b25..a65a5d6d032b 100644 --- a/.remarkrc.cjs +++ b/.remarkrc.cjs @@ -5,5 +5,7 @@ module.exports = { ['remark-lint-restrict-elements', { type: 'heading', depth: 1 }], 'remark-lint-heading-increment', ['remark-lint-no-heading-punctuation', '\\.,;:'], + 'remark-lint-no-shell-dollars', + 'remark-lint-fenced-code-flag', ], } diff --git a/package.json b/package.json index 27591a3c67bc..154ab4c4c674 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "pre-commit": "lint-staged --concurrent false", "pre-push": "pnpm build", "prepare": "husky install && chmod +x .husky/*", - "prettier": "prettier . --loglevel warn --write", - "prettier:check": "prettier . --loglevel warn --check", + "prettier": "prettier . --cache --write --list-different", + "prettier:check": "prettier . --cache --check", "start": "pnpm --filter @graphprotocol/docs start", "typecheck": "pnpm --filter @graphprotocol/docs typecheck" }, @@ -30,9 +30,11 @@ "prettier": "^2.8.8", "prettier-plugin-pkg": "^0.17.1", "remark-frontmatter": "^4.0.1", + "remark-lint-fenced-code-flag": "^3.1.1", "remark-lint-first-heading-level": "^3.1.1", "remark-lint-heading-increment": "^3.1.1", "remark-lint-no-heading-punctuation": "^3.1.1", + "remark-lint-no-shell-dollars": "^3.1.1", "remark-lint-restrict-elements": "workspace:*", "typescript": "5.0.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5bec991da53c..01539f337072 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,9 @@ importers: remark-frontmatter: specifier: ^4.0.1 version: 4.0.1 + remark-lint-fenced-code-flag: + specifier: ^3.1.1 + version: 3.1.1 remark-lint-first-heading-level: specifier: ^3.1.1 version: 3.1.1 @@ -37,6 +40,9 @@ importers: remark-lint-no-heading-punctuation: specifier: ^3.1.1 version: 3.1.1 + remark-lint-no-shell-dollars: + specifier: ^3.1.1 + version: 3.1.1 remark-lint-restrict-elements: specifier: workspace:* version: link:packages/remark-lint-restrict-elements @@ -7888,6 +7894,17 @@ packages: transitivePeerDependencies: - supports-color + /remark-lint-fenced-code-flag@3.1.1: + resolution: {integrity: sha512-FFVZmYsBccKIIEgOtgdZEpQdARtAat1LTLBydnIpyNIvcntzWwtrtlj9mtjL8ZoSRre8HtwmEnBFyOfmM/NWaA==} + dependencies: + '@types/mdast': 3.0.11 + unified: 10.1.2 + unified-lint-rule: 2.1.1 + unist-util-generated: 2.0.1 + unist-util-position: 4.0.4 + unist-util-visit: 4.1.2 + dev: true + /remark-lint-first-heading-level@3.1.1: resolution: {integrity: sha512-Z2+gn9sLyI/sT2c1JMPf1dj9kQkFCpL1/wT5Skm5nMbjI8/dIiTF2bKr9XKsFZUFP7GTA57tfeZvzD1rjWbMwg==} dependencies: @@ -7919,6 +7936,16 @@ packages: unist-util-visit: 4.1.2 dev: true + /remark-lint-no-shell-dollars@3.1.1: + resolution: {integrity: sha512-Q3Ad1TaOPxbYog5+Of/quPG3Fy+dMKiHjT8KsU7NDiHG6YJOnAJ3f3w+y13CIlNIaKc/MrisgcthhrZ7NsgXfA==} + dependencies: + '@types/mdast': 3.0.11 + unified: 10.1.2 + unified-lint-rule: 2.1.1 + unist-util-generated: 2.0.1 + unist-util-visit: 4.1.2 + dev: true + /remark-math@5.1.1: resolution: {integrity: sha512-cE5T2R/xLVtfFI4cCePtiRn+e6jKMtFDR3P8V3qpv8wpKjwvHoBA4eJzvX+nVrnlNy0911bdGmuspCSwetfYHw==} dependencies: diff --git a/website/pages/en/cookbook/arweave.mdx b/website/pages/en/cookbook/arweave.mdx index 55f820e120d0..10879fa34e75 100644 --- a/website/pages/en/cookbook/arweave.mdx +++ b/website/pages/en/cookbook/arweave.mdx @@ -48,9 +48,9 @@ This is the logic that determines how data should be retrieved and stored when s During subgraph development there are two key commands: -``` -$ graph codegen # generates types from the schema file identified in the manifest -$ graph build # generates Web Assembly from the AssemblyScript files, and prepares all the subgraph files in a /build folder +```sh +graph codegen # generates types from the schema file identified in the manifest +graph build # generates Web Assembly from the AssemblyScript files, and prepares all the subgraph files in a /build folder ``` ## Subgraph Manifest Definition @@ -84,18 +84,18 @@ dataSources: - Arweave subgraphs introduce a new kind of data source (`arweave`) - The network should correspond to a network on the hosting Graph Node. On the Hosted Service, Arweave's mainnet is `arweave-mainnet` -- Arweave data sources introduce an optional source.owner field, which is the public key of an Arweave wallet +- Arweave data sources introduce an optional `source.owner` field, which is the public key of an Arweave wallet Arweave data sources support two types of handlers: -- `blockHandlers` - Run on every new Arweave block. No source.owner is required. -- `transactionHandlers` - Run on every transaction where the data source's `source.owner` is the owner. Currently an owner is required for `transactionHandlers`, if users want to process all transactions they should provide "" as the `source.owner` +- `blockHandlers` - Run on every new Arweave block. No `source.owner` is required. +- `transactionHandlers` - Run on every transaction where the data source's `source.owner` is the owner. Currently, an owner is required for `transactionHandlers`, if users want to process all transactions they should provide "" as the `source.owner` -> The source.owner can be the owner's address, or their Public Key. +> The `source.owner` can be the owner's address, or their Public Key. > Transactions are the building blocks of the Arweave permaweb and they are objects created by end-users. -> Note: [Bundlr](https://bundlr.network/) transactions are not supported yet. +> **Note:** [Bundlr](https://bundlr.network/) transactions are not supported yet. ## Schema Definition @@ -184,7 +184,7 @@ This is not currently supported. ### How can I filter transactions to a specific account? -The source.owner can be the user's public key or account address. +The `source.owner` can be the user's public key or account address. ### What is the current encryption format? @@ -192,48 +192,54 @@ Data is generally passed into the mappings as Bytes, which if stored directly is The following `bytesToBase64(bytes: Uint8Array, urlSafe: boolean): string` helper function can be used, and will be added to `graph-ts`: -``` +```ts +// prettier-ignore const base64Alphabet = [ - "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", - "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", - "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", - "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/" -]; - + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', +] + +// prettier-ignore const base64UrlAlphabet = [ - "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", - "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", - "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", - "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "_" -]; + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_', +] function bytesToBase64(bytes: Uint8Array, urlSafe: boolean): string { - let alphabet = urlSafe? base64UrlAlphabet : base64Alphabet; - - let result = '', i: i32, l = bytes.length; - for (i = 2; i < l; i += 3) { - result += alphabet[bytes[i - 2] >> 2]; - result += alphabet[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)]; - result += alphabet[((bytes[i - 1] & 0x0F) << 2) | (bytes[i] >> 6)]; - result += alphabet[bytes[i] & 0x3F]; - } - if (i === l + 1) { // 1 octet yet to write - result += alphabet[bytes[i - 2] >> 2]; - result += alphabet[(bytes[i - 2] & 0x03) << 4]; - if (!urlSafe) { - result += "=="; - } - } - if (!urlSafe && i === l) { // 2 octets yet to write - result += alphabet[bytes[i - 2] >> 2]; - result += alphabet[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)]; - result += alphabet[(bytes[i - 1] & 0x0F) << 2]; - if (!urlSafe) { - result += "="; - } - } - return result; + let alphabet = urlSafe ? base64UrlAlphabet : base64Alphabet + + let result = '', + i: i32, + l = bytes.length + for (i = 2; i < l; i += 3) { + result += alphabet[bytes[i - 2] >> 2] + result += alphabet[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)] + result += alphabet[((bytes[i - 1] & 0x0f) << 2) | (bytes[i] >> 6)] + result += alphabet[bytes[i] & 0x3f] + } + if (i === l + 1) { + // 1 octet yet to write + result += alphabet[bytes[i - 2] >> 2] + result += alphabet[(bytes[i - 2] & 0x03) << 4] + if (!urlSafe) { + result += '==' + } + } + if (!urlSafe && i === l) { + // 2 octets yet to write + result += alphabet[bytes[i - 2] >> 2] + result += alphabet[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)] + result += alphabet[(bytes[i - 1] & 0x0f) << 2] + if (!urlSafe) { + result += '=' + } + } + return result } ``` diff --git a/website/pages/en/cookbook/base-testnet.mdx b/website/pages/en/cookbook/base-testnet.mdx index 248ecfdf5351..03c426bdfe46 100644 --- a/website/pages/en/cookbook/base-testnet.mdx +++ b/website/pages/en/cookbook/base-testnet.mdx @@ -77,27 +77,27 @@ Before you can deploy your subgraph, you will need to authenticate with the Subg Authenticate the subgraph on studio -``` +```sh graph auth --studio ``` Next, enter your subgraph's directory. -``` - cd +```sh +cd ``` Build your subgraph with the following command: - ``` - graph codegen && graph build - ``` +```sh +graph codegen && graph build +``` Finally, you can deploy your subgraph using this command: - ``` - graph deploy --studio - ``` +```sh +graph deploy --studio +``` ### 5. Query your subgraph diff --git a/website/pages/en/cookbook/cosmos.mdx b/website/pages/en/cookbook/cosmos.mdx index 49d29dffdd8a..34eca41fbe85 100644 --- a/website/pages/en/cookbook/cosmos.mdx +++ b/website/pages/en/cookbook/cosmos.mdx @@ -185,13 +185,13 @@ An example of how to decode message data in a subgraph can be found [here](https The first step before starting to write the subgraph mappings is to generate the type bindings based on the entities that have been defined in the subgraph schema file (`schema.graphql`). This will allow the mapping functions to create new objects of those types and save them to the store. This is done by using the `codegen` CLI command: ```bash -$ graph codegen +graph codegen ``` Once the mappings are ready, the subgraph needs to be built. This step will highlight any errors the manifest or the mappings might have. A subgraph needs to build successfully in order to be deployed to the Graph Node. It can be done using the `build` CLI command: ```bash -$ graph build +graph build ``` ## Deploying a Cosmos subgraph diff --git a/website/pages/en/cookbook/grafting.mdx b/website/pages/en/cookbook/grafting.mdx index 54ad7a0eaff8..3e0807ccf44c 100644 --- a/website/pages/en/cookbook/grafting.mdx +++ b/website/pages/en/cookbook/grafting.mdx @@ -103,7 +103,7 @@ The `base` and `block` values can be found by deploying two subgraphs: one for t It returns something like this: -``` +```json { "data": { "withdrawals": [ @@ -145,7 +145,7 @@ The graft replacement subgraph.yaml will have a new contract address. This could It should return the following: -``` +```json { "data": { "withdrawals": [ diff --git a/website/pages/en/cookbook/near.mdx b/website/pages/en/cookbook/near.mdx index 33ef5e56c213..4de309d138d0 100644 --- a/website/pages/en/cookbook/near.mdx +++ b/website/pages/en/cookbook/near.mdx @@ -44,8 +44,8 @@ There are three aspects of subgraph definition: During subgraph development there are two key commands: ```bash -$ graph codegen # generates types from the schema file identified in the manifest -$ graph build # generates Web Assembly from the AssemblyScript files, and prepares all the subgraph files in a /build folder +graph codegen # generates types from the schema file identified in the manifest +graph build # generates Web Assembly from the AssemblyScript files, and prepares all the subgraph files in a /build folder ``` ### Subgraph Manifest Definition @@ -187,8 +187,8 @@ As a quick primer - the first step is to "create" your subgraph - this only need Once your subgraph has been created, you can deploy your subgraph by using the `graph deploy` CLI command: ```sh -$ graph create --node subgraph/name # creates a subgraph on a local Graph Node (on the Hosted Service, this is done via the UI) -$ graph deploy --node --ipfs https://api.thegraph.com/ipfs/ # uploads the build files to a specified IPFS endpoint, and then deploys the subgraph to a specified Graph Node based on the manifest IPFS hash +graph create --node subgraph/name # creates a subgraph on a local Graph Node (on the Hosted Service, this is done via the UI) +graph deploy --node --ipfs https://api.thegraph.com/ipfs/ # uploads the build files to a specified IPFS endpoint, and then deploys the subgraph to a specified Graph Node based on the manifest IPFS hash ``` The node configuration will depend on where the subgraph is being deployed. diff --git a/website/pages/en/cookbook/quick-start.mdx b/website/pages/en/cookbook/quick-start.mdx index 0cbdde1fdc83..b83a34fe6847 100644 --- a/website/pages/en/cookbook/quick-start.mdx +++ b/website/pages/en/cookbook/quick-start.mdx @@ -26,10 +26,10 @@ On your local machine, run one of the following commands: ```sh # NPM -$ npm install -g @graphprotocol/graph-cli +npm install -g @graphprotocol/graph-cli # Yarn -$ yarn global add @graphprotocol/graph-cli +yarn global add @graphprotocol/graph-cli ``` ## 3. Initialize your Subgraph @@ -74,15 +74,15 @@ For more information on how to write your subgraph, see [Creating a Subgraph](/d Once your subgraph is written, run the following commands: ```sh -$ graph codegen -$ graph build +graph codegen +graph build ``` - Authenticate and deploy your subgraph. The deploy key can be found on the Subgraph page in Subgraph Studio. ```sh -$ graph auth --studio -$ graph deploy --studio +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`. diff --git a/website/pages/en/cookbook/subgraph-debug-forking.mdx b/website/pages/en/cookbook/subgraph-debug-forking.mdx index 5f214139646a..2413db48c7d7 100644 --- a/website/pages/en/cookbook/subgraph-debug-forking.mdx +++ b/website/pages/en/cookbook/subgraph-debug-forking.mdx @@ -73,7 +73,7 @@ And I answer: 2. Forking is easy, no need to sweat: ```bash -$ graph deploy --debug-fork --ipfs http://localhost:5001 --node http://localhost:8020 +graph deploy --debug-fork --ipfs http://localhost:5001 --node http://localhost:8020 ``` Also, don't forget to set the `dataSources.source.startBlock` field in the subgraph manifest to the number of the problematic block, so you can skip indexing unnecessary blocks and take advantage of the fork! @@ -82,19 +82,19 @@ So, here is what I do: 0. I spin-up a local graph node ([here is how to do it](https://github.com/graphprotocol/graph-node#running-a-local-graph-node)) with the `fork-base` option set to: `https://api.thegraph.com/subgraphs/id/`, since I will fork a subgraph, the buggy one I deployed earlier, from the [HostedService](https://thegraph.com/hosted-service/). -``` -$ cargo run -p graph-node --release -- \ - --postgres-url postgresql://USERNAME[:PASSWORD]@localhost:5432/graph-node \ - --ethereum-rpc NETWORK_NAME:[CAPABILITIES]:URL \ - --ipfs 127.0.0.1:5001 - --fork-base https://api.thegraph.com/subgraphs/id/ +```sh +cargo run -p graph-node --release -- \ + --postgres-url postgresql://USERNAME[:PASSWORD]@localhost:5432/graph-node \ + --ethereum-rpc NETWORK_NAME:[CAPABILITIES]:URL \ + --ipfs 127.0.0.1:5001 + --fork-base https://api.thegraph.com/subgraphs/id/ ``` 1. After careful inspection I notice that there is a mismatch in the `id` representations used when indexing `Gravatar`s in my two handlers. While `handleNewGravatar` converts it to a hex (`event.params.id.toHex()`), `handleUpdatedGravatar` uses an int32 (`event.params.id.toI32()`) which causes the `handleUpdatedGravatar` to panic with "Gravatar not found!". I make them both convert the `id` to a hex. 2. After I made the changes I deploy my subgraph to the local Graph node, **_forking the failing subgraph_** and setting `dataSources.source.startBlock` to `6190343` in `subgraph.yaml`: ```bash -$ graph deploy gravity --debug-fork QmNp169tKvomnH3cPXTfGg4ZEhAHA6kEq5oy1XDqAxqHmW --ipfs http://localhost:5001 --node http://localhost:8020 +graph deploy gravity --debug-fork QmNp169tKvomnH3cPXTfGg4ZEhAHA6kEq5oy1XDqAxqHmW --ipfs http://localhost:5001 --node http://localhost:8020 ``` 3. I inspect the logs produced by the local Graph node and, Hooray!, everything seems to be working. diff --git a/website/pages/en/deploying/hosted-service.mdx b/website/pages/en/deploying/hosted-service.mdx index 0ac0b99ba4b9..935592c11c79 100644 --- a/website/pages/en/deploying/hosted-service.mdx +++ b/website/pages/en/deploying/hosted-service.mdx @@ -40,7 +40,7 @@ The `` in this case is your GitHub user or organization name, `/ [] ``` diff --git a/website/pages/en/developing/creating-a-subgraph.mdx b/website/pages/en/developing/creating-a-subgraph.mdx index 683b7dbaa086..b13bd3a6e157 100644 --- a/website/pages/en/developing/creating-a-subgraph.mdx +++ b/website/pages/en/developing/creating-a-subgraph.mdx @@ -222,7 +222,7 @@ type GravatarDeclined @entity { Entity fields can be defined as required or optional. Required fields are indicated by the `!` in the schema. If a required field is not set in the mapping, you will receive this error when querying the field: -``` +```text Null value resolved for non-null field 'name' ``` diff --git a/website/pages/en/developing/unit-testing-framework.mdx b/website/pages/en/developing/unit-testing-framework.mdx index 86b29635afb1..ad0030e6d97e 100644 --- a/website/pages/en/developing/unit-testing-framework.mdx +++ b/website/pages/en/developing/unit-testing-framework.mdx @@ -42,19 +42,19 @@ sudo apt install postgresql You can use Matchstick on WSL both using the Docker approach and the binary approach. As WSL can be a bit tricky, here's a few tips in case you encounter issues like -``` +```text static BYTES = Symbol("Bytes") SyntaxError: Unexpected token = ``` or -``` +```text /node_modules/gluegun/build/index.js:13 throw up; ``` Please make sure you're on a newer version of Node.js graph-cli doesn't support **v10.19.0** anymore, and that is still the default version for new Ubuntu images on WSL. For instance Matchstick is confirmed to be working on WSL with **v18.1.0**, you can switch to it either via **nvm** or if you update your global Node.js. Don't forget to delete `node_modules` and to run `npm install` again after updating you nodejs! Then, make sure you have **libpq** installed, you can do that by running -``` +```sh sudo apt-get install libpq-dev ``` @@ -670,11 +670,11 @@ let anotherGravatarEvent = createNewGravatarEvent(3546, '0x89205A3A3b2A69De6Dbf7 handleNewGravatars([newGravatarEvent, anotherGravatarEvent]) ``` -``` +```ts export function handleNewGravatars(events: NewGravatar[]): void { - events.forEach(event => { - handleNewGravatar(event); - }); + events.forEach((event) => { + handleNewGravatar(event) + }) } ``` @@ -1032,7 +1032,10 @@ You could also add a custom `coverage` command to your `package.json` file, like Hopefully that should execute the coverage tool without any issues. You should see something like this in the terminal: ```sh -$ graph test -c +graph test -c +``` + +```text Skipping download/install step because binary already exists at /Users/petko/work/demo-subgraph/node_modules/binary-install-raw/bin/0.4.0 ___ ___ _ _ _ _ _ diff --git a/website/pages/en/managing/transferring-subgraph-ownership.mdx b/website/pages/en/managing/transferring-subgraph-ownership.mdx index 1ca1c621a9c9..d598d100de4d 100644 --- a/website/pages/en/managing/transferring-subgraph-ownership.mdx +++ b/website/pages/en/managing/transferring-subgraph-ownership.mdx @@ -14,13 +14,13 @@ In addition to adding more flexibility to the development lifecycle, this functi To view your subgraph as an NFT, you can visit an NFT marketplace like OpenSea: -``` +```text https://opensea.io/your-wallet-address ``` Or a wallet explorer like **Rainbow.me**: -``` +```text https://rainbow.me/your-wallet-addres ``` diff --git a/website/pages/en/network/indexing.mdx b/website/pages/en/network/indexing.mdx index 90e741a6d052..22e300c26fb6 100644 --- a/website/pages/en/network/indexing.mdx +++ b/website/pages/en/network/indexing.mdx @@ -603,7 +603,7 @@ IndexingDecisionBasis { Example usage of indexing rule: -``` +```sh graph indexer rules offchain QmZfeJYR86UARzp9HiXbURWunYgC9ywvPvoePNbuaATrEK graph indexer rules set QmZfeJYR86UARzp9HiXbURWunYgC9ywvPvoePNbuaATrEK decisionBasis always allocationAmount 123321 allocationLifetime 14 autoRenewal false requireSupported false @@ -661,7 +661,7 @@ ActionType { Example usage from source: -```bash +```sh indexer indexer actions get all indexer indexer actions get --status queued @@ -718,7 +718,7 @@ A statement is comprised of a predicate, which is used for matching GraphQL quer Example cost model: -``` +```text # This statement captures the skip value, # uses a boolean expression in the predicate to match specific queries that use `skip` # and a cost expression to calculate the cost based on the `skip` value and the SYSTEM_LOAD global @@ -786,7 +786,7 @@ Once an Indexer has staked GRT in the protocol, the [Indexer components](/networ 8. (Optional) In order to control the distribution of rewards and strategically attract Delegators Indexers can update their delegation parameters by updating their indexingRewardCut (parts per million), queryFeeCut (parts per million), and cooldownBlocks (number of blocks). To do so call `setDelegationParameters()`. The following example sets the queryFeeCut to distribute 95% of query rebates to the Indexer and 5% to Delegators, set the indexingRewardCutto distribute 60% of indexing rewards to the Indexer and 40% to Delegators, and set `thecooldownBlocks` period to 500 blocks. -``` +```js setDelegationParameters(950000, 600000, 500) ``` diff --git a/website/pages/en/querying/graphql-api.mdx b/website/pages/en/querying/graphql-api.mdx index 89cda460d58f..dd5cfa796371 100644 --- a/website/pages/en/querying/graphql-api.mdx +++ b/website/pages/en/querying/graphql-api.mdx @@ -243,7 +243,7 @@ In the following example, we are filtering for challenges with `outcome` `succee Full list of parameter suffixes: -``` +```text _ _not _gt diff --git a/website/pages/en/release-notes/assemblyscript-migration-guide.mdx b/website/pages/en/release-notes/assemblyscript-migration-guide.mdx index 85f6903a6c69..02763a30da7b 100644 --- a/website/pages/en/release-notes/assemblyscript-migration-guide.mdx +++ b/website/pages/en/release-notes/assemblyscript-migration-guide.mdx @@ -461,7 +461,7 @@ arr.push('something') // ["", "", "", "", "", "something"] // size 6 :( Depending on the types you're using, eg nullable ones, and how you're accessing them, you might encounter a runtime error like this one: -``` +```text ERRO Handler skipped due to execution failure, error: Mapping aborted at ~lib/array.ts, line 110, column 40, with message: Element type must be nullable if array is holey wasm backtrace: 0: 0x19c4 - !~lib/@graphprotocol/graph-ts/index/format 1: 0x1e75 - !~lib/@graphprotocol/graph-ts/common/collections/Entity#constructor 2: 0x30b9 - !node_modules/@graphprotocol/graph-ts/global/global/id_of_type ```