Browse Source

Add new template format & update code to the new Joystream types

Ricardo Maltez 4 years ago
parent
commit
4bb90820a0

+ 3 - 3
council/report-generator/package.json

@@ -8,7 +8,7 @@
     "status": "node lib/status"
   },
   "dependencies": {
-    "@joystream/types": "^0.9.1",
+    "@joystream/types": "^0.12.0",
     "@polkadot/api": "^0.96.1",
     "@polkadot/keyring": "^1.7.0-beta.5",
     "@polkadot/types": "^0.96.1",
@@ -18,7 +18,7 @@
     "bn.js": "^4.11.8"
   },
   "devDependencies": {
-    "@polkadot/ts": "^0.1.56",
-    "typescript": "3.7.2"
+    "@polkadot/ts": "^0.3.40",
+    "typescript": "4.0.2"
   }
 }

+ 56 - 75
council/report-generator/report-template.md

@@ -2,117 +2,98 @@
 This is a report which explains the current state of the Joystream network in numbers. It pulls figures from the chain and tries to provide a basic level of information about the network, tokens and more. 
 
 ## 1.0 Basic Information
+* Block range: {startBlock} - {endBlock}
 * Date Range: {dateStart} - {dateEnd}
 * Council session #: {councilRound}
-* Starting block: {startBlock}
-* Block range: {startBlock} - {endBlock}
-
-### 1.1 Block Generation Information
-| Property                        | This Session | All Sessions | % Change |
-|---------------------------------|--------------|--------------|----------|
-| Number of blocks                | {newBlocks}       | {endBlock}   |   {percNewBlocks}       |
-| Block generation time (average) | {avgBlockProduction}|              |          |
-| Number of nodes (average)       |                     |              |          |
-
-### 1.2 Token + USD Information
-| Property       | This Session | All Sessions | % Change |
-|----------------|--------------|--------------|----------|
-| Token Issuance | {newIssuance}   | {totalIssuance}| {percNewIssuance}|
-| Token Burn     | {newTokensBurn} |              |          |
-| USD Backing    |                 |              |          |
-
-### 1.3 Membership Information
-| Property          | This Session | All Sessions | % Change |
-|-------------------|--------------|--------------|----------|
-| Number of members |{newMembers}  |{totalMembers}|{percNewMembers}|
 
 ## 2.0 Tokenomics
 ### 2.1 Token generation breakdown
-| Property                    | This Session | All Sessions | % Change |
+| Property                    | Start Block | End Block | % Change |
 |-----------------------------|--------------|--------------|----------|
-| Total Tokens Minted         |{totalMinted}            |              |          |
-| Validator Role              |{newValidatorReward}|              |          |
-| Storage Role                |{newStorageProviderReward}              |              |          |
-| Council Role                |              |              |          |
+| Total Tokens Minted        |              |              |          |
+| Total Tokens Burned        |              |              |          |
+| Validator Role        |              |              |          |
+| Council Role |              |              |          |
+| Storage Role       |              |              |          |
+| Curator Role       |              |              |          |
 
 ### 2.2 Mints 
-| Property                  | This Session | All Sessions | % Change |
-|---------------------------|--------------|--------------|----------|
-| Council Mint Total Minted |{newCouncilMinted}|              |          |
-| Curator Mint Total Minted |{newCuratorMinted}|              |          |
+| Property                    | Start Block | End Block | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Council Mint Total Minted       |              |              |          |
+| Curator Mint Total Minted |              |              |          |
+| Storage Mint Total Minted |              |              |          |
 
 ## 3.0 Council
 * Council session #: {councilRound}
 * Number of council members: {councilMembers}
 * Total number of proposals: {newProposals}
-### 3.1 Elections
-| Property                    | This Session | All Sessions | % Change |
-|-----------------------------|--------------|--------------|----------|
-| Total Applicants            |{electionApplicants}      |{electionAvgApplicants}||
-| Total Applicant Stake       |{electionApplicantsStakes}|              |          |
-| Total Votes                 |{electionVotes}           |              |          |
-| Avg Votes per Applicant     |{avgVotePerApplicant}     |              |          |
+* Total number of Approved proposals:
 
