Skip to content

Commit

Permalink
elara kv component instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceChar committed Jan 9, 2022
1 parent 591b515 commit a2ea902
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ It's done. All the service will build into `packages/[service]/dist`.

#### Initiate

Before running Elara service, you should initiate the chain relate resource. see `packages/script/redis_init.ts`
Before running Elara service, you should initiate the chain db table in redis. Run [redis_init.ts](https://github.com/patractlabs/elara-ts/blob/master/packages/scripts/redis-init.ts) script with your own node config. Keep in mind that the chain name field need to be lowercase(e.g. polkadot not Polkadot).

If you want [Elara-kv](https://github.com/patractlabs/elara-kv-component) support, set `kvEnable` true.
If you want [Elara-kv](https://github.com/patractlabs/elara-kv-component) support, set the `type` field of redis chain db table `NodeType.Kv` when you init the chain node config.

[Elara-kv](https://github.com/patractlabs/elara-kv-component) is a service used to host websocket connections, which can effectively reduce the service pressure of nodes. You should deploy elara-kv service for every node(e.g. polkadot) to get better service capability and stability. And you can just regard the Elara-kv as an origin node service.See the repo for more details.

#### Run

Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/redis-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ChainConfig {
nodeId: number, // default 0, elara node instance id
type: NodeType,
baseUrl: string, // host
rpcPort: number, // default 9933
rpcPort?: number, // only for Node type. default 9933,
wsPort: number, // default 9944
poolSize: number,
[key: string]: any // for redis
Expand Down

0 comments on commit a2ea902

Please sign in to comment.