Skip to content

Commit

Permalink
update to include cache options
Browse files Browse the repository at this point in the history
  • Loading branch information
filvecchiato committed Oct 8, 2024
1 parent cf2b58b commit 694a6ba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/SidecarConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class SidecarConfig {
TYPES_CHAIN: config.Get(MODULES.SUBSTRATE, CONFIG.TYPES_CHAIN) as string,
TYPES_SPEC: config.Get(MODULES.SUBSTRATE, CONFIG.TYPES_SPEC) as string,
TYPES: config.Get(MODULES.SUBSTRATE, CONFIG.TYPES) as string,
CACHE_CAPACITY: config.Get(MODULES.SUBSTRATE, CONFIG.CACHE_CAPACITY) as number,
},
LOG: {
LEVEL: config.Get(MODULES.LOG, CONFIG.LEVEL) as string,
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ async function main() {
// Instantiate a web socket connection to the node and load types
const api = await ApiPromise.create({
provider: config.SUBSTRATE.URL.startsWith('http')
? new HttpProvider(config.SUBSTRATE.URL)
: new WsProvider(config.SUBSTRATE.URL),
? new HttpProvider(config.SUBSTRATE.URL, undefined, 0)
: new WsProvider(config.SUBSTRATE.URL, undefined, undefined, undefined, 0),
/* eslint-disable @typescript-eslint/no-var-requires */
typesBundle: TYPES_BUNDLE ? (require(TYPES_BUNDLE) as OverrideBundleType) : (tempTypesBundle as OverrideBundleType),
typesChain: TYPES_CHAIN ? (require(TYPES_CHAIN) as Record<string, RegistryTypes>) : undefined,
Expand Down
1 change: 1 addition & 0 deletions src/types/sidecar-config/CONFIG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum CONFIG {
TYPES_BUNDLE = 'TYPES_BUNDLE',
TYPES_CHAIN = 'TYPES_CHAIN',
TYPES_SPEC = 'TYPES_SPEC',
CACHE_CAPACITY = 'CACHE_CAPACITY',
TYPES = 'TYPES',
WRITE = 'WRITE',
WRITE_PATH = 'WRITE_PATH',
Expand Down
1 change: 1 addition & 0 deletions src/types/sidecar-config/SidecarConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface ISidecarConfigSubstrate {
TYPES_CHAIN: string;
TYPES_SPEC: string;
TYPES: string;
CACHE_CAPACITY: number;
}

interface ISidecarConfigExpress {
Expand Down

0 comments on commit 694a6ba

Please sign in to comment.