-### 3.2 Proposals
-| Proposal Type                           | # of proposals during this session | Total number of proposal type |
-|-----------------------------------------|------------------------------------|-------------------------------|
-| Text                                    | {newTextProposals}                              |                               |
-| Runtime Upgrade                         | {newRuntimeUpgradeProposal}                    |                               |
-| Set Election Parameters                 | {newSetElectionParametersProposal}              |                               |
-| Spending                                | {newSpendingProposal}                           |                               |
-| Set Lead                                | {newSetLeadProposal}                            |                               |
-| Set Content Working Group Mint Capacity | {newSetContentWorkingGroupMintCapacityProposal} |                               |
-| Evict Storage Provider                  | {newEvictStorageProviderProposal}               |                               |
-| Set Validator Count                     | {newSetValidatorCountProposal}                  |                               |
-| Set Storage Role Parameters             | {newSetStorageRoleParametersProposal}           |                               |
-* Average time for proposal vote success:
-* Average overall time for proposal vote success:
+* ### 3.1 Elections
+| Property                    | Start Block  |
+|-----------------------------|--------------|
+| Total Applicants            |{electionApplicants}              |
+| Total Applicant Stake       |{electionApplicantsStakes}              |
+| Total Votes                 |{electionVotes}             |
 
 ## 4 Roles
 ### 4.1 Validator Information
-| Property                    | This Session | All Sessions | % Change |
+* Block generation time (average):
+
+| Property                    | Start Block | End Block | % Change |
 |-----------------------------|--------------|--------------|----------|
-| Number of validators        | {avgValidators}             |              |          |
 | Validator total stake       |              |              |          |
-| Average stake per validator |              |              |          |
-| Tokens generated by validator role |{newValidatorReward}            |              |          |
 
 ### 4.2 Storage Role
-| Property                | This Session | All Sessions | % Change |
+| Property                | Start Block | End Block | % Change |
 |-------------------------|--------------|--------------|----------|
-| Number of storage nodes |              |              |          |
-| Content storage size    |              |              |          |
-| Total storage stake     |              |              |          |
-| Average storage stake   |              |              |          |
-| Storage Role Reward (/24h)   |              |              |          |
+| Mint Tokens Generated (Total)    |              |              |          |
+| Number of storage workers |              |              |          |
+| Total storage stake (workers + lead)  |              |              |          |
+| Total lead earned rewards   |              |              |          |
+| Total worker earned rewards   |              |              |          |
+| Total missed rewards   |              |              |          |
+| Total rewards   |              |              |          |
 
 ### 4.3 Curator Role
-| Property                | This Session | All Sessions | % Change |
+| Property                | Start Block | End Block | % Change |
 |-------------------------|--------------|--------------|----------|
+| Mint Tokens Generated (Total)    |              |              |          |
+| Total lead earned rewards   |              |              |          |
+| Total worker earned rewards   |              |              |          |
+| Total missed rewards   |              |              |          |
 | Curator roles filled     |              |              |          |
 
-
 ## 5.0 User Generated Content
-### 5.1 Media & Uploads
-| Property                | This Session | All Sessions | % Change |
+### 5.1 Membership Information
+| Property          | Start Block | End Block | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of members |              |              |          |
+
+### 5.2 Media & Uploads
+| Property                | Start Block | End Block | % Change |
 |-------------------------|--------------|--------------|----------|
-| Number of uploads       | {newMedia}       |{totalMedia} | {percNewMedia} |
-| Size of content         | {newUsedSpace} | {totalUsedSpace} | {percNewUsedSpace} |
-| Average size of content | {avgNewSizePerContent} |  {totalAvgSizePerContent} | {percAvgSizePerContent}|
-| Number of channels      | {newChannels} | {totalChannels} | {percNewChannels} |
-| Avg. uploads per channel      |              |              |          |
+| Number of uploads       |              |              |          |
+| Size of content         |              |              |          |
+| Number of channels      |              |              |          |
 
-### 5.2 Forum Activity
-| Property          | This Session | All Sessions | % Change |
+### 5.3 Forum Activity
+| Property          | Start Block | End Block | % Change |
 |-------------------|--------------|--------------|----------|
-| Number of threads | {newThreads} |{totalThreads}| {percNewThreads}|
-| Number of posts   | {newPosts}   |{totalPosts}  | {percNewPosts}|
+| Number of categories | {startCategories} | {endCategories} | {perNewCategories}         |
+| Number of threads    | {startThreads}| {endThreads} | {newThreads}         |
+| Number of posts      | {startPosts} | {endPosts}            |  {percNewPosts}        |
 
 ## 6 Todo / Ideas
