Skip to content

Commit

Permalink
Replace dscp-node package with @polkadot/api (#46)
Browse files Browse the repository at this point in the history
* use polkadot directly

* v bump

* await api.isReadyOrError
  • Loading branch information
jonmattgray authored Nov 29, 2022
1 parent 693ba2c commit cbdf8d6
Show file tree
Hide file tree
Showing 5 changed files with 492 additions and 476 deletions.
14 changes: 5 additions & 9 deletions app/keyWatcher/api.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { buildApi } from '@digicatapult/dscp-node'
import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'

import env from '../env.js'

export const createNodeApi = async () => {
const { api, keyring } = buildApi({
options: {
apiHost: env.NODE_HOST,
apiPort: env.NODE_PORT,
},
})
const provider = new WsProvider(`ws://${env.NODE_HOST}:${env.NODE_PORT}`)
const api = new ApiPromise({ provider })

await api.isReady
await api.isReadyOrError.catch(() => {}) // prevent unhandled promise rejection errors

return {
_api: api,
_keyring: keyring,
_keyring: new Keyring({ type: 'sr25519' }),
isEventKeyUpdate: (event) => api.events.ipfsKey.UpdateKey.is(event),
getCurrentKey: async () => await api.query.ipfsKey.key(),
setupEventProcessor: (eventProcessor) => api.query.system.events(eventProcessor),
Expand Down
4 changes: 2 additions & 2 deletions helm/dscp-ipfs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: dscp-ipfs
appVersion: '2.8.1'
appVersion: '2.8.2'
description: A Helm chart for dscp-ipfs
version: '2.8.1'
version: '2.8.2'
type: application
dependencies:
- name: dscp-node
Expand Down
2 changes: 1 addition & 1 deletion helm/dscp-ipfs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ statefulSet:
image:
repository: digicatapult/dscp-ipfs
pullPolicy: IfNotPresent
tag: 'v2.8.1'
tag: 'v2.8.2'

storage:
storageClass: ""
Expand Down
Loading

0 comments on commit cbdf8d6

Please sign in to comment.