From a94623e9aa62dbb05203e09dacde332661fde2ca Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 15:04:09 +0530 Subject: [PATCH 01/10] fix: externalise env Signed-off-by: Krishna Waske --- src/cli.ts | 10 +++-- src/cliAgent.ts | 40 +++++++++++++++---- src/controllers/did/DidController.ts | 8 +++- .../multi-tenancy/MultiTenancyController.ts | 8 +++- src/server.ts | 9 ++++- src/utils/agent.ts | 9 ++++- 6 files changed, 68 insertions(+), 16 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 4b0dd997..cfe4f975 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -3,6 +3,10 @@ import type { InboundTransport, Transports, AriesRestConfig } from './cliAgent' import yargs from 'yargs' import { runRestAgent } from './cliAgent' +// Needed here, before app init +// import dotenv from 'dotenv'; + +// dotenv.config(); const parsed = yargs .command('start', 'Start AFJ Rest agent') @@ -166,9 +170,9 @@ export async function runCliServer() { type: parsed['wallet-type'], config: { host: parsed['wallet-url'], - connectTimeout: 10, - maxConnections: 1000, - idleTimeout: 30000, + connectTimeout: process.env.CONNECT_TIMEOUT as unknown as number, + maxConnections: process.env.MAX_CONNECTIONS as unknown as number, + idleTimeout: process.env.IDLE_TIMEOUT as unknown as number, }, credentials: { account: parsed['wallet-account'], diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 233a770a..c5cc7b11 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -54,7 +54,10 @@ import jwt from 'jsonwebtoken' import { setupServer } from './server' import { TsLogger } from './utils/logger' -import { BCOVRIN_TEST_GENESIS } from './utils/util' +// Needed here, before app init +// import dotenv from 'dotenv'; + +// dotenv.config(); export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -114,6 +117,28 @@ export type RestMultiTenantAgentModules = Awaited> const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) => { + console.log('--------------------------------From ENV-------------------------------------') + console.log('this is didContractAddress: process.env.DID_CONTRACT_ADDRESS', process.env["DID_CONTRACT_ADDRESS"]); + console.log('this is schemaManagerContractAddress: process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS', process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS); + console.log('this is fileServerToken: process.env.FILE_SERVER_TOKEN', process.env.FILE_SERVER_TOKEN); + console.log('this is rpcUrl: process.env.RPC_URL', process.env.RPC_URL); + console.log('this is serverUrl: process.env.SERVER_URL', process.env.SERVER_URL); + console.log('---------------------------------------------------------------------') + + const didContractAddress = process.env.DID_CONTRACT_ADDRESS as string; + const schemaManagerContractAddress = process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string; + const fileServerToken= process.env.FILE_SERVER_TOKEN; + const rpcUrl= process.env.RPC_URL; + const serverUrl= process.env.SERVER_URL; + + console.log('--------------------------------From var-------------------------------------') + console.log('this is didContractAddress: process.env.DID_CONTRACT_ADDRESS', didContractAddress); + console.log('this is schemaManagerContractAddress: process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS', schemaManagerContractAddress); + console.log('this is fileServerToken: process.env.FILE_SERVER_TOKEN', fileServerToken); + console.log('this is rpcUrl: process.env.RPC_URL', rpcUrl); + console.log('this is serverUrl: process.env.SERVER_URL', serverUrl); + console.log('---------------------------------------------------------------------') + const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyProofFormatService() const jsonLdCredentialFormatService = new JsonLdCredentialFormatService() @@ -177,12 +202,11 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) questionAnswer: new QuestionAnswerModule(), polygon: new PolygonModule({ - didContractAddress: '0x1adeA199dCf07E17232415Cb232442BE52517Add', - schemaManagerContractAddress: '0x289c7Bd4C7d38cC54bff370d6f9f01b74Df51b11', - fileServerToken: - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk', - rpcUrl: 'https://rpc-amoy.polygon.technology', - serverUrl: 'https://schema.credebl.id', + didContractAddress: didContractAddress, + schemaManagerContractAddress: schemaManagerContractAddress, + fileServerToken: fileServerToken, + rpcUrl: rpcUrl, + serverUrl: serverUrl, }), } } @@ -291,7 +315,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { } else { networkConfig = [ { - genesisTransactions: BCOVRIN_TEST_GENESIS, + genesisTransactions: (process.env.BCOVRIN_TEST_GENESIS) as string, indyNamespace: 'bcovrin:testnet', isProduction: false, connectOnStartup: true, diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index dd883633..bc0a085c 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -14,11 +14,13 @@ import axios from 'axios' import { injectable } from 'tsyringe' import { DidMethod, Network, Role } from '../../enums/enum' -import { BCOVRIN_REGISTER_URL, INDICIO_NYM_URL } from '../../utils/util' import { Did, DidRecordExample } from '../examples' import { DidCreate } from '../types' import { Body, Controller, Example, Get, Path, Post, Res, Route, Tags, TsoaResponse, Security } from 'tsoa' +// import dotenv from 'dotenv'; + +// dotenv.config(); @Tags('Dids') @Route('/dids') @@ -163,6 +165,8 @@ export class DidController extends Controller { didDocument: didDocument, } } else { + const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string + console.log('this is BCOVRIN_REGISTER_URL', BCOVRIN_REGISTER_URL) const res = await axios.post(BCOVRIN_REGISTER_URL, { role: 'ENDORSER', alias: 'Alias', @@ -216,6 +220,8 @@ export class DidController extends Controller { } } else { const key = await this.createIndicioKey(createDidOptions) + const INDICIO_NYM_URL = process.env.INDICIO_NYM_URL as string + console.log('this is INDICIO_NYM_URL', INDICIO_NYM_URL) const res = await axios.post(INDICIO_NYM_URL, key) if (res.data.statusCode === 200) { await this.importDid(didMethod, key.did, createDidOptions.seed) diff --git a/src/controllers/multi-tenancy/MultiTenancyController.ts b/src/controllers/multi-tenancy/MultiTenancyController.ts index c3b401e0..77a892c4 100644 --- a/src/controllers/multi-tenancy/MultiTenancyController.ts +++ b/src/controllers/multi-tenancy/MultiTenancyController.ts @@ -52,7 +52,6 @@ import axios from 'axios' import * as fs from 'fs' import { CredentialEnum, DidMethod, Network, Role } from '../../enums/enum' -import { BCOVRIN_REGISTER_URL, INDICIO_NYM_URL } from '../../utils/util' import { SchemaId, CredentialDefinitionId, RecordId, ProofRecordExample, ConnectionRecordExample } from '../examples' import { RequestProofOptions, @@ -83,6 +82,9 @@ import { Example, Security, } from 'tsoa' +// import dotenv from 'dotenv'; + +// dotenv.config(); @Tags('MultiTenancy') @Route('/multi-tenancy') @@ -254,6 +256,8 @@ export class MultiTenancyController extends Controller { seed: createDidOptions.seed, } + const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string + console.log('this is BCOVRIN_REGISTER_URL', BCOVRIN_REGISTER_URL) const res = await axios.post(BCOVRIN_REGISTER_URL, body) if (res) { const { did } = res?.data || {} @@ -353,6 +357,8 @@ export class MultiTenancyController extends Controller { verkey: TypedArrayEncoder.toBase58(buffer), } } + const INDICIO_NYM_URL = process.env.INDICIO_NYM_URL as string + console.log('this is INDICIO_NYM_URL', INDICIO_NYM_URL) const res = await axios.post(INDICIO_NYM_URL, body) if (res.data.statusCode === 200) { await this.importDid(didMethod, did, createDidOptions.seed, tenantAgent) diff --git a/src/server.ts b/src/server.ts index 56f4c943..cb707b39 100644 --- a/src/server.ts +++ b/src/server.ts @@ -19,7 +19,10 @@ import { proofEvents } from './events/ProofEvents' import { questionAnswerEvents } from './events/QuestionAnswerEvents' import { RegisterRoutes } from './routes/routes' import { SecurityMiddleware } from './securityMiddleware' -import { maxRateLimit, windowMs } from './utils/util' +// Needed here, before app init +import dotenv from 'dotenv'; + +dotenv.config(); import { ValidateError, type Exception } from 'tsoa' @@ -51,6 +54,10 @@ export const setupServer = async (agent: Agent, config: ServerConfig, apiKey?: s return res.send(generateHTML(await import('./routes/swagger.json'))) }) + const windowMs = process.env.windowMs as unknown as number + const maxRateLimit = process.env.maxRateLimit as unknown as number + console.log('this is windowMs 1',windowMs) + console.log('this is maxRateLimit 1',maxRateLimit) const limiter = rateLimit({ windowMs, // 1 second max: maxRateLimit, // max 800 requests per second diff --git a/src/utils/agent.ts b/src/utils/agent.ts index d4437081..801c1a34 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -36,9 +36,13 @@ import { ariesAskar } from '@hyperledger/aries-askar-nodejs' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { TsLogger } from './logger' -import { BCOVRIN_TEST_GENESIS } from './util' +// import dotenv from 'dotenv'; + +// dotenv.config(); export const setupAgent = async ({ name, endpoints, port }: { name: string; endpoints: string[]; port: number }) => { + const BCOVRIN_TEST_GENESIS = (process.env.BCOVRIN_TEST_GENESIS) as string + console.log('thsi is BCOVRIN_TEST_GENESIS', BCOVRIN_TEST_GENESIS) const logger = new TsLogger(LogLevel.debug) const config: InitConfig = { @@ -53,6 +57,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyProofFormatService() + console.log('this is (process.env.BCOVRIN_TEST_GENESIS) as string', (process.env.BCOVRIN_TEST_GENESIS) as string) const agent = new Agent({ config: config, modules: { @@ -62,7 +67,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp { isProduction: false, indyNamespace: 'bcovrin:test', - genesisTransactions: BCOVRIN_TEST_GENESIS, + genesisTransactions: (process.env.BCOVRIN_TEST_GENESIS) as string, connectOnStartup: true, }, ], From 16dbd019ad0eca6760418f42213c7354395221e4 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 15:04:37 +0530 Subject: [PATCH 02/10] fix: externalise env Signed-off-by: Krishna Waske --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a2f61844..a3f0d33c 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "axios": "^1.4.0", "body-parser": "^1.20.0", "cors": "^2.8.5", + "dotenv": "^16.4.5", "express": "^4.18.1", "express-rate-limit": "^7.1.5", "joi": "^17.12.3", From 0a3e30e4ad9b153e07cb3930d5adc9ec66cfaa73 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 15:41:18 +0530 Subject: [PATCH 03/10] fix: number conversion Signed-off-by: Krishna Waske --- src/cli.ts | 6 +++--- src/server.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index cfe4f975..56b63543 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -170,9 +170,9 @@ export async function runCliServer() { type: parsed['wallet-type'], config: { host: parsed['wallet-url'], - connectTimeout: process.env.CONNECT_TIMEOUT as unknown as number, - maxConnections: process.env.MAX_CONNECTIONS as unknown as number, - idleTimeout: process.env.IDLE_TIMEOUT as unknown as number, + connectTimeout: Number(process.env.CONNECT_TIMEOUT), + maxConnections: Number(process.env.MAX_CONNECTIONS), + idleTimeout: Number(process.env.IDLE_TIMEOUT), }, credentials: { account: parsed['wallet-account'], diff --git a/src/server.ts b/src/server.ts index cb707b39..edca75d5 100644 --- a/src/server.ts +++ b/src/server.ts @@ -54,8 +54,8 @@ export const setupServer = async (agent: Agent, config: ServerConfig, apiKey?: s return res.send(generateHTML(await import('./routes/swagger.json'))) }) - const windowMs = process.env.windowMs as unknown as number - const maxRateLimit = process.env.maxRateLimit as unknown as number + const windowMs = Number(process.env.windowMs) + const maxRateLimit = Number(process.env.maxRateLimit) console.log('this is windowMs 1',windowMs) console.log('this is maxRateLimit 1',maxRateLimit) const limiter = rateLimit({ From 45f292ad997feec8804bd9176e81604b262e5ea2 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 17:27:59 +0530 Subject: [PATCH 04/10] fix: remove logs Signed-off-by: Krishna Waske --- src/cliAgent.ts | 15 --------------- src/controllers/did/DidController.ts | 2 -- .../multi-tenancy/MultiTenancyController.ts | 2 -- src/server.ts | 2 -- src/utils/agent.ts | 2 -- 5 files changed, 23 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index c5cc7b11..6a969d9f 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -117,13 +117,6 @@ export type RestMultiTenantAgentModules = Awaited> const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) => { - console.log('--------------------------------From ENV-------------------------------------') - console.log('this is didContractAddress: process.env.DID_CONTRACT_ADDRESS', process.env["DID_CONTRACT_ADDRESS"]); - console.log('this is schemaManagerContractAddress: process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS', process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS); - console.log('this is fileServerToken: process.env.FILE_SERVER_TOKEN', process.env.FILE_SERVER_TOKEN); - console.log('this is rpcUrl: process.env.RPC_URL', process.env.RPC_URL); - console.log('this is serverUrl: process.env.SERVER_URL', process.env.SERVER_URL); - console.log('---------------------------------------------------------------------') const didContractAddress = process.env.DID_CONTRACT_ADDRESS as string; const schemaManagerContractAddress = process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string; @@ -131,14 +124,6 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) const rpcUrl= process.env.RPC_URL; const serverUrl= process.env.SERVER_URL; - console.log('--------------------------------From var-------------------------------------') - console.log('this is didContractAddress: process.env.DID_CONTRACT_ADDRESS', didContractAddress); - console.log('this is schemaManagerContractAddress: process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS', schemaManagerContractAddress); - console.log('this is fileServerToken: process.env.FILE_SERVER_TOKEN', fileServerToken); - console.log('this is rpcUrl: process.env.RPC_URL', rpcUrl); - console.log('this is serverUrl: process.env.SERVER_URL', serverUrl); - console.log('---------------------------------------------------------------------') - const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyProofFormatService() const jsonLdCredentialFormatService = new JsonLdCredentialFormatService() diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index bc0a085c..6433038c 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -166,7 +166,6 @@ export class DidController extends Controller { } } else { const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string - console.log('this is BCOVRIN_REGISTER_URL', BCOVRIN_REGISTER_URL) const res = await axios.post(BCOVRIN_REGISTER_URL, { role: 'ENDORSER', alias: 'Alias', @@ -221,7 +220,6 @@ export class DidController extends Controller { } else { const key = await this.createIndicioKey(createDidOptions) const INDICIO_NYM_URL = process.env.INDICIO_NYM_URL as string - console.log('this is INDICIO_NYM_URL', INDICIO_NYM_URL) const res = await axios.post(INDICIO_NYM_URL, key) if (res.data.statusCode === 200) { await this.importDid(didMethod, key.did, createDidOptions.seed) diff --git a/src/controllers/multi-tenancy/MultiTenancyController.ts b/src/controllers/multi-tenancy/MultiTenancyController.ts index 77a892c4..491ee19b 100644 --- a/src/controllers/multi-tenancy/MultiTenancyController.ts +++ b/src/controllers/multi-tenancy/MultiTenancyController.ts @@ -257,7 +257,6 @@ export class MultiTenancyController extends Controller { } const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string - console.log('this is BCOVRIN_REGISTER_URL', BCOVRIN_REGISTER_URL) const res = await axios.post(BCOVRIN_REGISTER_URL, body) if (res) { const { did } = res?.data || {} @@ -358,7 +357,6 @@ export class MultiTenancyController extends Controller { } } const INDICIO_NYM_URL = process.env.INDICIO_NYM_URL as string - console.log('this is INDICIO_NYM_URL', INDICIO_NYM_URL) const res = await axios.post(INDICIO_NYM_URL, body) if (res.data.statusCode === 200) { await this.importDid(didMethod, did, createDidOptions.seed, tenantAgent) diff --git a/src/server.ts b/src/server.ts index edca75d5..4b9b5aee 100644 --- a/src/server.ts +++ b/src/server.ts @@ -56,8 +56,6 @@ export const setupServer = async (agent: Agent, config: ServerConfig, apiKey?: s const windowMs = Number(process.env.windowMs) const maxRateLimit = Number(process.env.maxRateLimit) - console.log('this is windowMs 1',windowMs) - console.log('this is maxRateLimit 1',maxRateLimit) const limiter = rateLimit({ windowMs, // 1 second max: maxRateLimit, // max 800 requests per second diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 801c1a34..2f3c4be6 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -42,7 +42,6 @@ import { TsLogger } from './logger' export const setupAgent = async ({ name, endpoints, port }: { name: string; endpoints: string[]; port: number }) => { const BCOVRIN_TEST_GENESIS = (process.env.BCOVRIN_TEST_GENESIS) as string - console.log('thsi is BCOVRIN_TEST_GENESIS', BCOVRIN_TEST_GENESIS) const logger = new TsLogger(LogLevel.debug) const config: InitConfig = { @@ -57,7 +56,6 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyProofFormatService() - console.log('this is (process.env.BCOVRIN_TEST_GENESIS) as string', (process.env.BCOVRIN_TEST_GENESIS) as string) const agent = new Agent({ config: config, modules: { From 5d884affb426aaaebef0f4fb0f52bce8773ba48e Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 17:45:48 +0530 Subject: [PATCH 05/10] fix: sample env variable Signed-off-by: Krishna Waske --- src/utils/util.ts => .env.sample | 49 +++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 13 deletions(-) rename src/utils/util.ts => .env.sample (96%) diff --git a/src/utils/util.ts b/.env.sample similarity index 96% rename from src/utils/util.ts rename to .env.sample index 43b71461..060c05e2 100644 --- a/src/utils/util.ts +++ b/.env.sample @@ -1,9 +1,39 @@ -export const BCOVRIN_TEST_GENESIS = `{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} +# Specify connect timeout +CONNECT_TIMEOUT= +# Specify max connections +MAX_CONNECTIONS= +# Specify idle timeout +IDLE_TIMEOUT= +#Specify max number 2147483647 +SESSION_ACQUIRE_TIMEOUT= +SESSION_LIMIT= +INMEMORY_LRU_CACHE_LIMIT= +# Specify BCovrin Register url +BCOVRIN_REGISTER_URL= +# Specify indicio nym url +INDICIO_NYM_URL= +# Specify Schema Manager contract address +SCHEMA_MANAGER_CONTRACT_ADDRESS= +# Specify File SErver Token +FILE_SERVER_TOKEN= +# Specify RPC URL +RPC_URL= +# Specify server url +SERVER_URL= +# Specify windowMs +windowMs= +# Specify maxRateLimit +maxRateLimit= +# Specify Did contract address +DID_CONTRACT_ADDRESS= +# Specify Bcovrin test genesis +BCOVRIN_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}` -export const INDICIO_TEST_GENESIS = `{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode","blskey":"4i39oJqm7fVX33gnYEbFdGurMtwYQJgDEYfXdYykpbJMWogByocaXxKbuXdrg3k9LP33Tamq64gUwnm4oA7FkxqJ5h4WfKH6qyVLvmBu5HgeV8Rm1GJ33mKX6LWPbm1XE9TfzpQXJegKyxHQN9ABquyBVAsfC6NSM4J5t1QGraJBfZi","blskey_pop":"Qq3CzhSfugsCJotxSCRAnPjmNDJidDz7Ra8e4xvLTEzQ5w3ppGray9KynbGPH8T7XnUTU1ioZadTbjXaRY26xd4hQ3DxAyR4GqBymBn3UBomLRJHmj7ukcdJf9WE6tu1Fp1EhxmyaMqHv13KkDrDfCthgd2JjAWvSgMGWwAAzXEow5","client_ip":"13.58.197.208","client_port":"9702","node_ip":"3.135.134.42","node_port":"9701","services":["VALIDATOR"]},"dest":"EVwxHoKXUy2rnRzVdVKnJGWFviamxMwLvUso7KMjjQNH"},"metadata":{"from":"Pms5AZzgPWHSj6nNmJDfmo"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"77ad6682f320be9969f70a37d712344afed8e3fba8d43fa5602c81b578d26088"},"ver":"1"} +# Specify Indicio test genesis +INDICIO_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"OpsNode","blskey":"4i39oJqm7fVX33gnYEbFdGurMtwYQJgDEYfXdYykpbJMWogByocaXxKbuXdrg3k9LP33Tamq64gUwnm4oA7FkxqJ5h4WfKH6qyVLvmBu5HgeV8Rm1GJ33mKX6LWPbm1XE9TfzpQXJegKyxHQN9ABquyBVAsfC6NSM4J5t1QGraJBfZi","blskey_pop":"Qq3CzhSfugsCJotxSCRAnPjmNDJidDz7Ra8e4xvLTEzQ5w3ppGray9KynbGPH8T7XnUTU1ioZadTbjXaRY26xd4hQ3DxAyR4GqBymBn3UBomLRJHmj7ukcdJf9WE6tu1Fp1EhxmyaMqHv13KkDrDfCthgd2JjAWvSgMGWwAAzXEow5","client_ip":"13.58.197.208","client_port":"9702","node_ip":"3.135.134.42","node_port":"9701","services":["VALIDATOR"]},"dest":"EVwxHoKXUy2rnRzVdVKnJGWFviamxMwLvUso7KMjjQNH"},"metadata":{"from":"Pms5AZzgPWHSj6nNmJDfmo"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"77ad6682f320be9969f70a37d712344afed8e3fba8d43fa5602c81b578d26088"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"cynjanode","blskey":"32DLSweyJRxVMcVKGjUeNkVF1fwyFfRcFqGU9x7qL2ox2STpF6VxZkbxoLkGMPnt3gywRaY6jAjqgC8XMkf3webMJ4SEViPtBKZJjCCFTf4tGXfEsMwinummaPja85GgTALf7DddCNyCojmkXWHpgjrLx3626Z2MiNxVbaMapG2taFX","blskey_pop":"RQRU8GVYSYZeu9dfH6myhzZ2qfxeVpCL3bTzgto1bRbx3QCt3mFFQQBVbgrqui2JpXhcWXxoDzp1WyYbSZwYqYQbRmvK7PPG82VAvVagv1n83Qa3cdyGwCevZdEzxuETiiXBRWSPfb4JibAXPKkLZHyQHWCEHcAEVeXtx7FRS1wjTd","client_ip":"3.17.103.221","client_port":"9702","node_ip":"3.17.215.226","node_port":"9701","services":["VALIDATOR"]},"dest":"iTq944JTtwHnst7rucfsRA4m26x9i6zCKKohETBCiWu"},"metadata":{"from":"QC174PGaL4zA9YHYqofPH2"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"ce7361e44ec10a275899ece1574f6e38f2f3c7530c179fa07a2924e55775759b"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"GlobaliD","blskey":"4Behdr1KJfLTAPNospghtL7iWdCHca6MZDxAtzYNXq35QCUr4aqpLu6p4Sgu9wNbTACB3DbwmVgE2L7hX6UsasuvZautqUpf4nC5viFpH7X6mHyqLreBJTBH52tSwifQhRjuFAySbbfyRK3wb6R2Emxun9GY7MFNuy792LXYg4C6sRJ","blskey_pop":"RKYDRy8oTxKnyAV3HocapavH2jkw3PVe54JcEekxXz813DFbEy87N3i3BNqwHB7MH93qhtTRb7EZMaEiYhm92uaLKyubUMo5Rqjve2jbEdYEYVRmgNJWpxFKCmUBa5JwBWYuGunLMZZUTU3qjbdDXkJ9UNMQxDULCPU5gzLTy1B5kb","client_ip":"13.56.175.126","client_port":"9702","node_ip":"50.18.84.131","node_port":"9701","services":["VALIDATOR"]},"dest":"2ErWxamsNGBfhkFnwYgs4UW4aApct1kHUvu7jbkA1xX4"},"metadata":{"from":"4H8us7B1paLW9teANv8nam"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"0c3b33b77e0419d6883be35d14b389c3936712c38a469ac5320a3cae68be1293"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"IdRamp","blskey":"LoYzqUMPDZEfRshwGSzkgATxcM5FAS1LYx896zHnMfXP7duDsCQ6CBG2akBkZzgH3tBMvnjhs2z7PFc2gFeaKUF9fKDHhtbVqPofxH3ebcRfA959qU9mgvmkUwMUgwd21puRU6BebUwBiYxMxcE5ChReBnAkdAv19gVorm3prBMk94","blskey_pop":"R1DjpsG7UxgwstuF7WDUL17a9Qq64vCozwJZ88bTrSDPwC1cdRn3WmhqJw5LpEhFQJosDSVVT6tS8dAZrrssRv2YsELbfGEJ7ZGjhNjZHwhqg4qeustZ7PZZE3Vr1ALSHY4Aa6KpNzGodxu1XymYZWXAFokPAs3Kho8mKcJwLCHn3h","client_ip":"207.126.128.12","client_port":"9702","node_ip":"207.126.129.12","node_port":"9701","services":["VALIDATOR"]},"dest":"5Zj5Aec6Kt9ki1runrXu87wZ522mnm3zwmaoHLUcHLx9"},"metadata":{"from":"AFLDFPoJuDQUHqnfmg8U7i"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"c9df105558333ac8016610d9da5aad1e9a5dd50b9d9cc5684e94f439fa10f836"},"ver":"1"} @@ -11,12 +41,14 @@ export const INDICIO_TEST_GENESIS = `{"reqSignature":{},"txn":{"data":{"data":{" {"reqSignature":{},"txn":{"data":{"data":{"alias":"lorica-identity-node1","blskey":"wUh24sVCQ8PHDgSb343g2eLxjD5vwxsrETfuV2sbwMNnYon9nhbaK5jcWTekvXtyiwxHxuiCCoZwKS97MQEAeC2oLbbMeKjYm212QwSnm7aKLEqTStXht35VqZvZLT7Q3mPQRYLjMGixdn4ocNHrBTMwPUQYycEqwaHWgE1ncDueXY","blskey_pop":"R2sMwF7UW6AaD4ALa1uB1YVPuP6JsdJ7LsUoViM9oySFqFt34C1x1tdHDysS9wwruzaaEFui6xNPqJ8eu3UBqcFKkoWhdsMqCALwe63ytxPwvtLtCffJLhHAcgrPC7DorXYdqhdG2cevdqc5oqFEAaKoFDBf12p5SsbbM4PYWCmVCb","client_ip":"35.225.220.151","client_port":"9702","node_ip":"35.224.26.110","node_port":"9701","services":["VALIDATOR"]},"dest":"k74ZsZuUaJEcB8RRxMwkCwdE5g1r9yzA3nx41qvYqYf"},"metadata":{"from":"Ex6hzsJFYzNJ7kzbfncNeU"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"6880673ce4ae4a2352f103d2a6ae20469dd070f2027283a1da5e62a64a59d688"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"cysecure-itn","blskey":"GdCvMLkkBYevRFi93b6qaj9G2u1W6Vnbg8QhRD1chhrWR8vRE8x9x7KXVeUBPFf6yW5qq2JCfA2frc8SGni2RwjtTagezfwAwnorLhVJqS5ZxTi4pgcw6smebnt4zWVhTkh6ugDHEypHwNQBcw5WhBZcEJKgNbyVLnHok9ob6cfr3u","blskey_pop":"RbH9mY7M5p3UB3oj4sT1skYwMkxjoUnja8eTYfcm83VcNbxC9zR9pCiRhk4q1dJT3wkDBPGNKnk2p83vaJYLcgMuJtzoWoJAWAxjb3Mcq8Agf6cgQpBuzBq2uCzFPuQCAhDS4Kv9iwA6FsRnfvoeFTs1hhgSJVxQzDWMVTVAD9uCqu","client_ip":"35.169.19.171","client_port":"9702","node_ip":"54.225.56.21","node_port":"9701","services":["VALIDATOR"]},"dest":"4ETBDmHzx8iDQB6Xygmo9nNXtMgq9f6hxGArNhQ6Hh3u"},"metadata":{"from":"uSXXXEdBicPHMMhr3ddNF"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"3c21718b07806b2f193b35953dda5b68b288efd551dce4467ce890703d5ba549"},"ver":"1"}` -export const CREDEBL_TEST_GENESIS = `{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node1", "blskey": "4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba", "blskey_pop": "RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1", "client_ip": "192.168.1.74", "client_port": 9702, "node_ip": "192.168.1.74", "node_port": 9701, "services": ["VALIDATOR"]}, "dest": "Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"}, "metadata": {"from": "Th7MpTaRZVRYnPiabds81Y"}, "type": "0"}, "txnMetadata": {"seqNo": 1, "txnId": "fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"}, "ver": "1"} +# Specify Credebl test genesis +CREDEBL_TEST_GENESIS=`{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node1", "blskey": "4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba", "blskey_pop": "RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1", "client_ip": "192.168.1.74", "client_port": 9702, "node_ip": "192.168.1.74", "node_port": 9701, "services": ["VALIDATOR"]}, "dest": "Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"}, "metadata": {"from": "Th7MpTaRZVRYnPiabds81Y"}, "type": "0"}, "txnMetadata": {"seqNo": 1, "txnId": "fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"}, "ver": "1"} {"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node2", "blskey": "37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk", "blskey_pop": "Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5", "client_ip": "192.168.1.74", "client_port": 9704, "node_ip": "192.168.1.74", "node_port": 9703, "services": ["VALIDATOR"]}, "dest": "8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"}, "metadata": {"from": "EbP4aYNeTHL6q385GuVpRV"}, "type": "0"}, "txnMetadata": {"seqNo": 2, "txnId": "1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"}, "ver": "1"} {"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node3", "blskey": "3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5", "blskey_pop": "QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh", "client_ip": "192.168.1.74", "client_port": 9706, "node_ip": "192.168.1.74", "node_port": 9705, "services": ["VALIDATOR"]}, "dest": "DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"}, "metadata": {"from": "4cU41vWW82ArfxJxHkzXPG"}, "type": "0"}, "txnMetadata": {"seqNo": 3, "txnId": "7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"}, "ver": "1"} {"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node4", "blskey": "2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw", "blskey_pop": "RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP", "client_ip": "192.168.1.74", "client_port": 9708, "node_ip": "192.168.1.74", "node_port": 9707, "services": ["VALIDATOR"]}, "dest": "4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"}, "metadata": {"from": "TWwCRQRZ2ZHMJFn9TzLp7W"}, "type": "0"}, "txnMetadata": {"seqNo": 4, "txnId": "aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"}, "ver": "1"}` -export const SOVRIN_STAGING_NET = `{"reqSignature":{},"txn":{"data":{"data":{"alias":"australia","client_ip":"52.64.96.160","client_port":"9702","node_ip":"52.64.96.160","node_port":"9701","services":["VALIDATOR"]},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"from":"3U8HUen8WcgpbnEz1etnai"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"c585f1decb986f7ff19b8d03deba346ab8a0494cc1e4d69ad9b8acb0dfbeab6f"},"ver":"1"} +# Specify SOVRIN Staging genesis +SOVRIN_STAGING_NET=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"australia","client_ip":"52.64.96.160","client_port":"9702","node_ip":"52.64.96.160","node_port":"9701","services":["VALIDATOR"]},"dest":"UZH61eLH3JokEwjMWQoCMwB3PMD6zRBvG6NCv5yVwXz"},"metadata":{"from":"3U8HUen8WcgpbnEz1etnai"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"c585f1decb986f7ff19b8d03deba346ab8a0494cc1e4d69ad9b8acb0dfbeab6f"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"brazil","client_ip":"54.233.203.241","client_port":"9702","node_ip":"54.233.203.241","node_port":"9701","services":["VALIDATOR"]},"dest":"2MHGDD2XpRJohQzsXu4FAANcmdypfNdpcqRbqnhkQsCq"},"metadata":{"from":"G3knUCmDrWd1FJrRryuKTw"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"5c8f52ca28966103ff0aad98160bc8e978c9ca0285a2043a521481d11ed17506"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"canada","client_ip":"52.60.207.225","client_port":"9702","node_ip":"52.60.207.225","node_port":"9701","services":["VALIDATOR"]},"dest":"8NZ6tbcPN2NVvf2fVhZWqU11XModNudhbe15JSctCXab"},"metadata":{"from":"22QmMyTEAbaF4VfL7LameE"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"408c7c5887a0f3905767754f424989b0089c14ac502d7f851d11b31ea2d1baa6"},"ver":"1"} {"reqSignature":{},"txn":{"data":{"data":{"alias":"england","client_ip":"52.56.191.9","client_port":"9702","node_ip":"52.56.191.9","node_port":"9701","services":["VALIDATOR"]},"dest":"DNuLANU7f1QvW1esN3Sv9Eap9j14QuLiPeYzf28Nub4W"},"metadata":{"from":"NYh3bcUeSsJJcxBE6TTmEr"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"d56d0ff69b62792a00a361fbf6e02e2a634a7a8da1c3e49d59e71e0f19c27875"},"ver":"1"} @@ -151,13 +183,4 @@ export const SOVRIN_STAGING_NET = `{"reqSignature":{},"txn":{"data":{"data":{"al {"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"2wMAYGVoSt3ZtU3CzcvhzMAQ2EFhZvPwBsGKqpNmWvKVWbFeyC6yMZxHCVdtj2fqfj36FJkvPKkh3gwmvvrt6eeW"}]},"txn":{"data":{"data":{"alias":"virginia","services":[]},"dest":"EoGRm7eRADtHJRThMCrBXMUM2FpPRML19tNxDAG8YTP8"},"metadata":{"digest":"4ee79b267e7a5aa9ca96ee667f75dadfafdf1238c2841d2d5fa28accf542331c","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"1b4afb24a5d19cf90eb41bb9c265610a6922c6e0aa59386dc3af2016988f4dc6","reqId":1558034311268528084},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":133,"txnTime":1558034311},"ver":"1"} {"reqSignature":{"type":"ED25519","values":[{"from":"6feBTywcmJUriqqnGc1zSJ","value":"3QyhWLE53fg8wsNRFJijV6QKax2deCAzhUa1g152KYJ7exk1iqv6mLsHtY5KXNiXLg1a8vxQiFj8Hp8iRb7CXrCA"}]},"txn":{"data":{"data":{"alias":"RFCU","services":[]},"dest":"2B8bkZX3SvcBq3amP7aeATsSPz82RyyCJQbEjZpLgZLh"},"metadata":{"digest":"58c132bc0b8c96fb7628e8b7af9a9086ff2b2c894091090f88eb328ee945fe28","from":"6feBTywcmJUriqqnGc1zSJ","payloadDigest":"64b6882e3cbf71154369d91f9da431d069b465116dada6ba685928cd11c7b9e3","reqId":1558034435821210238},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":134,"txnTime":1558034436},"ver":"1"} ` -const protocol = `http` -export const BCOVRIN_REGISTER_URL = `${protocol}://test.bcovrin.vonx.io/register` -export const INDICIO_NYM_URL = 'https://selfserve.indiciotech.io/nym' -export const windowMs = 1000 -export const maxRateLimit = 800 - -export const DID_CONTRACT_ADDRESS = '0x12513116875BB3E4F098Ce74624739Ee51bAf023' -export const SCHEMA_MANAGER_CONTRACT_ADDRESS = '0x552992e9f14b15bBd76488cD4c38c89B80259f37' -export const RPC_URL = 'https://rpc-mumbai.maticvigil.com' From c32c5f3ed242366c6bddfa11df54e8f7d673a2db Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 17:47:26 +0530 Subject: [PATCH 06/10] fix: remove comments Signed-off-by: Krishna Waske --- src/cli.ts | 4 ---- src/cliAgent.ts | 10 +++------- src/controllers/did/DidController.ts | 3 --- .../multi-tenancy/MultiTenancyController.ts | 3 --- src/utils/agent.ts | 3 --- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 56b63543..f4a061f3 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -3,10 +3,6 @@ import type { InboundTransport, Transports, AriesRestConfig } from './cliAgent' import yargs from 'yargs' import { runRestAgent } from './cliAgent' -// Needed here, before app init -// import dotenv from 'dotenv'; - -// dotenv.config(); const parsed = yargs .command('start', 'Start AFJ Rest agent') diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 6a969d9f..2f6b599a 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -54,10 +54,6 @@ import jwt from 'jsonwebtoken' import { setupServer } from './server' import { TsLogger } from './utils/logger' -// Needed here, before app init -// import dotenv from 'dotenv'; - -// dotenv.config(); export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -182,7 +178,7 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) }), w3cCredentials: new W3cCredentialsModule(), cache: new CacheModule({ - cache: new InMemoryLruCache({ limit: Infinity }), + cache: new InMemoryLruCache({ limit: Number(process.env.INMEMORY_LRU_CACHE_LIMIT) }), }), questionAnswer: new QuestionAnswerModule(), @@ -200,8 +196,8 @@ const getWithTenantModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolC const modules = getModules(networkConfig) return { tenants: new TenantsModule({ - sessionAcquireTimeout: Infinity, - sessionLimit: Infinity, + sessionAcquireTimeout: Number(process.env.SESSION_ACQUIRE_TIMEOUT), + sessionLimit: Number(process.env.SESSION_LIMIT), }), ...modules, } diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index 6433038c..9f9cece7 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -18,9 +18,6 @@ import { Did, DidRecordExample } from '../examples' import { DidCreate } from '../types' import { Body, Controller, Example, Get, Path, Post, Res, Route, Tags, TsoaResponse, Security } from 'tsoa' -// import dotenv from 'dotenv'; - -// dotenv.config(); @Tags('Dids') @Route('/dids') diff --git a/src/controllers/multi-tenancy/MultiTenancyController.ts b/src/controllers/multi-tenancy/MultiTenancyController.ts index 491ee19b..94819e58 100644 --- a/src/controllers/multi-tenancy/MultiTenancyController.ts +++ b/src/controllers/multi-tenancy/MultiTenancyController.ts @@ -82,9 +82,6 @@ import { Example, Security, } from 'tsoa' -// import dotenv from 'dotenv'; - -// dotenv.config(); @Tags('MultiTenancy') @Route('/multi-tenancy') diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 2f3c4be6..ce83670c 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -36,9 +36,6 @@ import { ariesAskar } from '@hyperledger/aries-askar-nodejs' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { TsLogger } from './logger' -// import dotenv from 'dotenv'; - -// dotenv.config(); export const setupAgent = async ({ name, endpoints, port }: { name: string; endpoints: string[]; port: number }) => { const BCOVRIN_TEST_GENESIS = (process.env.BCOVRIN_TEST_GENESIS) as string From 66e620547492dc0144b40df75a0ff46456bb6dea Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 17:52:43 +0530 Subject: [PATCH 07/10] fix: remove comments Signed-off-by: Krishna Waske --- src/server.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index 4b9b5aee..dcd93620 100644 --- a/src/server.ts +++ b/src/server.ts @@ -19,7 +19,6 @@ import { proofEvents } from './events/ProofEvents' import { questionAnswerEvents } from './events/QuestionAnswerEvents' import { RegisterRoutes } from './routes/routes' import { SecurityMiddleware } from './securityMiddleware' -// Needed here, before app init import dotenv from 'dotenv'; dotenv.config(); From b4f327fc086230236c0213b5a10c15f39692bacf Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 18:02:17 +0530 Subject: [PATCH 08/10] chore: github warnings Signed-off-by: Krishna Waske --- src/cliAgent.ts | 10 +++++----- src/server.ts | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 2f6b599a..c3d8793c 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -114,11 +114,11 @@ export type RestAgentModules = Awaited> const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) => { - const didContractAddress = process.env.DID_CONTRACT_ADDRESS as string; - const schemaManagerContractAddress = process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string; - const fileServerToken= process.env.FILE_SERVER_TOKEN; - const rpcUrl= process.env.RPC_URL; - const serverUrl= process.env.SERVER_URL; + const didContractAddress = process.env.DID_CONTRACT_ADDRESS as string + const schemaManagerContractAddress = process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string + const fileServerToken = process.env.FILE_SERVER_TOKEN + const rpcUrl = process.env.RPC_URL + const serverUrl = process.env.SERVER_URL const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() const legacyIndyProofFormat = new LegacyIndyProofFormatService() diff --git a/src/server.ts b/src/server.ts index dcd93620..325670bc 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,6 +5,7 @@ import type { Response as ExResponse, Request as ExRequest, NextFunction } from import { Agent } from '@credo-ts/core' import bodyParser from 'body-parser' import cors from 'cors' +import dotenv from 'dotenv' import express from 'express' import { rateLimit } from 'express-rate-limit' import * as fs from 'fs' @@ -19,12 +20,11 @@ import { proofEvents } from './events/ProofEvents' import { questionAnswerEvents } from './events/QuestionAnswerEvents' import { RegisterRoutes } from './routes/routes' import { SecurityMiddleware } from './securityMiddleware' -import dotenv from 'dotenv'; - -dotenv.config(); import { ValidateError, type Exception } from 'tsoa' +dotenv.config() + export const setupServer = async (agent: Agent, config: ServerConfig, apiKey?: string) => { container.registerInstance(Agent, agent) fs.writeFileSync('config.json', JSON.stringify(config, null, 2)) From 5c940ac2b3ec25f1f18a02aaa11d1d8ce7d979a4 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 18:52:13 +0530 Subject: [PATCH 09/10] chore: fix preetier Signed-off-by: Krishna Waske --- src/cliAgent.ts | 3 +-- src/utils/agent.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cliAgent.ts b/src/cliAgent.ts index c3d8793c..74c91c31 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -113,7 +113,6 @@ export type RestMultiTenantAgentModules = Awaited> const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) => { - const didContractAddress = process.env.DID_CONTRACT_ADDRESS as string const schemaManagerContractAddress = process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string const fileServerToken = process.env.FILE_SERVER_TOKEN @@ -296,7 +295,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { } else { networkConfig = [ { - genesisTransactions: (process.env.BCOVRIN_TEST_GENESIS) as string, + genesisTransactions: process.env.BCOVRIN_TEST_GENESIS as string, indyNamespace: 'bcovrin:testnet', isProduction: false, connectOnStartup: true, diff --git a/src/utils/agent.ts b/src/utils/agent.ts index ce83670c..198eb8bd 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -38,7 +38,7 @@ import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { TsLogger } from './logger' export const setupAgent = async ({ name, endpoints, port }: { name: string; endpoints: string[]; port: number }) => { - const BCOVRIN_TEST_GENESIS = (process.env.BCOVRIN_TEST_GENESIS) as string + const BCOVRIN_TEST_GENESIS = process.env.BCOVRIN_TEST_GENESIS as string const logger = new TsLogger(LogLevel.debug) const config: InitConfig = { @@ -62,7 +62,7 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp { isProduction: false, indyNamespace: 'bcovrin:test', - genesisTransactions: (process.env.BCOVRIN_TEST_GENESIS) as string, + genesisTransactions: process.env.BCOVRIN_TEST_GENESIS as string, connectOnStartup: true, }, ], From 74ff02c86ce9e2cd67beb34894254bcdf85408d1 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Wed, 17 Jul 2024 18:57:08 +0530 Subject: [PATCH 10/10] chore: fix preetier Signed-off-by: Krishna Waske --- src/utils/agent.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 198eb8bd..b01aecf1 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -38,7 +38,6 @@ import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { TsLogger } from './logger' export const setupAgent = async ({ name, endpoints, port }: { name: string; endpoints: string[]; port: number }) => { - const BCOVRIN_TEST_GENESIS = process.env.BCOVRIN_TEST_GENESIS as string const logger = new TsLogger(LogLevel.debug) const config: InitConfig = {