-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Near migration from Thegraph #385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this.
Do you mind switching the example to this project https://github.com/graphprotocol/graph-tooling/tree/main/examples/near-receipts its much more relevant to a real world example.
It would also be good to see more details about modifying the handler functions and saving entities.
``` | ||
mkdir -p docker && nano docker/load-extensions.sh | ||
``` | ||
And paste content: | ||
|
||
``` | ||
#!/bin/sh | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<EOF | ||
CREATE EXTENSION IF NOT EXISTS btree_gist; | ||
EOF | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to combine this into a single command and avoid using a specific editor.
mkdir -p docker && echo "<file contents>" > docker/load-extensions.sh
The same applies for any other files created
"target": "es2017", | ||
"strict": true | ||
}, | ||
"include": ["src/**/*", "node_modules/@subql/types/dist/global.d.ts"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out, i have fixed this in the starter templates
"include": ["src/**/*", "node_modules/@subql/types/dist/global.d.ts"] | |
"include": ["src/**/*", "node_modules/@subql/types-near/dist/global.d.ts"] |
Open src/mapping.ts | ||
|
||
- Remove all graphql entries. | ||
- Add new requirements frim subquery libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add new requirements frim subquery libs | |
- Add new requirements from subquery libs |
**Generate types & mpdels** | ||
`yarn codefen` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Generate types & mpdels** | |
`yarn codefen` | |
**Generate types & models** | |
`yarn codegen` |
kind: near/BlockHandler | ||
filter: | ||
modulo: 10 | ||
type: Transfer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type
filter doesn't work with a blockhandler.
Instead of this perscriptive approach to renaming files, you might want to suggest that they You can also reuse content from https://academy.subquery.network/build/graph-migration.html but adapt the example code to your NEAR project |
No description provided.