Skip to content

Commit

Permalink
bump versions to 3.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
will pankiewicz authored and will pankiewicz committed Jan 18, 2024
1 parent bcc6976 commit 57898d3
Show file tree
Hide file tree
Showing 19 changed files with 1,473 additions and 2,517 deletions.
4 changes: 2 additions & 2 deletions apps/1kv-backend-staging/templates/kusama-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
source:
repoURL: https://w3f.github.io/helm-charts/
chart: otv-backend
targetRevision: ^v3.0.8
targetRevision: v3.0.9
plugin:
env:
- name: HELM_VALUES
Expand Down Expand Up @@ -66,7 +66,7 @@ spec:
}
},
"matrix": {
"enabled": false,
"enabled": true,
"baseUrl": "https://matrix.web3.foundation",
"room": {{ .Values.kusama.be.matrix.room | quote}},
"userId": {{ .Values.kusama.be.matrix.userId | quote}}
Expand Down
2 changes: 1 addition & 1 deletion apps/1kv-backend-staging/templates/mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
source:
repoURL: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
chart: mongodb
targetRevision: ^10.31.5
targetRevision: ^14.6.1
plugin:
env:
- name: HELM_VALUES
Expand Down
4 changes: 2 additions & 2 deletions apps/1kv-backend-staging/templates/polkadot-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
source:
repoURL: https://w3f.github.io/helm-charts/
chart: otv-backend
targetRevision: ^v3.0.8
targetRevision: v3.0.9
plugin:
env:
- name: HELM_VALUES
Expand Down Expand Up @@ -67,7 +67,7 @@ spec:
}
},
"matrix": {
"enabled": false,
"enabled": true,
"baseUrl": "https://matrix.web3.foundation",
"room": {{ .Values.polkadot.be.matrix.room | quote}},
"userId": {{ .Values.polkadot.be.matrix.userId | quote}}
Expand Down
4 changes: 2 additions & 2 deletions charts/otv-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: 1K Validators Backend
name: otv-backend
version: v3.0.8
appVersion: v3.0.8
version: v3.0.9
appVersion: v3.0.9
apiVersion: v2
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,27 @@
"start:js:worker": "NODE_OPTIONS='--max-old-space-size=10096' yarn workspace @1kv/worker run js:start"
},
"devDependencies": {
"@types/coingecko-api": "^1",
"@types/coingecko-api": "^1.0.13",
"@types/eslint": "^8.44.7",
"@types/koa-mount": "^4",
"@types/node": "^20.10.5",
"@types/koa-mount": "^4.0.5",
"@types/node": "^20.11.5",
"@types/request": "^2.48.12",
"@types/yamljs": "^0",
"@types/yamljs": "^0.2.34",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"eslint": "8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8"
"eslint-plugin-prettier": "5.0.0",
"prettier": "^3.2.4"
},
"dependencies": {
"coingecko-api": "^1.0.10",
"coingecko-api-v3": "^0.0.29",
"date-fns": "^2.30.0",
"date-fns": "^3.2.0",
"koa-mount": "^4.0.0",
"koa-static": "^5.0.0",
"koa-swagger-decorator": "next",
"node-fetch": "2.6.1",
"koa-swagger-decorator": "^2.2.1",
"node-fetch": "3.3.2",
"request": "^2.88.2",
"swagger-jsdoc": "^6.2.8",
"swagger2": "^4.0.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1kv/common",
"version": "3.0.8",
"version": "3.0.9",
"description": "Services for running the Thousand Validator Program.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down Expand Up @@ -30,12 +30,12 @@
]
},
"dependencies": {
"@polkadot/keyring": "^12.5.1",
"@polkadot/keyring": "^12.6.2",
"@types/mongoose": "^5.11.97",
"@types/node": "^20.2.5",
"@types/node": "^20.11.5",
"hash.js": "^1.1.7",
"mongoose": "^7.6.5",
"typescript": "^4.9.5",
"mongoose": "^8.1.0",
"typescript": "^5.3.3",
"winston": "^3.11.0"
}
}
16 changes: 8 additions & 8 deletions packages/common/src/ApiHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ class ApiHandler extends EventEmitter {
logger.info(`Performing health check for WS Provider for rpc.`, apiLabel);

await sleep(timeout * 1000);
if (api.isConnected) {
if (api && api?.isConnected) {
logger.info(`All good. Connected`, apiLabel);
return true;
} else {
logger.info(
`rpc endpoint still disconnected after ${timeout} seconds. Disconnecting `,
apiLabel
apiLabel,
);
await api.disconnect();

throw new Error(
`rpc endpoint still disconnected after ${timeout} seconds.`
`rpc endpoint still disconnected after ${timeout} seconds.`,
);
}
};
Expand All @@ -54,15 +54,15 @@ class ApiHandler extends EventEmitter {
endpoints,
undefined,
undefined,
POLKADOT_API_TIMEOUT
POLKADOT_API_TIMEOUT,
);

api = new ApiPromise({
provider: new WsProvider(
endpoints,
undefined,
undefined,
POLKADOT_API_TIMEOUT
POLKADOT_API_TIMEOUT,
),
// throwOnConnect: true,
});
Expand All @@ -85,7 +85,7 @@ class ApiHandler extends EventEmitter {
})
.on("error", async (error) => {
logger.warn("The API has an error", apiLabel);
logger.error(error);
logger.error(error, apiLabel);
logger.warn(`attempting to reconnect to ${endpoints[0]}`, apiLabel);
try {
await healthCheck(wsProvider);
Expand All @@ -106,7 +106,7 @@ class ApiHandler extends EventEmitter {
if (reconnectTries < 10) {
return await this.createApi(
endpoints.sort(() => Math.random() - 0.5),
reconnectTries + 1
reconnectTries + 1,
);
} else {
return api;
Expand All @@ -117,7 +117,7 @@ class ApiHandler extends EventEmitter {
static async create(endpoints: string[]): Promise<ApiHandler> {
try {
const api = await this.createApi(
endpoints.sort(() => Math.random() - 0.5)
endpoints.sort(() => Math.random() - 0.5),
);

return new ApiHandler(api, endpoints);
Expand Down
44 changes: 23 additions & 21 deletions packages/common/src/db/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const LatestSessionSchema = new Schema({

export const LatestSessionModel = mongoose.model(
"LatestSession",
LatestSessionSchema
LatestSessionSchema,
);

export const LatestValidatorSetSchema = new Schema({
Expand All @@ -121,7 +121,7 @@ export const LatestValidatorSetSchema = new Schema({

export const LatestValidatorSetModel = mongoose.model(
"LatestValidatorSet",
LatestValidatorSetSchema
LatestValidatorSetSchema,
);

export const LocationSchema = new Schema({
Expand Down Expand Up @@ -166,12 +166,12 @@ export const NominatorStakeSchema = new Schema({
updated: Number,
});

// NominatorStakeSchema.index({ validator: 1, era: -1 });
NominatorStakeSchema.index({ validator: 1, era: -1 });
// NominatorStakeSchema.index({ era: -1 });

export const NominatorStakeModel = mongoose.model(
"NominatorStake",
NominatorStakeSchema
NominatorStakeSchema,
);

export const UpdatingDelegations = new Schema({
Expand All @@ -180,7 +180,7 @@ export const UpdatingDelegations = new Schema({

export const UpdatingDelegationsModel = mongoose.model(
"UpdatingDelegations",
UpdatingDelegations
UpdatingDelegations,
);

export const DelegationSchema = new Schema({
Expand All @@ -200,7 +200,7 @@ export const DelegationModel = mongoose.model("Delegation", DelegationSchema);

export const OpenGovDelegationSchema = new Schema({
delegate: { type: String, index: true },
track: Number,
track: { type: Number, index: true },
totalBalance: Number,
delegatorCount: Number,
delegators: [
Expand All @@ -216,9 +216,11 @@ export const OpenGovDelegationSchema = new Schema({

export const OpenGovDelegationModel = mongoose.model(
"OpenGovDelegation",
OpenGovDelegationSchema
OpenGovDelegationSchema,
);

OpenGovDelegationSchema.index({ delegate: 1, track: 1 });

export const CandidateSchema = new Schema({
// The inherited telemetry ID.
telemetryId: Number,
Expand Down Expand Up @@ -368,7 +370,7 @@ export const ChainMetadataSchema = new Schema({

export const ChainMetadataModel = mongoose.model(
"ChainMetadata",
ChainMetadataSchema
ChainMetadataSchema,
);

// A historical event when the bot will claim a reward on behalf of a nominator
Expand All @@ -385,7 +387,7 @@ export const BotClaimEventSchema = new Schema({

export const BotClaimEventModel = mongoose.model(
"BotClaimEvent",
BotClaimEventSchema
BotClaimEventSchema,
);

export const NominationModel = mongoose.model("Nomination", NominationSchema);
Expand Down Expand Up @@ -424,7 +426,7 @@ export const TotalEraPointsSchema = new Schema({

export const TotalEraPointsModel = mongoose.model(
"TotalEraPoints",
TotalEraPointsSchema
TotalEraPointsSchema,
);

export const EraStatsSchema = new Schema({
Expand Down Expand Up @@ -490,7 +492,7 @@ export const ValidatorScoreSchema = new Schema({

export const ValidatorScoreModel = mongoose.model(
"ValidatorScore",
ValidatorScoreSchema
ValidatorScoreSchema,
);

// ValidatorScoreModel.syncIndexes().then((r) => logger.info(`indexes synced`));
Expand Down Expand Up @@ -746,7 +748,7 @@ export const ValidatorScoreMetadataSchema = new Schema({

export const ValidatorScoreMetadataModel = mongoose.model(
"ValidatorScoreMetadata",
ValidatorScoreMetadataSchema
ValidatorScoreMetadataSchema,
);

export const ReleaseSchema = new Schema({
Expand Down Expand Up @@ -798,7 +800,7 @@ export const LocationStatsSchema = new Schema({

export const LocationStatsModel = mongoose.model(
"LocationStatsModel",
LocationStatsSchema
LocationStatsSchema,
);

// A council member
Expand Down Expand Up @@ -842,7 +844,7 @@ export const ElectionStatsSchema = new Schema({

export const ElectionStatsModel = mongoose.model(
"ElectionStats",
ElectionStatsSchema
ElectionStatsSchema,
);

// Era payout events that happen at the end of every era
Expand Down Expand Up @@ -954,7 +956,7 @@ export const ReferendumVoteSchema = new Schema({

export const ReferendumVoteModel = mongoose.model(
"ReferendumVote",
ReferendumVoteSchema
ReferendumVoteSchema,
);

export const ConvictionVote = new Schema({
Expand Down Expand Up @@ -988,7 +990,7 @@ export const ConvictionVote = new Schema({

export const ConvictionVoteModel = mongoose.model(
"ConvictionVote",
ConvictionVote
ConvictionVote,
);

export const OpenGovReferendum = new Schema({
Expand Down Expand Up @@ -1023,7 +1025,7 @@ export const OpenGovReferendum = new Schema({

export const OpenGovReferendumModel = mongoose.model(
"OpenGovReferendum",
OpenGovReferendum
OpenGovReferendum,
);

export const OpenGovReferendumStats = new Schema({
Expand Down Expand Up @@ -1167,7 +1169,7 @@ export const OpenGovReferendumStats = new Schema({

export const OpenGovReferendumStatsModel = mongoose.model(
"OpenGovReferendumStats",
OpenGovReferendumStats
OpenGovReferendumStats,
);

export const OpenGovVoter = new Schema({
Expand Down Expand Up @@ -1223,7 +1225,7 @@ export const OpenGovDelegate = new Schema({

export const OpenGovDelegateModel = mongoose.model(
"OpenGovDelegate",
OpenGovDelegate
OpenGovDelegate,
);

export const OpenGovTrack = new Schema({
Expand Down Expand Up @@ -1268,7 +1270,7 @@ export const HeartbeatIndex = new Schema({

export const HeartbeatIndexModel = mongoose.model(
"HeartbeatIndex",
HeartbeatIndex
HeartbeatIndex,
);

export const Validator = new Schema({
Expand Down Expand Up @@ -1306,7 +1308,7 @@ export const PayoutTransaction = new Schema({

export const PayoutTransactionModel = mongoose.model(
"PayoutTransaction",
PayoutTransaction
PayoutTransaction,
);

export const Reward = new Schema({
Expand Down
Loading

0 comments on commit 57898d3

Please sign in to comment.