+These are properties that are a bit difficult to currently work with, but can be added in future reports:
 * Video duration
-* KPIs
 * Unique channels
 * Verified channels
 * Censored channels
 * Forum posts by subcategory
 * Total staked across platform
+* Avg. uploads per channel
+* Average time for proposal vote success:
+* Average overall time for proposal vote success:
+* USD backing

+ 118 - 0
council/report-generator/report-template.md.old

@@ -0,0 +1,118 @@
+# Tokenomics + Network Report
+This is a report which explains the current state of the Joystream network in numbers. It pulls figures from the chain and tries to provide a basic level of information about the network, tokens and more. 
+
+## 1.0 Basic Information
+* Date Range: {dateStart} - {dateEnd}
+* Council session #: {councilRound}
+* Starting block: {startBlock}
+* Block range: {startBlock} - {endBlock}
+
+### 1.1 Block Generation Information
+| Property                        | This Session | All Sessions | % Change |
+|---------------------------------|--------------|--------------|----------|
+| Number of blocks                | {newBlocks}       | {endBlock}   |   {percNewBlocks}       |
+| Block generation time (average) | {avgBlockProduction}|              |          |
+| Number of nodes (average)       |                     |              |          |
+
+### 1.2 Token + USD Information
+| Property       | This Session | All Sessions | % Change |
+|----------------|--------------|--------------|----------|
+| Token Issuance | {newIssuance}   | {totalIssuance}| {percNewIssuance}|
+| Token Burn     | {newTokensBurn} |              |          |
+| USD Backing    |                 |              |          |
+
+### 1.3 Membership Information
+| Property          | This Session | All Sessions | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of members |{newMembers}  |{totalMembers}|{percNewMembers}|
+
+## 2.0 Tokenomics
+### 2.1 Token generation breakdown
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Total Tokens Minted         |{totalMinted}            |              |          |
+| Validator Role              |{newValidatorReward}|              |          |
+| Storage Role                |{newStorageProviderReward}              |              |          |
+| Council Role                |              |              |          |
+
+### 2.2 Mints 
+| Property                  | This Session | All Sessions | % Change |
+|---------------------------|--------------|--------------|----------|
+| Council Mint Total Minted |{newCouncilMinted}|              |          |
+| Curator Mint Total Minted |{newCuratorMinted}|              |          |
+
+## 3.0 Council
+* Council session #: {councilRound}
+* Number of council members: {councilMembers}
+* Total number of proposals: {newProposals}
+### 3.1 Elections
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Total Applicants            |{electionApplicants}      |{electionAvgApplicants}||
+| Total Applicant Stake       |{electionApplicantsStakes}|              |          |
+| Total Votes                 |{electionVotes}           |              |          |
+| Avg Votes per Applicant     |{avgVotePerApplicant}     |              |          |
+
+### 3.2 Proposals
+| Proposal Type                           | # of proposals during this session | Total number of proposal type |
+|-----------------------------------------|------------------------------------|-------------------------------|
+| Text                                    | {newTextProposals}                              |                               |
+| Runtime Upgrade                         | {newRuntimeUpgradeProposal}                    |                               |
+| Set Election Parameters                 | {newSetElectionParametersProposal}              |                               |
+| Spending                                | {newSpendingProposal}                           |                               |
+| Set Lead                                | {newSetLeadProposal}                            |                               |
+| Set Content Working Group Mint Capacity | {newSetContentWorkingGroupMintCapacityProposal} |                               |
+| Evict Storage Provider                  | {newEvictStorageProviderProposal}               |                               |
+| Set Validator Count                     | {newSetValidatorCountProposal}                  |                               |
+| Set Storage Role Parameters             | {newSetStorageRoleParametersProposal}           |                               |
+* Average time for proposal vote success:
+* Average overall time for proposal vote success:
+
+## 4 Roles
+### 4.1 Validator Information
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Number of validators        | {avgValidators}             |              |          |
+| Validator total stake       |              |              |          |
+| Average stake per validator |              |              |          |
+| Tokens generated by validator role |{newValidatorReward}            |              |          |
+
+### 4.2 Storage Role
+| Property                | This Session | All Sessions | % Change |
+|-------------------------|--------------|--------------|----------|
+| Number of storage nodes |              |              |          |
+| Content storage size    |              |              |          |
+| Total storage stake     |              |              |          |
+| Average storage stake   |              |              |          |
+| Storage Role Reward (/24h)   |              |              |          |
+
+### 4.3 Curator Role
+| Property                | This Session | All Sessions | % Change |
+|-------------------------|--------------|--------------|----------|
+| Curator roles filled     |              |              |          |
+
+
+## 5.0 User Generated Content
+### 5.1 Media & Uploads
+| Property                | This Session | All Sessions | % Change |
+|-------------------------|--------------|--------------|----------|
+| Number of uploads       | {newMedia}       |{totalMedia} | {percNewMedia} |
+| Size of content         | {newUsedSpace} | {totalUsedSpace} | {percNewUsedSpace} |
+| Average size of content | {avgNewSizePerContent} |  {totalAvgSizePerContent} | {percAvgSizePerContent}|
+| Number of channels      | {newChannels} | {totalChannels} | {percNewChannels} |
+| Avg. uploads per channel      |              |              |          |
+
+### 5.2 Forum Activity
+| Property          | This Session | All Sessions | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of threads | {newThreads} |{totalThreads}| {percNewThreads}|
+| Number of posts   | {newPosts}   |{totalPosts}  | {percNewPosts}|
+
+## 6 Todo / Ideas
+* Video duration
+* KPIs
+* Unique channels
+* Verified channels
+* Censored channels
+* Forum posts by subcategory
+* Total staked across platform

