Browse Source

Add Council Report Generator - Alpha version

Ricardo Maltez 4 years ago
parent
commit
e92d5d5c78

+ 4 - 0
council/report-generator/.gitignore

@@ -0,0 +1,4 @@
+.idea/*
+lib/*
+node_modules
+yarn.lock

+ 24 - 0
council/report-generator/package.json

@@ -0,0 +1,24 @@
+{
+  "name": "@joystream/api-examples",
+  "version": "0.1.0",
+  "main": "lib/index.js",
+  "license": "MIT",
+  "scripts": {
+    "build": "tsc --build tsconfig.json",
+    "status": "node lib/status"
+  },
+  "dependencies": {
+    "@joystream/types": "^0.9.1",
+    "@polkadot/api": "^0.96.1",
+    "@polkadot/keyring": "^1.7.0-beta.5",
+    "@polkadot/types": "^0.96.1",
+    "@polkadot/util": "^1.7.0-beta.5",
+    "@polkadot/util-crypto": "^1.7.0-beta.5",
+    "@types/bn.js": "^4.11.5",
+    "bn.js": "^4.11.8"
+  },
+  "devDependencies": {
+    "@polkadot/ts": "^0.1.56",
+    "typescript": "3.7.2"
+  }
+}

+ 122 - 0
council/report-generator/report-template.md

@@ -0,0 +1,122 @@
+# 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: DD/MM/YYYY - DD/MM/YYYY
+* Council session #: XX
+* 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}|              |          |
+| Token Burn     | {newTokensBurn}    |              |          |
+| USD Backing    | {usdBacking} |              |          |
+
+### 1.3 Membership Information
+| Property          | This Session | All Sessions | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of members | {NR_MEMBERS}             |              |          |
+
+## 2.0 Tokenomics
+### 2.1 Token generation breakdown
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Total Tokens Minted        |              |              |          |
+| Validator Role        |              |              |          |
+| Storage Role       |              |              |          |
+| 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 |              |              |          |
+
+## 3.0 Council
+* Council session #: XX
+* Number of council members:
+* Total number of proposals:
+### 3.1 Elections
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Total Applicants       |              |              |          |
+| Total Applicant Stake       |              |              |          |
+| Total Votes       |              |              |          |
+| Avg Votes per Applicant       |              |              |          |
+
+### 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             |                                    |                               |
+* 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        | {nrValidators}             |              |          |
+| Validator total stake       |              |              |          |
+| Average stake per validator |              |              |          |
+| Tokens generated by validator role |              |              |          |
+
+### 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 |
+|-------------------------|--------------|--------------|----------|
+| Mint Capacity |              |              |          |
+| Mint Tokens Generated (Total)    |              |              |          |
+| Curator roles filled     |              |              |          |
+
+
+## 5.0 User Generated Content
+### 5.1 Media & Uploads
+| Property                | This Session | All Sessions | % Change |
+|-------------------------|--------------|--------------|----------|
+| Number of uploads       |      {newMedia}        |              |          |
+| Size of content         |   {totalNewUsedSpace}           |              |          |
+| Average size of content |   {avgNewContentSize}           |              |          |
+| Number of channels      |  {newChannels}        | {nrTotalChannels}             |          |
+| Avg. uploads per channel      |              |              |          |
+
+### 5.2 Forum Activity
+| Property          | This Session | All Sessions | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of threads | {newThreads} |{totalThreads}|          |
+| Number of posts   | {newPosts}   |{totalPosts}  |          |
+
+## 6 Todo / Ideas
+* Video duration
+* KPIs
+* Unique channels
+* Verified channels
+* Censored channels
+* Forum posts by subcategory
+* Total staked across platform

+ 122 - 0
council/report-generator/report.md

@@ -0,0 +1,122 @@
+# 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: DD/MM/YYYY - DD/MM/YYYY
+* Council session #: XX
+* Starting block: 908796
+* Block range: 908796 - 1038810
+
+### 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 nodes (average)       |                     |              |          |
+
+### 1.2 Token + USD Information
+| Property       | This Session | All Sessions | % Change |
+|----------------|--------------|--------------|----------|
+| Token Issuance | {newIssuance}|              |          |
+| Token Burn     | {newTokensBurn}    |              |          |
+| USD Backing    | {usdBacking} |              |          |
+
+### 1.3 Membership Information
+| Property          | This Session | All Sessions | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of members | {NR_MEMBERS}             |              |          |
+
+## 2.0 Tokenomics
+### 2.1 Token generation breakdown
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Total Tokens Minted        |              |              |          |
+| Validator Role        |              |              |          |
+| Storage Role       |              |              |          |
+| 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 |              |              |          |
+
+## 3.0 Council
+* Council session #: XX
+* Number of council members:
+* Total number of proposals:
+### 3.1 Elections
+| Property                    | This Session | All Sessions | % Change |
+|-----------------------------|--------------|--------------|----------|
+| Total Applicants       |              |              |          |
+| Total Applicant Stake       |              |              |          |
+| Total Votes       |              |              |          |
+| Avg Votes per Applicant       |              |              |          |
+
+### 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             |                                    |                               |
+* 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        | {nrValidators}             |              |          |
+| Validator total stake       |              |              |          |
+| Average stake per validator |              |              |          |
+| Tokens generated by validator role |              |              |          |
+
+### 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 |
+|-------------------------|--------------|--------------|----------|
+| Mint Capacity |              |              |          |
+| Mint Tokens Generated (Total)    |              |              |          |
+| Curator roles filled     |              |              |          |
+
+
+## 5.0 User Generated Content
+### 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}             |          |
+| Avg. uploads per channel      |              |              |          |
+
+### 5.2 Forum Activity
+| Property          | This Session | All Sessions | % Change |
+|-------------------|--------------|--------------|----------|
+| Number of threads | 6 |{totalThreads}|          |
+| Number of posts   | 51   |{totalPosts}  |          |
+
+## 6 Todo / Ideas
+* Video duration
+* KPIs
+* Unique channels
+* Verified channels
+* Censored channels
+* Forum posts by subcategory
+* Total staked across platform

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

@@ -0,0 +1,28 @@
+export class StatisticsData {
+    startBlock: number;
+    endBlock: number;
+    percNewBlocks: number
+
+    newBlocks: number;
+    avgBlockProduction: number;
+    nrValidators: number;
+    newPosts: number;
+    newThreads: number;
+    newCategories: number;
+    totalIssuance: number;
+    newMembers: number;
+    newProposals: number;
+    newMedia: number;
+    deletedMedia: number;
+    createdMints: number;
+    totalMinted: number;
+    totalMintCapacityIncrease: number;
+    // totalBurned: number;
+    totalNewUsedSpace: number;
+    newStakes: number;
+    totalNewStakeValue: number;
+
+    constructor() {
+    }
+
+}

+ 45 - 0
council/report-generator/src/generator.ts

@@ -0,0 +1,45 @@
+import {StatisticsCollector} from "./statistics";
+
+const fs = require('fs').promises;
+
+async function main() {
+    const args = process.argv.slice(2);
+
+    if (args.length != 2) {
+        console.error('Usage: [start bock number] [end block number]');
+        process.exit(1);
+    }
+
+    const startBlock = Number(args[0]);
+    const endBlock = Number(args[1]);
+
+    if (isNaN(startBlock) || isNaN(endBlock) || startBlock >= endBlock) {
+        console.error('Invalid block range');
+        process.exit(1);
+    }
+
+    try {
+        let fileData = await fs.readFile(__dirname + '/../report-template.md', {
+            encoding: "utf8"
+        });
+        console.log('Getting report info...');
+        let statistics =  await StatisticsCollector.getStatistics(startBlock, endBlock);
+        console.log('Writing info in the report...');
+
+        let entries = Object.entries(statistics);
+
+        for (let entry of entries){
+            let regex = new RegExp('{' + entry[0] + '}', "g");
+            fileData = fileData.replace(regex, entry[1].toString());
+        }
+
+        await fs.writeFile('report.md', fileData);
+        console.log('Report generated!');
+        process.exit(0);
+    }catch (e) {
+        console.error(e);
+    }
+
+}
+
+main();

+ 172 - 0
council/report-generator/src/statistics.ts

@@ -0,0 +1,172 @@
+import {rpc} from "@polkadot/types/interfaces/definitions";
+import {ApiPromise, WsProvider} from "@polkadot/api";
+import {registerJoystreamTypes} from '@joystream/types';
+import {Balance, Hash, Moment} from "@polkadot/types/interfaces";
+import {ClassId, ClassPropertyValue, Entity} from "@joystream/types/lib/versioned-store";
+import {Mint} 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 {StatisticsData} from "./StatisticsData";
+
+const BURN_ADDRESS = '5D5PhZQNJzcJXVBxwJxZcsutjKPqUPydrvpu6HeiBfMaeKQu';
+
+
+class Media {
+
+    constructor(public id: number, public title: string) {
+    }
+}
+
+export class StatisticsCollector {
+    static async getStatistics(startBlock: number, endBlock: number): Promise<StatisticsData> {
+
+        // Initialise the provider to connect to the local node
+        const provider = new WsProvider('wss://rome-rpc-endpoint.joystream.org:9944');
+
+        // register types before creating the api
+        registerJoystreamTypes();
+
+        // Create the API and wait until ready
+        const api = await ApiPromise.create({provider});
+
+        let statistics = new StatisticsData();
+
+        statistics.startBlock = startBlock;
+        statistics.endBlock = endBlock;
+        statistics.newBlocks = endBlock - startBlock;
+        statistics.percNewBlocks = Number((statistics.newBlocks / endBlock * 100).toFixed(2));
+
+        let startHash = await api.rpc.chain.getBlockHash(startBlock);
+        let endHash = await api.rpc.chain.getBlockHash(endBlock);
+
+        let startNrStakes = await api.query.stake.stakesCreated.at(startHash) as StakeId;
+        let endNrStakes = await api.query.stake.stakesCreated.at(endHash) as StakeId;
+        statistics.newStakes = endNrStakes.toNumber() - startNrStakes.toNumber();
+
+        for (let i = startNrStakes.toNumber(); i < endNrStakes.toNumber(); ++i) {
+            let stakeResult = await api.query.stake.stakes(i) as unknown as [Stake, Linkage<StakeId>];
+            let stake = stakeResult[0] as Stake;
+
+            statistics.totalNewStakeValue += stake.value ? stake.value.toNumber() : 0;
+        }
+
+        // let startBurnedTokens = await api.query.balances.freeBalance.at(startHash, BURN_ADDRESS) as Balance;
+        // let endBurnedTokens = await api.query.balances.freeBalance.at(endHash, BURN_ADDRESS) as Balance;
+        //
+        // statistics.totalBurned = endBurnedTokens.toNumber() - startBurnedTokens.toNumber();
+
+        let startDataObjects = await api.query.dataDirectory.knownContentIds.at(startHash) as Vec<ContentId>;
+        let startUsedSpace = await this.computeUsedSpaceInBytes(api, startDataObjects);
+
+        let endDataObjects = await api.query.dataDirectory.knownContentIds.at(endHash) as Vec<ContentId>;
+        let endUsedSpace = await this.computeUsedSpaceInBytes(api, endDataObjects);
+
+        statistics.totalNewUsedSpace = endUsedSpace - startUsedSpace;
+
+        let startNrMints = parseInt((await api.query.minting.mintsCreated.at(startHash)).toString());
+        let endNrMints = parseInt((await api.query.minting.mintsCreated.at(endHash)).toString());
+
+        statistics.createdMints = endNrMints - startNrMints;
+
+        for (let i = 0; i < startNrMints; ++i) {
+            let startMintResult = await api.query.minting.mints.at(startHash, i) as unknown as [2];
+            let startMint = startMintResult[0] as unknown as Mint;
+
+            let endMintResult = await api.query.minting.mints.at(endHash, i) as unknown as [2];
+            let endMint = endMintResult[0] as unknown as Mint;
+
+            statistics.totalMinted = parseInt(endMint.getField('total_minted').toString()) - parseInt(startMint.getField('total_minted').toString());
+            statistics.totalMintCapacityIncrease = parseInt(endMint.getField('capacity').toString()) - -parseInt(startMint.getField('capacity').toString());
+        }
+
+        // let startMedias = await this.getMedia(api, startHash);
+        // let endMedias = await this.getMedia(api, endHash);
+        //
+        // let newMedia = endMedias.filter((endMedia) => {
+        //     return !startMedias.some((startMedia) => startMedia.id == endMedia.id);
+        // });
+        // statistics.newMedia = newMedia.length;
+        //
+        // for (let startMedia of startMedias) {
+        //     let deleted = !endMedias.some((endMedia) => {
+        //         return endMedia.id == startMedia.id;
+        //     })
+        //     if (deleted) {
+        //         ++statistics.deletedMedia;
+        //     }
+        // }
+
+        let startTimestamp = await api.query.timestamp.now.at(startHash) as unknown as Moment;
+        let endTimestamp = await api.query.timestamp.now.at(endHash) as unknown as Moment;
+        let avgBlockProduction = (((endTimestamp.toNumber() - startTimestamp.toNumber())
+            / 1000) / statistics.newBlocks);
+        statistics.avgBlockProduction = Number(avgBlockProduction.toFixed(2));
+
+        let startPostId = await api.query.forum.nextPostId.at(startHash) as unknown as PostId;
+        let endPostId = await api.query.forum.nextPostId.at(endHash) as unknown as PostId;
+        statistics.newPosts = endPostId.toNumber() - startPostId.toNumber();
+
+        let startThreadId = await api.query.forum.nextThreadId.at(startHash) as unknown as ThreadId;
+        let endThreadId = await api.query.forum.nextThreadId.at(endHash) as unknown as ThreadId;
+        statistics.newThreads = endThreadId.toNumber() - startThreadId.toNumber();
+
+        let startCategoryId = await api.query.forum.nextCategoryId.at(startHash) as unknown as CategoryId;
+        let endCategoryId = await api.query.forum.nextCategoryId.at(endHash) as unknown as CategoryId;
+        statistics.newCategories = endCategoryId.toNumber() - startCategoryId.toNumber();
+
+        let startIssuance = await api.query.balances.totalIssuance.at(startHash) as unknown as Balance;
+        let endIssuance = await api.query.balances.totalIssuance.at(endHash) as unknown as Balance;
+        statistics.totalIssuance = Number(endIssuance.toNumber() - startIssuance.toNumber());
+
+        let startNrMembers = await api.query.members.membersCreated.at(startHash) as unknown as MemberId;
+        let endNrNumber = await api.query.members.membersCreated.at(endHash) as unknown as MemberId;
+        statistics.newMembers = endNrNumber.toNumber() - startNrMembers.toNumber();
+
+        let startNrProposals = await api.query.proposalsEngine.proposalCount.at(startHash) as unknown as u32;
+        let endNrProposals = await api.query.proposalsEngine.proposalCount.at(endHash) as unknown as u32;
+        statistics.newProposals = endNrProposals.toNumber() - startNrProposals.toNumber();
+
+
+        return statistics;
+    }
+
+
+    static async computeUsedSpaceInBytes(api: ApiPromise, contentIds: Vec<ContentId>) {
+
+        let space = 0;
+        for (let contentId of contentIds) {
+            let dataObject = await api.query.dataDirectory.dataObjectByContentId(contentId) as Option<DataObject>;
+            space += dataObject.unwrap().size_in_bytes.toNumber();
+
+        }
+        return space;
+    }
+
+    static async getMedia(api: ApiPromise, blockHash: Hash) {
+        let nrEntities = parseInt((await api.query.versionedStore.nextEntityId()).toString());
+
+        let medias: Media[] = [];
+        for (let i = 0; i < nrEntities; ++i) {
+            let entity = await api.query.versionedStore.entityById.at(blockHash, i) as unknown as Entity;
+            // console.log(entity);
+
+            if (entity.class_id.toNumber() != 7) {
+                continue;
+            }
+
+            let title = entity.entity_values[0].value.value.toString();
+
+            medias.push(new Media(entity.id.toNumber(), title));
+
+        }
+        return medias;
+    }
+}
+
+
+

+ 76 - 0
council/report-generator/tsconfig.json

@@ -0,0 +1,76 @@
+{
+  "exclude": [
+  ],
+  "compilerOptions": {
+    /* Basic Options */
+    "target": "esnext",                       /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
+    "module": "none",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
+    // "lib": [],                             /* Specify library files to be included in the compilation. */
+    // "allowJs": true,                       /* Allow javascript files to be compiled. */
+    // "checkJs": true,                       /* Report errors in .js files. */
+    "jsx": "preserve",                           /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
+    "declaration": true,                      /* Generates corresponding '.d.ts' file. */
+    // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */
+     "sourceMap": true,                     /* Generates corresponding '.map' file. */
+    // "outFile": "./",                       /* Concatenate and emit output to single file. */
+    // "outDir": "build",                        /* Redirect output structure to the directory. */
+    // "rootDir": "./",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
+    // "composite": true,                     /* Enable project compilation */
+    // "removeComments": true,                /* Do not emit comments to output. */
+    // "noEmit": true,                        /* Do not emit outputs. */
+    // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */
+    // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
+    // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
+
+    /* Strict Type-Checking Options */
+//    "strict": true,                           /* Enable all strict type-checking options. */
+    "noImplicitAny": true,                 /* Raise error on expressions and declarations with an implied 'any' type. */
+    // "strictNullChecks": true,              /* Enable strict null checks. */
+    // "strictFunctionTypes": true,           /* Enable strict checking of function types. */
+    // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
+    // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
+    // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */
+
+    /* Additional Checks */
+//    "noUnusedLocals": true,                /* Report errors on unused locals. */
+    // "noUnusedParameters": true,            /* Report errors on unused parameters. */
+    "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
+    // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */
+
+    /* Module Resolution Options */
+    "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
+    // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
+    // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
+    // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
+    // "typeRoots": [],                       /* List of folders to include type definitions from. */
+    // "types": [],                           /* Type declaration files to be included in compilation. */
+    "allowSyntheticDefaultImports": true,     /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
+    "esModuleInterop": true,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
+    // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */
+
+    /* Source Map Options */
+    // "sourceRoot": "./",                    /* Specify the location where debugger should locate TypeScript files instead of source locations. */
+    // "mapRoot": "./",                       /* Specify the location where debugger should locate map files instead of generated locations. */
+    // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
+     "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
+
+    /* Experimental Options */
+    "experimentalDecorators": true,           /* Enables experimental support for ES7 decorators. */
+    // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */
+
+    /* Advanced Options */
+    "declarationDir": "lib",                /* Output directory for generated declaration files. */
+    "outDir": "lib",
+    "baseUrl": ".",
+    "paths": {
+    },
+    "typeRoots": [
+      "./node_modules/@polkadot/ts",
+      "./node_modules/@types",
+      "./node_modules/@joystream/types/lib"
+    ]
+  },
+  "include": [
+    "src/*.ts"
+  ]
+}