Skip to content

Commit

Permalink
feat: added RPC & REST configuration (#4)
Browse files Browse the repository at this point in the history
* feat: added RPC & REST configuration

* feat: update configuration doc
  • Loading branch information
RuslanGlaznyov authored Oct 21, 2023
1 parent 0d9af0b commit e47c3d2
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 151 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ VALIDATOR_IMAGE_URL=https://s3.amazonaws.com/keybase_processed_uploads/e86fec489
RESTAKE_BY_CRON='0 */4 * * *'
# Human-readable CRON job for automatically restaking tokens
HUMAN_READABLE_RESTAKE_BY_CRON='4 hours'
# KYVE_ENV (optinal) default is 'kyve-1'
KYVE_ENV='kyve-1 '
# RPC enpoint(optinal)
RPC='https://rpc-eu-1.korellia.kyve.network'
# API endpoint (optinal)
REST='https://api-eu-1.korellia.kyve.network'
# If no RPC or REST endpoint provided, service will use default endpoints from kyvejs/sdk bu
```
1. With Docker compose

Expand Down
6 changes: 6 additions & 0 deletions app/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ const schema = {
type: 'string',
default: 'kyve-1'
},
REST: {
type: 'string'
},
RPC: {
type: 'string'
},
GRANT_MNEMONIC: {
type: 'string'
},
Expand Down
4 changes: 2 additions & 2 deletions app/common/kyve.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const KyveSDK = require('@kyvejs/sdk').default

function kyveSDK () {
let kyve = null
async function init (mnemonic, env) {
const sdk = new KyveSDK(env)
async function init (mnemonic, env = { chainId: 'kyve-1' }) {
const sdk = env.rpc || env.api ? new KyveSDK(env.chainId, { rpc: env.rpc, api: env.api }) : new KyveSDK(env.chainId)
kyve = {
kyveSdk: await sdk.fromMnemonic(mnemonic),
kyveApi: sdk.createLCDClient(env)
Expand Down
Loading

0 comments on commit e47c3d2

Please sign in to comment.