Elara typescript reconstruction.
Elara is inspired by Infura from the Ethereum ecosystem, named after Jupiter’s seventh moon. Elara's goal is to build a similar infrastructure and network public access services to provide developers with a unified access layer based on Substrate multi-chain. In addition, Elara will be used as part of the smart contract development service, and will be integrated with other components of the Patract toolchain in the future, in terms of contract development environment support, development tools component, contract deployment and Dapp release. Elara will be Polkadot’s infrastructure, allowing developers to focus on building upper-level applications.
Riot Group for disscusion: https://app.element.io/#/room/#PatractLabsDev:matrix.org
Wsrpc is Elara core service.
Suducer is Elara cache service.
Elara api service.
Elara statistic job service.
You can visit elara's official website to get your endpoint by creating a project. You can also directly access polkadotapps and select support elara chain to use a public connection, but the connection has share resource restrictions.
If you want to deploy your own elara service for node service. Redis ^5 and Postgresql is required.
nodejs ^14
yarn
If you wanna run Elara front-end, see here. Elara-Api and Elara-Job service are responsible for Elara front-end service.
create packages/api/.env file like packages/api/.env.example
generate your own AUTH with base64 encoder from Job service AUTH string
NO_AUTH true for local test without auth check
create packages/api/.env file like packages/job/.env.example
create your own AUTH string, which is used for Api service
Configure your own Redis and Postgresql connection for each service on packages/[service]/config/*.json
according to your NODE_ENV
environment.
At the root workspace, run
yarn install
yarn build
It's done. All the service will build into packages/[service]/dist
.
Before running Elara service, you should initiate the chain db table in redis. Run 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 support, set the type
field of redis chain db table NodeType.Kv
when you init the chain node config.
Elara-kv 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 in ts-node
yarn wsrpc start
yarn suducer start
yarn api start
yarn job start
Run in nodejs.
yarn wsrpc start:node
yarn suducer start:node
yarn api start:node
yarn job start:node
All the RPC request follow the rules:
url/[chain]/[pid]