Giter VIP home page Giter VIP logo

subql-starter's Introduction

SubQuery - Starter Package

The Starter Package is an example that you can use as a starting point for developing your SubQuery project.

This repo includes all starter projects for Substrate - each under its own repo. The templates are registered in the templates repo.

A SubQuery package defines which data The SubQuery will index from the Substrate blockchain, and how it will store it.

Contributing

subql-starter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

subql-starter's Issues

Consider making validate a prebuild step

Currently with dummy chain types file a project will build correctly but the project will not be valid to run. We should consider running validation before building.

To reproduce:

  1. Init a starter project
  2. Add an invalid chaintypes file (eg json) to the project manifest
  3. Build (yarn && yarn codegen && yarn build
  4. Build should work fine but when running subql validate it will fail

Solution:
Add a prebuild script to package.json which runs node dependencies subql validate

Public db access in docker-compose.yaml

Despite if that's for testing purposes, the published container port should listen no more than the loopback interface, reflecting in docker-compose.yaml:

# ...
    ports:
      - 127.0.0.1:5432:5432

Otherwise other devices and clients within the local network where developers in can, if no firewall, connect to the database.

Besides, I don't think closing this PR without any discussion or further improvements is a good option. From my perspective, allowing the whole network accessing a no-password database is always a terrible idea in any way.

Match repositories

(I'm not sure if this problem belongs here, sorry if not)
Hello, I was looking at the quick start guide but there's a problem:
Following this guide: Create a New Project
https://university.subquery.network/quickstart/quickstart.html

  1. First, I installed SubQuery CLI
    npm install -g @subql/cli
  2. Initialise the SubQuery Starter Project
    subql init
  3. Init a new Subquery project
    image
    The page says "We suggest selecting the "subql-starter" project."
    But there's no "subql-starter" option. Looking into your Github, I didn't find any "polkadot-starter", just a "subql-starter".
    If I select "polkadot-starter" option, we can see the following error:
    image
    I think you guys forgot to update links/names, idk.
    Any other network is working properly, i.e, Kusama:
    image

docker-compose failed to start.

my start command:

$ docker-compose pull & docker-compose up

this is subquery node log:

 /usr/local/lib/node_modules/@subql/node/dist/main.js

- /usr/local/lib/node_modules/@subql/node/bin/run

    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)

    at Function.Module._load (node:internal/modules/cjs/loader:804:27)

    at Module.require (node:internal/modules/cjs/loader:1028:19)

    at require (node:internal/modules/cjs/helpers:102:18)

    at Object.<anonymous> (/usr/local/lib/node_modules/@subql/node/node_modules/@subql/node-core/dist/indexer/store.service.js:23:19)

    at Module._compile (node:internal/modules/cjs/loader:1126:14)

    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)

    at Module.load (node:internal/modules/cjs/loader:1004:32)

    at Function.Module._load (node:internal/modules/cjs/loader:839:12)

    at Module.require (node:internal/modules/cjs/loader:1028:19) {

  code: 'MODULE_NOT_FOUND',

  requireStack: [

    '/usr/local/lib/node_modules/@subql/node/node_modules/@subql/node-core/dist/indexer/store.service.js',

    '/usr/local/lib/node_modules/@subql/node/node_modules/@subql/node-core/dist/indexer/index.js',

    '/usr/local/lib/node_modules/@subql/node/node_modules/@subql/node-core/dist/meta/mmrQuery.controller.js',

    '/usr/local/lib/node_modules/@subql/node/node_modules/@subql/node-core/dist/meta/index.js',

    '/usr/local/lib/node_modules/@subql/node/node_modules/@subql/node-core/dist/index.js',

    '/usr/local/lib/node_modules/@subql/node/dist/main.js',

    '/usr/local/lib/node_modules/@subql/node/bin/run'

  ]

}

Missing deployment in docs

  1. Missing "Deployment" section in docs
  2. The docs didn't point out that docker-compose.yaml is for testing purposes only.

Access denied to require 'https'

Hi everyone,

ignorant question: Why is it that the https module is excluded from the built-in NodeJS modules?

Some of my events hold IPFS CIDs where more metadata is stored and I am looking to resolve that CID and populate the extra metadata in the indexer entity.

That's quite easy to achieve but then I found out that node-fetch and the https would stop the VM from starting which made me think that most likely I am missing the big picture here.

Thanks,

Docker compose using features incompatible with version specified

Recently checks were added to the the docker-compose.yaml in the SubQuery starter project to ensure that dependent containers are not used before they are ready. These work great and stop a bunch of confusing errors when a user creates a new starter project.

When a user creates a new starter project and follows the published instructions they will see an error message depends_on contains an invalid type, it should be an array rather than being able to run up their project successfully.

Unfortunately, the depends_on feature these changes use is not available in version 3 of Docker Compose. A discussion on the subject and the reasoning behind removing the feature can be found here.

Suggestion is to downgrade the version of docker-compose.yaml to version 2.1 or use a different strategy to ensure dependent containers are initialised before use.

Change license to MIT

  • Change license for branch v0.0.1 and v0.2.0 in package.json.
  • Put LICENSE file in these two branches

Make schema field names useful

Change the project schema fields to have more useful names past field1, field2 .... Instead blockNumber, blockHash, ... This update will be made with the required changes to the ports for the node

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.