+ 42 - 46
council/report-generator/report.md

@@ -2,71 +2,69 @@
 This is a report which explains the current state of the Joystream network in numbers. It pulls figures from the chain and tries to provide a basic level of information about the network, tokens and more. 
 
 ## 1.0 Basic Information
-* Date Range: DD/MM/YYYY - DD/MM/YYYY
-* Council session #: XX
-* Starting block: 908796
-* Block range: 908796 - 1038810
+* Date Range: 5/26/2020 - 6/2/2020
+* Council session #: 2
+* Starting block: 995611
+* Block range: 995611 - 1096410
 
 ### 1.1 Block Generation Information
 | Property                        | This Session | All Sessions | % Change |
 |---------------------------------|--------------|--------------|----------|
-| Number of blocks                | 130014       | 1038810   |   12.52       |
-| Block generation time (average) | 6.03|              |          |
+| Number of blocks                | 100799       | 1096410   |   9.19       |
+| Block generation time (average) | 6.02|              |          |
 | Number of nodes (average)       |                     |              |          |
 
 ### 1.2 Token + USD Information
 | Property       | This Session | All Sessions | % Change |
 |----------------|--------------|--------------|----------|
-| Token Issuance | {newIssuance}|              |          |
-| Token Burn     | {newTokensBurn}    |              |          |
-| USD Backing    | {usdBacking} |              |          |
+| Token Issuance | 6120596   | 106810416| 5.73|
+| Token Burn     | 1126315 |              |          |
+| USD Backing    |                 |              |          |
 
 ### 1.3 Membership Information
 | Property          | This Session | All Sessions | % Change |
 |-------------------|--------------|--------------|----------|
-| Number of members | {NR_MEMBERS}             |              |          |
+| Number of members |7  |443|1.58|
 
 ## 2.0 Tokenomics
 ### 2.1 Token generation breakdown
 | Property                    | This Session | All Sessions | % Change |
 |-----------------------------|--------------|--------------|----------|
-| Total Tokens Minted        |              |              |          |
-| Validator Role        |              |              |          |
-| Storage Role       |              |              |          |
-| Council Role |              |              |          |
+| Total Tokens Minted         |2401000            |              |          |
+| Validator Role              |78929|              |          |
+| Storage Role                |4972800              |              |          |
+| Council Role                |              |              |          |
 
 ### 2.2 Mints 
-| Property                    | This Session | All Sessions | % Change |
-|-----------------------------|--------------|--------------|----------|
-| Council Mint Capacity        |              |              |          |
-| Council Mint Total Minted       |              |              |          |
-| Curator Mint Capacity |              |              |          |
-| Curator Mint Total Minted |              |              |          |
+| Property                  | This Session | All Sessions | % Change |
+|---------------------------|--------------|--------------|----------|
+| Council Mint Total Minted |2401000|              |          |
+| Curator Mint Total Minted |0|              |          |
 
 ## 3.0 Council
