Skip to content

Commit 3f96f72

Browse files
authored
Merge pull request #217 from Patrik-Stas/release/4.6.0
Release 4.6.0, use vdrtools indy indypool-client
2 parents 27e2117 + fc57cdb commit 3f96f72

File tree

18 files changed

+2156
-3991
lines changed

18 files changed

+2156
-3991
lines changed

indypool-client/package-lock.json

Lines changed: 2080 additions & 3779 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

indypool-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "indyscan-daemon",
3-
"version": "4.5.2",
3+
"version": "4.6.0",
44
"author": "Patrik Staš",
55
"license": "ISC",
66
"description": "Application scanning Hyperledger Indy blockchain for fetching and processing transactions.",
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"cross-env": "^5.2.0",
1717
"dotenv": "^7.0.0",
18-
"indy-sdk": "1.15.0",
18+
"vdr-tools": "0.8.5",
1919
"sleep-promise": "^8.0.1",
2020
"util": "^0.11.1",
2121
"uuid": "^3.3.2",

indypool-client/src/indyclient.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const indy = require('indy-sdk')
1+
const vdrtools = require('vdr-tools')
22
const logger = require('./logging/logger-main')
33
const fs = require('fs')
44
const os = require('os')
@@ -10,11 +10,11 @@ const LEDGER_NAME_TO_CODE = {
1010
}
1111

1212
async function registerLedger (poolName, genesisFilePath) {
13-
await indy.createPoolLedgerConfig(poolName, { genesis_txn: genesisFilePath })
13+
await vdrtools.createPoolLedgerConfig(poolName, { genesis_txn: genesisFilePath })
1414
}
1515

1616
async function getListOfRegisteredLedgers () {
17-
let pools = await indy.listPools()
17+
let pools = await vdrtools.listPools()
1818
return pools.map(ledger => ledger.pool)
1919
}
2020

@@ -29,7 +29,7 @@ async function isKnownLedger (ledgerName) {
2929

3030
async function createIndyClient (ledgerName, genesisPath = undefined) {
3131
const whoami = `IndyClient[${ledgerName}]`
32-
await indy.setProtocolVersion(2)
32+
await vdrtools.setProtocolVersion(2)
3333

3434
if (await isUnknownLedger(ledgerName)) {
3535
if (!genesisPath) {
@@ -43,24 +43,24 @@ async function createIndyClient (ledgerName, genesisPath = undefined) {
4343
let genesisData = fs.readFileSync(`${os.homedir()}/.indy_client/pool/${ledgerName}/${ledgerName}.txn`)
4444
logger.info(`${whoami} Using genesis: ${genesisData}`)
4545
logger.info(`${whoami} Connecting to ledger ${ledgerName}.`)
46-
const poolHandle = await indy.openPoolLedger(ledgerName)
46+
const poolHandle = await vdrtools.openPoolLedger(ledgerName)
4747
logger.info(`${whoami} Connected to ledger ${ledgerName}.`)
4848

4949
const walletName = `indyscan-${ledgerName}`
5050
logger.info(`${whoami} Assuring local wallet.`)
5151
const config = JSON.stringify({ id: walletName, storage_type: 'default' })
5252
const credentials = JSON.stringify({ key: 'ke®y' })
5353
try {
54-
await indy.createWallet(config, credentials)
54+
await vdrtools.createWallet(config, credentials)
5555
logger.debug(`New wallet '${walletName}' created.`)
5656
} catch (err) {
5757
if (err.message !== 'WalletAlreadyExistsError') {
5858
logger.error(`Unexpected error trying to create a wallet: ${err.message} ${JSON.stringify(err.stack)}`)
5959
}
6060
}
61-
const wh = await indy.openWallet(config, credentials)
61+
const wh = await vdrtools.openWallet(config, credentials)
6262
logger.debug(`${whoami} Opened wallet '${walletName}'.`)
63-
const res = await indy.createAndStoreMyDid(wh, {})
63+
const res = await vdrtools.createAndStoreMyDid(wh, {})
6464
const did = res[0]
6565
logger.debug(`${whoami} Created did/verkey ${JSON.stringify(res)}`)
6666

@@ -71,9 +71,9 @@ async function createIndyClient (ledgerName, genesisPath = undefined) {
7171
*/
7272
async function getTx (subledgerName, seqNo) {
7373
const subledgerCode = LEDGER_NAME_TO_CODE[subledgerName.toLowerCase()]
74-
const getTx = await indy.buildGetTxnRequest(did, subledgerCode, seqNo)
74+
const getTx = await vdrtools.buildGetTxnRequest(did, subledgerCode, seqNo)
7575
logger.debug(`${whoami} Built GET_TX request: ${JSON.stringify(getTx)}`)
76-
const tx = await indy.submitRequest(poolHandle, getTx)
76+
const tx = await vdrtools.submitRequest(poolHandle, getTx)
7777
if (tx.op === 'REPLY') {
7878
if (tx.result.data) {
7979
return tx.result.data

indyscan-api-client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

indyscan-api-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "indyscan-api-client",
3-
"version": "4.5.2",
3+
"version": "4.6.0",
44
"author": "Patrik Staš",
55
"license": "ISC",
66
"description": "IndyScan HTTP API client.",

0 commit comments

Comments
 (0)