Skip to content
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

[CLI] Add algorand publish support #1228

Merged
merged 5 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/create-release/gh-release-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ async function publishRelease(releaseInfo) {

checkForBetaVersion(version);

const releaseInfo = gatherReleaseInfo(`./packages/${packageName[1]}/CHANGELOG.md`);
const releaseInfo = gatherReleaseInfo(`${myArgs[0]}/CHANGELOG.md`);

publishRelease(releaseInfo);
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

SubQuery allows every Substrate/Polkadot team to process and query their data. The project is inspired by the growth of data protocols serving the application layer and its aim is to help Polkadot/Substrate projects build better dApps by allowing anyone to reliably find and consume data faster. Today, anyone can query and extract Polkadot network data in only minutes and at no cost.

SubQuery aims to support all Substrate-compatible networks.
SubQuery aims to support all Substrate-compatible networks. For SubQuery support on other networks please visit:
stwiname marked this conversation as resolved.
Show resolved Hide resolved
* [SubQuery Algorand](https://github.com/subquery/subql-algorand)
* [SubQuery Cosmos](https://github.com/subquery/subql-cosmos)

## Get Started
#### Installation
Expand Down Expand Up @@ -37,6 +39,7 @@ You'll also use our custom-built GraphQL query service [`@subql/query`](https://
* [`@subql/node`](packages/node)
* [`@subql/query`](packages/query)
* [`@subql/common`](packages/common)
* [`@subql/common-substrate`](packages/common-substrate)
* [`@subql/types`](packages/types)
* [`@subql/validator`](packages/validator)

Expand Down
3 changes: 3 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All logs must start with the format: [x.y.z] - yyyy-mm-dd

## [Unreleased]

### Added
- Support for Algorand projects

## [1.4.0] - 2022-07-27
### Added
- Added redeploy deployment feature (#1205)
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
"@oclif/core": "^1.3.3",
"@oclif/plugin-help": "^3.2.3",
"@subql/common": "workspace:*",
"@subql/common-avalanche": "0.1.3",
"@subql/common-algorand": "latest",
"@subql/common-avalanche": "latest",
"@subql/common-cosmos": "latest",
"@subql/common-substrate": "workspace:*",
"@subql/common-terra": "^0.6.0",
"@subql/utils": "workspace:*",
"@subql/validator": "workspace:*",
"@types/ejs": "^3.1.0",
"@types/inquirer": "^8.2.0",
"algosdk": "^1.19.0",
"cli-ux": "^6.0.9",
"ejs": "^3.1.6",
"fuzzy": "^0.1.3",
Expand Down
12 changes: 11 additions & 1 deletion packages/cli/src/controller/publish-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import fs from 'fs';
import path from 'path';
import {ReaderFactory, IPFS_CLUSTER_ENDPOINT, getProjectRootAndManifest} from '@subql/common';
import {parseAlgorandProjectManifest} from '@subql/common-algorand';
import {parseSubstrateProjectManifest as parseAvalancheProjectManifest} from '@subql/common-avalanche';
import {parseCosmosProjectManifest} from '@subql/common-cosmos';
import {parseSubstrateProjectManifest, manifestIsV0_0_1} from '@subql/common-substrate';
Expand Down Expand Up @@ -44,7 +45,16 @@ export async function uploadToIpfs(projectPath: string, authToken: string, ipfsE
manifest = parseCosmosProjectManifest(schema).asImpl;
} catch (e) {
//avalanche
manifest = parseAvalancheProjectManifest(schema).asImpl;
try {
manifest = parseAvalancheProjectManifest(schema).asImpl;
} catch (e) {
// algorand
try {
manifest = parseAlgorandProjectManifest(schema).asImpl;
} catch (e) {
throw new Error('Unable to pass project manifest');
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum NETWORK_FAMILY {
avalanche = 'Avalanche',
terra = 'Terra',
cosmos = 'Cosmos',
algorand = 'Algorand',
}

export const runnerMapping = {
Expand All @@ -30,4 +31,5 @@ export const runnerMapping = {
'@subql/node-avalanche': NETWORK_FAMILY.avalanche,
'@subql/node-terra': NETWORK_FAMILY.terra,
'@subql/node-cosmos': NETWORK_FAMILY.cosmos,
'@subql/node-algorand': NETWORK_FAMILY.algorand,
};
1 change: 1 addition & 0 deletions packages/validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],
"dependencies": {
"@subql/common": "workspace:*",
"@subql/common-algorand": "latest",
"@subql/common-avalanche": "latest",
"@subql/common-cosmos": "^0.0.6",
"@subql/common-substrate": "workspace:*",
Expand Down
4 changes: 3 additions & 1 deletion packages/validator/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import {Reader} from '@subql/common';
import {AlgorandProjectManifestVersioned} from '@subql/common-algorand';
import {SubstrateProjectManifestVersioned as AvalancheProjectManifestVersioned} from '@subql/common-avalanche';
import {CosmosProjectManifestVersioned} from '@subql/common-cosmos';
import {SubstrateProjectManifestVersioned} from '@subql/common-substrate';
Expand All @@ -15,7 +16,8 @@ export interface ContextData {
| SubstrateProjectManifestVersioned
| TerraProjectManifestVersioned
| CosmosProjectManifestVersioned
| AvalancheProjectManifestVersioned;
| AvalancheProjectManifestVersioned
| AlgorandProjectManifestVersioned;
}

export interface Context {
Expand Down
4 changes: 4 additions & 0 deletions packages/validator/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import {getProjectNetwork, NETWORK_FAMILY, Reader, ReaderFactory, ReaderOptions} from '@subql/common';
import {parseAlgorandProjectManifest} from '@subql/common-algorand';
import {parseSubstrateProjectManifest as parseAvalancheProjectManifest} from '@subql/common-avalanche';
import {parseCosmosProjectManifest} from '@subql/common-cosmos';
import {parseSubstrateProjectManifest} from '@subql/common-substrate';
Expand Down Expand Up @@ -72,6 +73,9 @@ export class Validator {
case NETWORK_FAMILY.cosmos:
schema = parseCosmosProjectManifest(rawSchema);
break;
case NETWORK_FAMILY.algorand:
schema = parseAlgorandProjectManifest(rawSchema);
break;
default:
console.error(`Load project failed, please check the manifest file.`);
break;
Expand Down
Loading