-* Council session #: XX
-* Number of council members:
-* Total number of proposals:
+* Council session #: 2
+* Number of council members: 10
+* Total number of proposals: 6
 ### 3.1 Elections
 | Property                    | This Session | All Sessions | % Change |
 |-----------------------------|--------------|--------------|----------|
-| Total Applicants       |              |              |          |
-| Total Applicant Stake       |              |              |          |
-| Total Votes       |              |              |          |
-| Avg Votes per Applicant       |              |              |          |
+| Total Applicants            |0      |0||
+| Total Applicant Stake       |0|              |          |
+| Total Votes                 |0           |              |          |
+| Avg Votes per Applicant     |0     |              |          |
 
 ### 3.2 Proposals
 | Proposal Type                           | # of proposals during this session | Total number of proposal type |
 |-----------------------------------------|------------------------------------|-------------------------------|
-| Text                                    |                                    |                               |
-| Runtime Upgrade                         |                                    |                               |
-| Set Election Parameters                 |                                    |                               |
-| Spending                                |                                    |                               |
-| Set Lead                                |                                    |                               |
-| Set Content Working Group Mint Capacity |                                    |                               |
-| Evict Storage Provider                  |                                    |                               |
-| Set Validator Count                     |                                    |                               |
-| Set Storage Role Parameters             |                                    |                               |
+| Text                                    | 4                              |                               |
+| Runtime Upgrade                         | 0                    |                               |
+| Set Election Parameters                 | 0              |                               |
+| Spending                                | 0                           |                               |
+| Set Lead                                | 0                            |                               |
+| Set Content Working Group Mint Capacity | 2 |                               |
+| Evict Storage Provider                  | 0               |                               |
+| Set Validator Count                     | 0                  |                               |
+| Set Storage Role Parameters             | 0           |                               |
 * Average time for proposal vote success:
 * Average overall time for proposal vote success:
 
@@ -74,10 +72,10 @@ This is a report which explains the current state of the Joystream network in nu
 ### 4.1 Validator Information
 | Property                    | This Session | All Sessions | % Change |
 |-----------------------------|--------------|--------------|----------|
-| Number of validators        | {nrValidators}             |              |          |
+| Number of validators        | 19.88             |              |          |
 | Validator total stake       |              |              |          |
 | Average stake per validator |              |              |          |
-| Tokens generated by validator role |              |              |          |
+| Tokens generated by validator role |78929            |              |          |
 
 ### 4.2 Storage Role
 | Property                | This Session | All Sessions | % Change |
@@ -91,8 +89,6 @@ This is a report which explains the current state of the Joystream network in nu
 ### 4.3 Curator Role
 | Property                | This Session | All Sessions | % Change |
 |-------------------------|--------------|--------------|----------|
-| Mint Capacity |              |              |          |
-| Mint Tokens Generated (Total)    |              |              |          |
 | Curator roles filled     |              |              |          |
 
 
@@ -100,17 +96,17 @@ This is a report which explains the current state of the Joystream network in nu
 ### 5.1 Media & Uploads
 | Property                | This Session | All Sessions | % Change |
 |-------------------------|--------------|--------------|----------|
-| Number of uploads       |      {newMedia}        |              |          |
-| Size of content         |   364445554           |              |          |
-| Average size of content |   {avgNewContentSize}           |              |          |
-| Number of channels      |  {newChannels}        | {nrTotalChannels}             |          |
+| Number of uploads       | 17       |44 | 38.64 |
+| Size of content         | 2740796992 | 8889147068 | 30.83 |
+| Average size of content | 161223352.47 |  202026069.73 | 79.8|
+| Number of channels      | 5 | 23 | 21.74 |
 | Avg. uploads per channel      |              |              |          |
 
 ### 5.2 Forum Activity
 | Property          | This Session | All Sessions | % Change |
 |-------------------|--------------|--------------|----------|
-| Number of threads | 6 |{totalThreads}|          |
-| Number of posts   | 51   |{totalPosts}  |          |
+| Number of threads | 6 |40| 15|
+| Number of posts   | 45   |267  | 16.85|
 
 ## 6 Todo / Ideas
 * Video duration

