-
Notifications
You must be signed in to change notification settings - Fork 333
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
Introduce project manifest version 0.2.0 #495
Conversation
packages/cli/src/commands/init.ts
Outdated
project.endpoint = await cli.prompt('RPC endpoint', { | ||
default: 'wss://polkadot.api.onfinality.io/public-ws', | ||
project.network = await cli.prompt('Netork genesis hash', { | ||
default: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', |
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 might be worth adding more human readable options here. Like a list of network names and the ability to add a custom genesis
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.
We can ask user for an endpoint and retrieve genesishash from that endpoint and ask confirm.
Probably need to reconsider the version, for this scale of change, i think we can use 0.2.0 |
specVersion: string; | ||
description: string; | ||
repository: string; | ||
dataSources: SubqlDataSource[]; | ||
schema: string; |
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.
We can still have schema
in IProjectManifest
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.
I have removed it here because the type has changed from string
to { file: string; }
. Each of the versioned interfaces include the specific type.
I'm happy to add it back in as a union type or ensure that its mapped to { file: string; }
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.
We can even make the type of schema GraphQLDocument
or something alike.
@seandotau @zhex This is a quite large change for the project manifest. Your inputs are so important and welcomed. |
785770c
to
b3d5efc
Compare
@@ -42,6 +46,14 @@ const DEFAULT_CONFIG = { | |||
indexCountLimit: 10, | |||
timestampField: true, | |||
proofOfIndex: false, | |||
networkRegistry: { | |||
/* TODO provide a default list */ |
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.
This is probably the largest change on the hosted service side. If the project is using the new manifest spec then it only provides a genesis hash, so there needs to be a mapping to the endpoints.
If there are still uncertainty in networkRegistry, we can leave it in the future PR. Currently we allow user provides overrides for endpoint, which should be enough. |
dabf3b4
to
a3f1f54
Compare
I've removed the networkRegistry flag. |
docs/references/references.md
Outdated
@@ -35,6 +35,10 @@ Options: | |||
--timestamp-field Enable/disable created_at and updated_at in schema | |||
[boolean] [default: true] | |||
-d, --network-dictionary Specify the dictionary api for this network [string] | |||
--proof-of-index Enable/disable proof of index | |||
[boolean] [default: false] | |||
--network-registry JSON object mapping genesisHash of each network to |
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.
update here since it has been removed
packages/cli/src/commands/init.ts
Outdated
|
||
if (flags.specVersion === '0.2.0') { | ||
(project as ProjectSpecV0_2_0).genesisHash = await cli.prompt('Network genesis hash', { | ||
default: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3', // Polkadot |
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.
for v0.2.0 we can still ask user for the endpoint first. with the endpoint we can
- retrieve genesis hash and ask user to confirm it or they input another one
- store endpoint in runtime config (is it included in v0.2.0?)
Sorry I change the idea and forget to update the issue. it says We can have this change in a separate PR. |
- Define new project manifest schema - Update validator for new schema, validate chain types - Update CLI for new schema - Update `init` to create a v0.0.2 project - Update validate to validate all supported versions - Update Node for new schema - Rely on genesis hash for network identification - Add `--network-registry` flag to provide mapping from genesis hash to endpoint - Support new chain types in external file - Support new entry point for indexer sandbox
…vided for v0.2.0 projects
…o resolve genesis hash from url
I can't seem to figure out why these tests cause other tests to fail https://github.com/subquery/subql/pull/495/files#diff-07519fb2dbc5155256ed036d08aece637848c043d153094ca7dab73099e6f34dR168-R180 My only thought could be because of something due to the sandbox vm or the process being overworked trying to index even though the fetch service gets stopped. @ianhe8x any ideas on this? At this stage I'm happy just to disable these tests |
b464ddc
to
e3db9ef
Compare
* Introduce project manifest version 0.0.2 - Define new project manifest schema - Update validator for new schema, validate chain types - Update CLI for new schema - Update `init` to create a v0.0.2 project - Update validate to validate all supported versions - Update Node for new schema - Rely on genesis hash for network identification - Add `--network-registry` flag to provide mapping from genesis hash to endpoint - Support new chain types in external file - Support new entry point for indexer sandbox * Fix up tests * Fix up prettier * Fix lint issue * Enable noImplicitAny ts setting for cli, common and validator * Update new manifest version from 0.0.2 to 0.2.0, address other minor comments * Add tests for index manager, reuse sandbox VM for same entry point * Revert CLI init changes * Update docs * Update init command to allow specifying spec version * Remove networkDictionary option and require networkEndpoint to be provided for v0.2.0 projects * Remove logging * Add validator tests to jest scrope, fix valitation when project.yaml is missing * Fix failing test * Allow specifying an optional endpoint in network config, update CLI to resolve genesis hash from url * Fix commit hook issue with prettier and partially staged files * Fix tests failing * Disable breaking tests * Remove name from datasource in v0.2.0 manifest spec
Addresses #463
Overview of changes:
Updateinit
to create a v0.0.2 project--network-registry
flag to provide mapping from genesis hash to endpointTodo:
Merge Update manifest to v0.0.2 subql-starter#30 and updateNot merging so CLI releases before these changes are not brokeninit
command once mergedIndexerManager
Expand upon default values for--network-registry
flag