Skip to content

Commit

Permalink
feat: 🎸 add 6.0 chain
Browse files Browse the repository at this point in the history
  • Loading branch information
polymath-eric committed Aug 1, 2023
1 parent 873b54c commit 221179e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/common/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ import { returnsExpectedStatus } from '../common/util';
import { chain } from '../consts';

export async function isChainUp(): Promise<boolean> {
return returnsExpectedStatus(`http://${chain.url}`, 400);
return (
(await returnsExpectedStatus(`http://${chain.url}`, 400)) || // v5.0 returns 400
(await returnsExpectedStatus(`http://${chain.url}`, 405)) // v6.0 returns 405
);
}
7 changes: 4 additions & 3 deletions src/common/containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ export function prepareDockerfile(version: string, image?: string): void {
const template = fs.readFileSync(`${localDir}/mesh.Dockerfile.template`).toString();

let branch = 'mainnet';
if (version === 'latest') {
branch = 'staging';
const platform = process.arch === 'arm64' ? '-arm64' : '';
if (version === 'latest' || version === '6.0.0') {
branch = 'develop';
}
const chainImage = `polymeshassociation/polymesh:${version}-${branch}-debian`;
const chainImage = `polymeshassociation/polymesh${platform}:${version}-${branch}-debian`;

let dockerfile;
if (image) {
Expand Down
3 changes: 2 additions & 1 deletion src/common/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function retry(check: () => Promise<boolean>): Promise<boolean> {
} else if (new Date().getTime() - startTime > timeout) {
return false;
}
await sleep(2000);
await sleep(3000);
}
return false;
}
Expand All @@ -62,6 +62,7 @@ export async function returnsExpectedStatus(
}
throw err;
});

return status === expectedStatus;
}

Expand Down
9 changes: 9 additions & 0 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ export const latestConfig = {
...defaultRestSigners,
};

export const sixZeroZeroConfig = {
chainTag: '6.0.0',
restTag: 'v3.0.0-alpha.5',
subqueryTag: 'v9.7.0-alpha.7',
toolingTag: 'v5.0.2',
...defaultRestSigners,
};

export const fiveTwoZeroConfig = {
chainTag: '5.2.0',
restTag: 'v2.6.0',
Expand Down Expand Up @@ -67,6 +75,7 @@ export const fiveZeroThreeConfig = {
};

export const bundledConfig = [
sixZeroZeroConfig,
fiveFourZeroConfig,
fiveThreeZeroConfig,
fiveTwoZeroConfig,
Expand Down

0 comments on commit 221179e

Please sign in to comment.