+ 7 - 0
council/report-generator/src/StatisticsData.ts

@@ -33,15 +33,22 @@ export class StatisticsData {
 
     newStorageProviderReward: number;
 
+    startThreads: number;
+    endThreads: number;
     newThreads: number;
     totalThreads: number;
     percNewThreads: number;
 
+    startPosts: number;
+    endPosts: number;
     newPosts: number;
     totalPosts: number;
     percNewPosts: number;
 
+    startCategories: number;
+    endCategories: number;
     newCategories: number;
+    perNewCategories: number;
 
     newProposals: number;
 

+ 19 - 16
council/report-generator/src/statistics.ts

@@ -2,21 +2,23 @@ import {rpc} from "@polkadot/types/interfaces/definitions";
 import {ApiPromise, WsProvider} from "@polkadot/api";
 import {registerJoystreamTypes} from '@joystream/types';
 import {AccountId, Balance, BlockNumber, EventRecord, Hash, Moment} from "@polkadot/types/interfaces";
-import {ClassId, ClassPropertyValue, Entity, EntityId} from "@joystream/types/lib/versioned-store";
-import {Mint, MintId} from "@joystream/types/lib/mint";
-import {Option, u32, Vec} from "@polkadot/types";
-import {ContentId, DataObject} from "@joystream/types/lib/media";
-import {Stake, StakeId} from "@joystream/types/lib/stake";
-import Linkage from "@polkadot/types/codec/Linkage";
-import {CategoryId, PostId, ThreadId} from "@joystream/types/lib/forum";
-import {MemberId} from "@joystream/types/lib/members";
-import number from "@polkadot/util/is/number";
+
 import {Exchange, ProposalTypes, StatisticsData, ValidatorReward} from "./StatisticsData";
-import {ProposalDetails, Seats} from "@joystream/types/lib/proposals";
-import {ApplicationStage} from "@joystream/types/lib/hiring";
-import {Stake as ApplicantStake} from "@joystream/types/lib";
-import {RoleParameters} from "@joystream/types/lib/roles";
-import {ChannelId, CuratorId} from "@joystream/types/lib/content-working-group";
+
+import {u32, Vec} from "@polkadot/types";
+import {ElectionStake, Seats} from "@joystream/types/council";
+import {MemberId} from "@joystream/types/members";
+import {Stake, StakeId} from "@joystream/types/stake";
+import {Mint, MintId} from "@joystream/types/mint";
+import {ChannelId} from "@joystream/types/content-working-group";
+import {ContentId, DataObject} from "@joystream/types/media";
+import {PostId, ThreadId} from "@joystream/types/common";
+import {CategoryId} from "@joystream/types/forum";
+import {ProposalDetails} from "@joystream/types/proposals";
+import {RoleParameters} from "@joystream/types/roles";
+import {Entity, EntityId} from "@joystream/types/versioned-store";
+import Option from "@polkadot/types/codec/Option";
+import Linkage from "@polkadot/types/codec/Linkage";
 
 const BURN_ADDRESS = '5D5PhZQNJzcJXVBxwJxZcsutjKPqUPydrvpu6HeiBfMaeKQu';
 
@@ -49,7 +51,7 @@ export class StatisticsCollector {
 
         statistics.electionApplicantsStakes = 0;
         for (let applicant of applicants) {
-            let applicantStakes = await api.query.councilElection.applicantStakes.at(startHash, applicant) as unknown as ApplicantStake;
+            let applicantStakes = await api.query.councilElection.applicantStakes.at(startHash, applicant) as unknown as ElectionStake;
             statistics.electionApplicantsStakes += applicantStakes.new.toNumber();
         }
         statistics.electionVotes = seats.map((seat) => seat.backers.length).reduce((a, b) => a + b);
@@ -396,7 +398,8 @@ export class StatisticsCollector {
     }
 
     static async connectApi(): Promise<ApiPromise> {
-        const provider = new WsProvider('ws://127.0.0.1:9944');
+        // const provider = new WsProvider('wss://testnet.joystream.org:9944');
+        const provider = new WsProvider('wss://rome-rpc-endpoint.joystream.org:9944');
         // register types before creating the api
         registerJoystreamTypes();