diff --git a/examples/cactus-example-tcs-huawei/.gitignore b/examples/cactus-example-tcs-huawei/.gitignore deleted file mode 100644 index bc3fec4ce7..0000000000 --- a/examples/cactus-example-tcs-huawei/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -MeterInfo.json - -# BLP artifacts -etc/ - -# don't commit package-lock -package-lock.json diff --git a/examples/cactus-example-tcs-huawei/BalanceManagement.ts b/examples/cactus-example-tcs-huawei/BalanceManagement.ts deleted file mode 100644 index 0834d49aaa..0000000000 --- a/examples/cactus-example-tcs-huawei/BalanceManagement.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2020-2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * BalanceManagement.ts - */ - -import { - LPInfoHolder, - ConfigUtil, -} from "@hyperledger/cactus-cmd-socketio-server"; - -import { ISendRequestResultV1 } from "@hyperledger/cactus-core-api"; - -import { - VerifierFactory, - VerifierFactoryConfig, -} from "@hyperledger/cactus-verifier-client"; - -const config: any = ConfigUtil.getConfig(); -import { getLogger } from "log4js"; -const moduleName = "BalanceManagement"; -const logger = getLogger(`${moduleName}`); -logger.level = config.logLevel; - -export class BalanceManagement { - private connectInfo: LPInfoHolder = null; // connection information - private readonly verifierFactory: VerifierFactory; - - constructor() { - this.connectInfo = new LPInfoHolder(); - this.verifierFactory = new VerifierFactory( - this.connectInfo.ledgerPluginInfo as VerifierFactoryConfig, - config.logLevel, - ); - } - - getBalance(account: string): Promise { - return new Promise(async (resolve, reject) => { - // for LedgerOperation - // const execData = {"referedAddress": account}; - // const ledgerOperation: LedgerOperation = new LedgerOperation("getNumericBalance", "", execData); - - // for Neo - const contract = {}; // NOTE: Since contract does not need to be specified, specify an empty object. - const method = { type: "web3Eth", command: "getBalance" }; - const args = { args: [account] }; - // const method = "default"; - // const args = {"method": {type: "web3Eth", command: "getBalance"}, "args": {"args": [account]}}; - - const verifier = await this.verifierFactory.getVerifier( - "84jUisrs", - "legacy-socketio", - ); - verifier - .sendSyncRequest(contract, method, args) - .then((result) => { - const res1 = result as ISendRequestResultV1; - const response = { - status: res1.status, - amount: parseFloat(res1.data), - }; - resolve(response); - }) - .catch((err) => { - logger.error(err); - reject(err); - }); - }); - } -} diff --git a/examples/cactus-example-tcs-huawei/BusinessLogicTcsElectricityTrade.ts b/examples/cactus-example-tcs-huawei/BusinessLogicTcsElectricityTrade.ts deleted file mode 100644 index 234344725e..0000000000 --- a/examples/cactus-example-tcs-huawei/BusinessLogicTcsElectricityTrade.ts +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * BusinessLogicElectricityTrade.ts - */ - -import { Request } from "express"; -import { RequestInfo } from "./RequestInfo"; -import { MeterManagement } from "./MeterManagement"; -import { MeterInfo } from "./MeterInfo"; -import { - TradeInfo, - routesTransactionManagement, - BusinessLogicBase, - LedgerEvent, - json2str, - ConfigUtil, - LPInfoHolder, -} from "@hyperledger/cactus-cmd-socketio-server"; -import { makeRawTransaction } from "./TransactionEthereum"; - -//const config: any = JSON.parse(fs.readFileSync("/etc/cactus/default.json", 'utf8')); -const config: any = ConfigUtil.getConfig(); -import { getLogger } from "log4js"; -import { - VerifierFactory, - VerifierFactoryConfig, -} from "@hyperledger/cactus-verifier-client"; -import { NIL } from "uuid"; - -const moduleName = "BusinessLogicElectricityTrade"; -const logger = getLogger(`${moduleName}`); -logger.level = config.logLevel; -const connectInfo = new LPInfoHolder(); -const routesVerifierFactory = new VerifierFactory( - connectInfo.ledgerPluginInfo as VerifierFactoryConfig, - config.logLevel, -); - -export class BusinessLogicElectricityTrade extends BusinessLogicBase { - businessLogicID: string; - meterManagement: MeterManagement; - - constructor(businessLogicID: string) { - super(); - this.businessLogicID = businessLogicID; - this.meterManagement = new MeterManagement(); - } - - startTransaction(req: Request, businessLogicID: string, tradeID: string) { - logger.debug("called startTransaction()"); - - // set RequestInfo - const requestInfo: RequestInfo = new RequestInfo(); - requestInfo.businessLogicID = businessLogicID; - - // set TradeID - requestInfo.setTradeID(tradeID); - - // Create trade information - const tradeInfo: TradeInfo = new TradeInfo( - requestInfo.businessLogicID, - requestInfo.tradeID, - ); - - this.startMonitor(tradeInfo); - } - - startMonitor(tradeInfo: TradeInfo) { - // Get Verifier Instance - logger.debug( - `##startMonitor(): businessLogicID: ${tradeInfo.businessLogicID}`, - ); - const useValidator = JSON.parse( - routesTransactionManagement.getValidatorToUse(tradeInfo.businessLogicID), - ); - logger.debug( - `filterKey: ${config.electricityTradeInfo.tcsHuawei.filterKey}`, - ); - const options = { - filterKey: config.electricityTradeInfo.tcsHuawei.filterKey, - }; - routesVerifierFactory - .getVerifier(useValidator["validatorID"][0]) - .then((verifierTcs) => { - verifierTcs.startMonitor( - "BusinessLogicTcsElectricityTrade", - options, - routesTransactionManagement, - ); - }); - - logger.debug("getVerifierTcs"); - } - - async remittanceTransaction(transactionSubset: object) { - logger.debug( - `called remittanceTransaction(), accountInfo = ${json2str( - transactionSubset, - )}`, - ); - - const accountInfo = this.getAccountInfo(transactionSubset); - if (Object.keys(accountInfo).length === 0) { - logger.debug(`remittanceTransaction(): skip (No target meter)`); - return; - } - - const txParam: { - fromAddress: string; - fromAddressPkey: string; - toAddress: string; - amount: number; - gas: number; - } = { - fromAddress: accountInfo["fromAddress"], - fromAddressPkey: accountInfo["fromAddressPkey"], - toAddress: accountInfo["toAddress"], - amount: Number(transactionSubset["Value"]), - gas: config.electricityTradeInfo.ethereum.gas, - }; - logger.debug(`####txParam = ${json2str(txParam)}`); - - // Get Verifier Instance - logger.debug( - `##remittanceTransaction(): businessLogicID: ${this.businessLogicID}`, - ); - const useValidator = JSON.parse( - routesTransactionManagement.getValidatorToUse(this.businessLogicID), - ); - // const verifierEthereum = routesTransactionManagement.getVerifier(useValidator['validatorID'][1]); - const verifierEthereum = await routesVerifierFactory.getVerifier( - useValidator["validatorID"][1], - ); - verifierEthereum.startMonitor( - "BusinessLogicElectricityTrade", - {}, - routesTransactionManagement, - ); - logger.debug("getVerifierEthereum"); - - // Generate parameters for// sendRawTransaction - logger.debug(`####exec makeRawTransaction!!`); - makeRawTransaction(txParam) - .then((result) => { - logger.info("remittanceTransaction txId : " + result.txId); - - // Set Parameter - logger.debug("remittanceTransaction data : " + json2str(result.data)); - const contract = {}; // NOTE: Since contract does not need to be specified, specify an empty object. - const method = { type: "web3Eth", command: "sendRawTransaction" }; - const args = { args: [result.data["serializedTx"]] }; - - // Run Verifier (Ethereum) - verifierEthereum - .sendAsyncRequest(contract, method, args) - .then(() => { - logger.debug(`##remittanceTransaction sendAsyncRequest finish`); - }) - .catch((err) => { - logger.error(err); - }); - }) - .catch((err) => { - logger.error(err); - }); - } - - onEvent(ledgerEvent: LedgerEvent, targetIndex: number): void { - logger.debug(`##in BLP:onEvent()`); - logger.debug( - `##onEvent(): ${json2str(ledgerEvent["data"]["blockData"][targetIndex])}`, - ); - switch (ledgerEvent.verifierId) { - case config.electricityTradeInfo.tcsHuawei.validatorID: - this.onEventTCS(ledgerEvent.data, targetIndex); - break; - case config.electricityTradeInfo.ethereum.validatorID: - this.onEventEthereum(ledgerEvent.data, targetIndex); - break; - default: - logger.error( - `##onEvent(), invalid verifierId: ${ledgerEvent.verifierId}`, - ); - return; - } - } - - onEventTCS(event: any, targetIndex: number): void { - logger.debug(`##in onEventTCS()`); - logger.debug("event.blockData", event["blockData"]); - logger.debug("event.blockData[0]", event["blockData"][targetIndex]); - logger.debug( - "event.blockData[0].Payload", - event["blockData"][targetIndex]["Payload"], - ); - logger.debug( - "event.blockData.Payload.Name", - event["blockData"][targetIndex]["Payload"]["Name"], - ); - - const trxPayload = event["blockData"][targetIndex]["Payload"]; - if (trxPayload == undefined || trxPayload == NIL) { - logger.error("transaction payload is empty"); - return; - } - try { - if (trxPayload["Verb"].Verb !== "set") { - const transactionSubset = { - Name: trxPayload["Name"], - Value: trxPayload["Value"], - Verb: trxPayload["Verb"], - }; - this.remittanceTransaction(transactionSubset); - } - } catch (err) { - logger.error(`##onEventTCS(): err: ${err}, event: ${json2str(event)}`); - } - } - - getTransactionFromTCSEvent( - event: object, - targetIndex: number, - ): object | null { - try { - const retTransaction = event["blockData"][targetIndex]; - logger.debug( - `##getTransactionFromTCSEvent(), retTransaction: ${retTransaction}`, - ); - return retTransaction; - } catch (err) { - logger.error( - `##getTransactionFromTCSEvent(): invalid even, err:${err}, event:${event}`, - ); - } - } - - onEventEthereum(event: object, targetIndex: number): void { - logger.debug(`##in onEventEthereum()`); - const tx = this.getTransactionFromEthereumEvent(event, targetIndex); - if (tx == null) { - logger.error(`##onEventEthereum(): invalid event: ${json2str(event)}`); - return; - } - - try { - const txId = tx["hash"]; - const status = event["status"]; - logger.debug(`##txId = ${txId}`); - logger.debug(`##status =${status}`); - - if (status !== 200) { - logger.error( - `##onEventEthereum(): error event, status: ${status}, txId: ${txId}`, - ); - return; - } - } catch (err) { - logger.error( - `##onEventEthereum(): err: ${err}, event: ${json2str(event)}`, - ); - } - } - - getTransactionFromEthereumEvent( - event: object, - targetIndex: number, - ): object | null { - try { - const retTransaction = event["blockData"]["transactions"][targetIndex]; - logger.debug( - `##getTransactionFromEthereumEvent(), retTransaction: ${retTransaction}`, - ); - return retTransaction; - } catch (err) { - logger.error( - `##getTransactionFromEthereumEvent(): invalid even, err:${err}, event:${event}`, - ); - } - } - - getOperationStatus(): object { - logger.debug(`##in getOperationStatus()`); - return {}; - } - - getTxIDFromEvent( - ledgerEvent: LedgerEvent, - targetIndex: number, - ): string | null { - logger.debug(`##in getTxIDFromEvent`); - - switch (ledgerEvent.verifierId) { - case config.electricityTradeInfo.tcsHuawei.validatorID: - return this.getTxIDFromEventTCS(ledgerEvent.data, targetIndex); - case config.electricityTradeInfo.ethereum.validatorID: - return this.getTxIDFromEventEtherem(ledgerEvent.data, targetIndex); - default: - logger.error( - `##getTxIDFromEvent(): invalid verifierId: ${ledgerEvent.verifierId}`, - ); - } - return null; - } - - getTxIDFromEventTCS(event: object, targetIndex: number): string | null { - logger.debug(`##in getTxIDFromEventTCS()`); - const tx = this.getTransactionFromTCSEvent(event, targetIndex); - if (tx == null) { - logger.warn(`#getTxIDFromEventTCS(): skip(not found tx)`); - return null; - } - - try { - return "txId-test-1"; - const txId = tx["header_signature"]; - - if (typeof txId !== "string") { - logger.warn( - `#getTxIDFromEventTCS(): skip(invalid block, not found txId.), event: ${json2str( - event, - )}`, - ); - return null; - } - - logger.debug(`###getTxIDFromEventTCS(): txId: ${txId}`); - return txId; - } catch (err) { - logger.error( - `##getTxIDFromEventTCS(): err: ${err}, event: ${json2str(event)}`, - ); - return null; - } - } - - getTxIDFromEventEtherem(event: object, targetIndex: number): string | null { - logger.debug(`##in getTxIDFromEventEtherem()`); - const tx = this.getTransactionFromEthereumEvent(event, targetIndex); - if (tx == null) { - logger.warn(`#getTxIDFromEventEtherem(): skip(not found tx)`); - return null; - } - - try { - const txId = tx["hash"]; - - if (typeof txId !== "string") { - logger.warn( - `#getTxIDFromEventEtherem(): skip(invalid block, not found txId.), event: ${json2str( - event, - )}`, - ); - return null; - } - - logger.debug(`###getTxIDFromEventEtherem(): txId: ${txId}`); - return txId; - } catch (err) { - logger.error( - `##getTxIDFromEventEtherem(): err: ${err}, event: ${json2str(event)}`, - ); - return null; - } - } - - getEventDataNum(ledgerEvent: LedgerEvent): number { - logger.debug( - `##in BLP:getEventDataNum(), ledgerEvent.verifierId: ${ledgerEvent.verifierId}`, - ); - const event = ledgerEvent.data; - let retEventNum = 0; - - try { - switch (ledgerEvent.verifierId) { - case config.electricityTradeInfo.tcsHuawei.validatorID: - retEventNum = event["blockData"].length; - break; - case config.electricityTradeInfo.ethereum.validatorID: - retEventNum = event["blockData"]["transactions"].length; - break; - default: - logger.error( - `##getEventDataNum(): invalid verifierId: ${ledgerEvent.verifierId}`, - ); - break; - } - logger.debug( - `##getEventDataNum(): retEventNum: ${retEventNum}, verifierId: ${ledgerEvent.verifierId}`, - ); - return retEventNum; - } catch (err) { - logger.error( - `##getEventDataNum(): invalid even, err: ${err}, event: ${event}`, - ); - return 0; - } - } - - getAccountInfo(transactionSubset: object): object { - const transactionInfo = {}; - - // Get Meter Information. - const meterInfo: MeterInfo | null = this.meterManagement.getMeterInfo( - transactionSubset["Name"], - ); - if (meterInfo === null) { - logger.debug(`Not registered. meterID = ${transactionSubset["Name"]}`); - return transactionInfo; - } - - logger.debug(`getAccountInfo(): Verb = ${transactionSubset["Verb"]}`); - if (transactionSubset["Verb"] === "inc") { - logger.debug("getAccountInfo(): Verb = inc"); - transactionInfo["fromAddress"] = "0x" + meterInfo.bankAccount; - transactionInfo["fromAddressPkey"] = meterInfo.bankAccountPKey; - transactionInfo["toAddress"] = "0x" + meterInfo.powerCompanyAccount; - } - - return transactionInfo; - } - - setConfig(meterParams: string[]): object { - logger.debug("called setConfig()"); - - // add MeterInfo - const meterInfo = new MeterInfo(meterParams); - const result = this.meterManagement.addMeterInfo(meterInfo); - return result; - } -} diff --git a/examples/cactus-example-tcs-huawei/CHANGELOG.md b/examples/cactus-example-tcs-huawei/CHANGELOG.md deleted file mode 100644 index 7ca83bdb13..0000000000 --- a/examples/cactus-example-tcs-huawei/CHANGELOG.md +++ /dev/null @@ -1,22 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [2.0.0-rc.1](https://github.com/hyperledger/cacti/compare/v2.0.0-alpha.2...v2.0.0-rc.1) (2024-06-14) - -### Bug Fixes - -* **deps:** bulk add missing dependencies - 2023-11-02 ([8addb01](https://github.com/hyperledger/cacti/commit/8addb018b6d124d54d9d948bbaeba6ea33b67153)), closes [#2857](https://github.com/hyperledger/cacti/issues/2857) -* **security:** remediate qs vulnerability CVE-2022-24999 ([536b6b1](https://github.com/hyperledger/cacti/commit/536b6b1b7ab9014ebcd6b162e1a467e78b52afdd)) - -# [2.0.0-alpha.2](https://github.com/hyperledger/cacti/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2023-09-27) - -### Bug Fixes - -* **security:** the CVE-2022-2421 - upgrade socket.io-parser to >=4.2.1 ([9172172](https://github.com/hyperledger/cacti/commit/917217227a3fa53a00429f047cd6318862e6ab8d)), closes [#2229](https://github.com/hyperledger/cacti/issues/2229) [#2228](https://github.com/hyperledger/cacti/issues/2228) -* **security:** upgrade fabric 2.x deps to 2.2.18 ([36988a5](https://github.com/hyperledger/cacti/commit/36988a5edbf9856a1bcc960a3b9afe443536733e)), closes [#2610](https://github.com/hyperledger/cacti/issues/2610) - -### Features - -* **connector-tcs-huawei:** add initial version ([d8d538d](https://github.com/hyperledger/cacti/commit/d8d538d42692ddf01ef24327cb31bd8e6cd48c01)) diff --git a/examples/cactus-example-tcs-huawei/Dockerfile b/examples/cactus-example-tcs-huawei/Dockerfile deleted file mode 100644 index 6795b68371..0000000000 --- a/examples/cactus-example-tcs-huawei/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM cactus-cmd-socketio-server:latest - -ARG NPM_PKG_VERSION=latest - -ENV APP_HOME=/root/cactus - -WORKDIR ${APP_HOME} - -COPY ./dist/yarn.lock ./package.json ./ -RUN yarn add "${CACTUS_CMD_SOCKETIO_PATH}" "@hyperledger/cactus-verifier-client@${NPM_PKG_VERSION}" \ - --production --ignore-engines --non-interactive --cache-folder ./.yarnCache && \ - rm -rf ./.yarnCache - -COPY ./dist ./dist/ - -CMD ["node", "./dist/www.js"] diff --git a/examples/cactus-example-tcs-huawei/MeterInfo.ts b/examples/cactus-example-tcs-huawei/MeterInfo.ts deleted file mode 100644 index e598b81d16..0000000000 --- a/examples/cactus-example-tcs-huawei/MeterInfo.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * MeterInfo.ts - */ - -export class MeterInfo { - meterID: string; - bankAccount: string; - bankAccountPKey: string; - powerCompanyAccount: string; - - constructor(meterParams: string[]) { - this.meterID = meterParams[0]; - this.bankAccount = meterParams[1]; - this.bankAccountPKey = meterParams[2]; - this.powerCompanyAccount = meterParams[3]; - } -} diff --git a/examples/cactus-example-tcs-huawei/MeterManagement.ts b/examples/cactus-example-tcs-huawei/MeterManagement.ts deleted file mode 100644 index f3b5299325..0000000000 --- a/examples/cactus-example-tcs-huawei/MeterManagement.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * MeterManagement.ts - */ - -import { MeterInfo } from "./MeterInfo"; -import { ConfigUtil } from "@hyperledger/cactus-cmd-socketio-server"; -import fs from "fs"; -const config: any = ConfigUtil.getConfig(); -import { getLogger } from "log4js"; -const moduleName = "MeterManagement"; -const logger = getLogger(`${moduleName}`); -logger.level = config.logLevel; - -// Meter Management Class -export class MeterManagement { - fileName = "MeterInfo.json"; - - constructor() {} - - // For debugging - fileDump() { - const confirmData: string = fs.readFileSync(this.fileName, "utf8"); - const arrayData: MeterInfo[] = JSON.parse(confirmData).table as MeterInfo[]; - logger.debug(arrayData); - } - - addMeterInfo(addMeterInfo: MeterInfo): object { - // Existence check of table file - try { - fs.statSync(this.fileName); - } catch (err) { - // Creating an empty table file - const emptyTable = { - table: [], - }; - const emptyTableJson: string = JSON.stringify(emptyTable); - fs.writeFileSync(this.fileName, emptyTableJson, "utf8"); - } - - // Read table file - const meterInfoFileData: string = fs.readFileSync(this.fileName, "utf8"); - const meterInfoTable: string[] = JSON.parse(meterInfoFileData) - .table as string[]; - - // Search target records / replace data - const meterInfoTableNew = { - table: [], - }; - let existFlag = false; - let action = ""; - meterInfoTable.forEach((meterInfoJSON) => { - const meterInfo: MeterInfo = JSON.parse(meterInfoJSON) as MeterInfo; - - // Determine if it is a target record - if (meterInfo.meterID === addMeterInfo.meterID) { - // Change Status - meterInfo.bankAccount = addMeterInfo.bankAccount; - meterInfo.bankAccountPKey = addMeterInfo.bankAccountPKey; - meterInfo.powerCompanyAccount = addMeterInfo.powerCompanyAccount; - existFlag = true; - action = "update"; - } - - // Register Record - const meterInfoNewJson: string = JSON.stringify(meterInfo); - // logger.debug(`meter info = ${meterInfoNewJson}`); - meterInfoTableNew.table.push(meterInfoNewJson); - }); - if (existFlag === false) { - const addMeterInfoJson: string = JSON.stringify(addMeterInfo); - logger.debug(`add meter info = ${addMeterInfoJson}`); - meterInfoTableNew.table.push(addMeterInfoJson); - action = "add"; - } - - // Table File Write - const meterInfoTableNewJson: string = JSON.stringify(meterInfoTableNew); - fs.writeFileSync(this.fileName, meterInfoTableNewJson, "utf8"); - - // this.fileDump(); - - const result = { - action: action, - meterID: addMeterInfo.meterID, - }; - return result; - } - - getMeterInfo(meterID: string): MeterInfo { - // Existence check of table file - try { - fs.statSync(this.fileName); - } catch (err) { - throw err; - } - - // Read table file - const meterInfoFileData: string = fs.readFileSync(this.fileName, "utf8"); - const meterInfoTable: string[] = JSON.parse(meterInfoFileData) - .table as string[]; - - // Search target records - let retMeterInfo: MeterInfo | null = null; - meterInfoTable.forEach((meterInfoJSON) => { - const meterInfo: MeterInfo = JSON.parse(meterInfoJSON) as MeterInfo; - - // Determine if it is a target record - if (meterInfo.meterID === meterID) { - retMeterInfo = meterInfo; - return; - } - }); - - return retMeterInfo; - } -} diff --git a/examples/cactus-example-tcs-huawei/README.md b/examples/cactus-example-tcs-huawei/README.md deleted file mode 100644 index 40b52f8671..0000000000 --- a/examples/cactus-example-tcs-huawei/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Cactus example-tcs-huawei - -## Abstract - -Cactus **example-tcs-huawei** is a sample application for exchanging electricity .It starts in a similar way to cactus-example-electricity-trade. - -![electricity-trade image](./images/electricity-trade-image.png) - -## Required software components -- OS: Linux (recommend: Ubuntu18.04 or CentOS7) -- Docker (recommend: v17.06.2-ce or greater) -- Docker-compose (recommend: v1.14.0 or greater) -- node.js v16 (recommend: v16 or greater) diff --git a/examples/cactus-example-tcs-huawei/RequestInfo.ts b/examples/cactus-example-tcs-huawei/RequestInfo.ts deleted file mode 100644 index 8753de81a9..0000000000 --- a/examples/cactus-example-tcs-huawei/RequestInfo.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * RequestInfo.ts - */ - -// transaction information -class TradeInfo { - ethereumAccountA: string; - ethereumAccountB: string; -} - -// authorization information -class AuthInfo { - company: string; -} - -// request information -export class RequestInfo { - businessLogicID: string; - tradeID: string; - tradeInfo: TradeInfo; - authInfo: AuthInfo; - constructor() { - this.tradeInfo = new TradeInfo(); - this.authInfo = new AuthInfo(); - } - - setTradeID(tradeID: string) { - this.tradeID = tradeID; - } -} diff --git a/examples/cactus-example-tcs-huawei/TransactionEthereum.ts b/examples/cactus-example-tcs-huawei/TransactionEthereum.ts deleted file mode 100644 index df6967d154..0000000000 --- a/examples/cactus-example-tcs-huawei/TransactionEthereum.ts +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * TransactionEthereum.ts - */ - -import { - LPInfoHolder, - TransactionSigner, - ConfigUtil, -} from "@hyperledger/cactus-cmd-socketio-server"; -import { ISendRequestResultV1 } from "@hyperledger/cactus-core-api"; - -import { - VerifierFactory, - VerifierFactoryConfig, -} from "@hyperledger/cactus-verifier-client"; - -//const config: any = JSON.parse(fs.readFileSync("/etc/cactus/default.json", 'utf8')); -const config: any = ConfigUtil.getConfig(); -import { getLogger } from "log4js"; -const moduleName = "TransactionEthereum"; -const logger = getLogger(`${moduleName}`); -logger.level = config.logLevel; - -const mapFromAddressNonce: Map = new Map(); -let xConnectInfo: LPInfoHolder = null; // connection information -let xVerifierFactory: VerifierFactory = null; - -export function makeRawTransaction(txParam: { - fromAddress: string; - fromAddressPkey: string; - toAddress: string; - amount: number; - gas: number; -}): Promise<{ data: unknown; txId: string }> { - return new Promise(async (resolve, reject) => { - try { - logger.debug(`makeRawTransaction: txParam: ${JSON.stringify(txParam)}`); - - getNewNonce(txParam.fromAddress).then((result) => { - logger.debug( - `##makeRawTransaction(A): result: ${JSON.stringify(result)}`, - ); - - const txnCountHex: string = result.txnCountHex; - - const rawTx: { nonce: string; to: string; value: number; gas: number } = - { - nonce: txnCountHex, - to: txParam.toAddress, - value: txParam.amount, - gas: txParam.gas, - }; - logger.debug( - `##makeRawTransaction(B), rawTx: ${JSON.stringify(rawTx)}`, - ); - - const signedTx = TransactionSigner.signTxEthereum( - rawTx, - txParam.fromAddressPkey, - ); - const resp: { data: unknown; txId: string } = { - data: { serializedTx: signedTx["serializedTx"] }, - txId: signedTx["txId"], - }; - - return resolve(resp); - }); - } catch (err) { - logger.error(err); - return reject(err); - } - }); -} - -function getNewNonce(fromAddress: string): Promise<{ txnCountHex: string }> { - return new Promise(async (resolve, reject) => { - try { - logger.debug(`getNewNonce start: fromAddress: ${fromAddress}`); - - if (xConnectInfo === null) { - xConnectInfo = new LPInfoHolder(); - } - - if (xVerifierFactory === null) { - logger.debug("create verifier factory"); - xVerifierFactory = new VerifierFactory( - xConnectInfo.ledgerPluginInfo as VerifierFactoryConfig, - config.logLevel, - ); - } - - // Get the number of transactions in account - const contract = {}; // NOTE: Since contract does not need to be specified, specify an empty object. - const method = { type: "function", command: "getNonce" }; - const args = { args: { args: [fromAddress] } }; - - logger.debug(`##getNewNonce(A): call validator#getNonce()`); - const verifier = await this.verifierFactory.getVerifier( - "84jUisrs", - "legacy-socketio", - ); - - verifier.sendSyncRequest(contract, method, args).then((result) => { - // logger.debug(`##getNewNonce(A): result: ${JSON.stringify(result)}`); - - const res1 = result as ISendRequestResultV1<{ - readonly nonce: number; - readonly nonceHex: string; - }>; - - let txnCount: number = res1.data.nonce; - let txnCountHex: string = res1.data.nonceHex; - - const latestNonce = getLatestNonce(fromAddress); - // logger.debug(`##getNewNonce(B): fromAddress: ${fromAddress}, txnCount: ${txnCount}, latestNonce: ${latestNonce}`); - if (txnCount <= latestNonce) { - // nonce correction - txnCount = latestNonce + 1; - logger.debug( - `##getNewNonce(C): Adjust txnCount, fromAddress: ${fromAddress}, txnCount: ${txnCount}, latestNonce: ${latestNonce}`, - ); - - const method = { type: "function", command: "toHex" }; - const args = { args: { args: [txnCount] } }; - - logger.debug(`##getNewNonce(D): call validator#toHex()`); - verifier.sendSyncRequest(contract, method, args).then((result) => { - const res2 = result as ISendRequestResultV1<{ - readonly hexStr: string; - }>; - txnCountHex = res2.data.hexStr; - logger.debug(`##getNewNonce(E): txnCountHex: ${txnCountHex}`); - - // logger.debug(`##getNewNonce(F) _nonce: ${txnCount}, latestNonce: ${latestNonce}`); - setLatestNonce(fromAddress, txnCount); - - return resolve({ txnCountHex: txnCountHex }); - }); - } else { - // logger.debug(`##getNewNonce(F) _nonce: ${txnCount}, latestNonce: ${latestNonce}`); - setLatestNonce(fromAddress, txnCount); - - logger.debug(`##getNewNonce(G): txnCountHex: ${txnCountHex}`); - return resolve({ txnCountHex: txnCountHex }); - } - }); - } catch (err) { - logger.error(err); - return reject(err); - } - }); -} - -function getLatestNonce(fromAddress: string): number { - if (mapFromAddressNonce.has(fromAddress)) { - return mapFromAddressNonce.get(fromAddress); - } - //return 0; - return -1; -} - -function setLatestNonce(fromAddress: string, nonce: number): void { - mapFromAddressNonce.set(fromAddress, nonce); -} diff --git a/examples/cactus-example-tcs-huawei/balance.ts b/examples/cactus-example-tcs-huawei/balance.ts deleted file mode 100644 index 79d87dfe66..0000000000 --- a/examples/cactus-example-tcs-huawei/balance.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2020-2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * balance.ts - */ - -import { Router, NextFunction, Request, Response } from "express"; -import { ConfigUtil, RIFError } from "@hyperledger/cactus-cmd-socketio-server"; -import { BalanceManagement } from "./BalanceManagement"; - -const config: any = ConfigUtil.getConfig(); -import { getLogger } from "log4js"; -const moduleName = "balance"; -const logger = getLogger(`${moduleName}`); -logger.level = config.logLevel; - -const router: Router = Router(); -const balanceManagement: BalanceManagement = new BalanceManagement(); - -/* GET balance. */ -router.get("/:account", (req: Request, res: Response, next: NextFunction) => { - try { - balanceManagement - .getBalance(req.params.account) - .then((result) => { - logger.debug(`#####[sample/balance.ts]`); - logger.debug("result(getBalance) = " + JSON.stringify(result)); - res.status(200).json(result); - }) - .catch((err) => { - logger.error(err); - }); - } catch (err) { - logger.error(`##err name: ${err.constructor.name}`); - - if (err instanceof RIFError) { - logger.debug(`##catch RIFError, ${err.statusCode}, ${err.message}`); - res.status(err.statusCode); - res.send(err.message); - return; - } - - logger.error(`##err in balance: ${err}`); - next(err); - } -}); - -export default router; diff --git a/examples/cactus-example-tcs-huawei/config/contractInfo.yaml b/examples/cactus-example-tcs-huawei/config/contractInfo.yaml deleted file mode 100644 index 5bcb340a4f..0000000000 --- a/examples/cactus-example-tcs-huawei/config/contractInfo.yaml +++ /dev/null @@ -1 +0,0 @@ -contractInfo: [] \ No newline at end of file diff --git a/examples/cactus-example-tcs-huawei/config/default.yaml b/examples/cactus-example-tcs-huawei/config/default.yaml deleted file mode 100644 index 8b79c03caf..0000000000 --- a/examples/cactus-example-tcs-huawei/config/default.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Default cactus-cmd-socketio-server configuration -# Do not change this, update the settings in usersetting.yaml -# Check examples/cactus-example-discounted-asset-trade/config for working example - -# List of Bussiness Logic Plugin and it's validators -blpRegistry: [] - -# log4js log levels used by cactus-cmd-socketio-server and smaple BLPs -logLevel: info - -# Connection info -applicationHostInfo: - hostName: 0.0.0.0 - hostPort: 5034 - -# Socket.IO Manager options -socketOptions: - rejectUnauthorized: false - reconnection: false - timeout: 20000 - -# Verifier component configuration -verifier: - maxCounterRequestID: 100 - syncFunctionTimeoutMillisecond: 5000 - -# API route path and JS file to handle that route logic -appRouters: [] diff --git a/examples/cactus-example-tcs-huawei/config/usersetting.yaml b/examples/cactus-example-tcs-huawei/config/usersetting.yaml deleted file mode 100644 index 730b4fd332..0000000000 --- a/examples/cactus-example-tcs-huawei/config/usersetting.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Overwrite defaults -blpRegistry: - - - businessLogicID: h40Q9eMD - validatorID: [sUr7dZly, 84jUisrs] - -logLevel: debug - -appRouters: - - - path: /api/v1/bl/electricity-trade/ - routerJs: /root/cactus/dist/electricity-trade.js - - - path: /api/v1/bl/balance/ - routerJs: /root/cactus/dist/balance.js - -# BLP Config -electricityTradeInfo: - tcsHuawei: - validatorID: sUr7dZly - filterKey: intkey - ethereum: - validatorID: 84jUisrs - gethURL: http://localhost:8545 - chainName: geth1 - networkID: 10 - chainID: 10 - network: mainnet - hardfork: petersburg - gas: 21000 diff --git a/examples/cactus-example-tcs-huawei/config/validator-registry-config.yaml b/examples/cactus-example-tcs-huawei/config/validator-registry-config.yaml deleted file mode 100644 index c939a4b6a0..0000000000 --- a/examples/cactus-example-tcs-huawei/config/validator-registry-config.yaml +++ /dev/null @@ -1,62 +0,0 @@ -ledgerPluginInfo: - - - validatorID: 84jUisrs - validatorType: legacy-socketio - validatorURL: https://ethereum-validator:5050 - validatorKeyPath: /etc/cactus/connector-go-ethereum-socketio/CA/connector.crt - maxCounterRequestID: 100 - syncFunctionTimeoutMillisecond: 5000 - socketOptions: - rejectUnauthorized: false - reconnection: false - timeout: 20000 - ledgerInfo: - ledgerAbstract: Go-Ethereum Ledger - apiInfo: - - - apiType: getNumericBalance - requestedData: - - - dataName: referedAddress - dataType: string - - - apiType: transferNumericAsset - requestedData: - - - dataName: fromAddress - dataType: string - - - dataName: toAddress - dataType: string - - - dataName: amount - dataType: number - - - apiType: sendRawTransaction - requestedData: - - - dataName: serializedTx - dataType: string - - - - validatorID: sUr7dZly - validatorType: legacy-socketio - validatorURL: https://tcs-validator:5140 - validatorKeyPath: /etc/cactus/connector-tcs-huawei/CA/connector.crt - maxCounterRequestID: 100 - syncFunctionTimeoutMillisecond: 5000 - socketOptions: - rejectUnauthorized: false - reconnection: false - timeout: 20000 - ledgerInfo: - ledgerAbstract: Sawtooth Ledger - apiInfo: [] - -signTxInfo: - ethereum: - chainName: geth1 - networkID: 10 - chainID: 10 - network: mainnet - hardfork: petersburg diff --git a/examples/cactus-example-tcs-huawei/docker-compose.debug.yml b/examples/cactus-example-tcs-huawei/docker-compose.debug.yml deleted file mode 100644 index bd8f1b63a9..0000000000 --- a/examples/cactus-example-tcs-huawei/docker-compose.debug.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: "3.4" - -# Use: docker-compose -f docker-compose.yml -f docker-compose.debug.yml up - -services: - cactus-example-electricity-trade-blp: - ports: - - "9034:9034" - command: node --inspect=0.0.0.0:9034 ./dist/www.js diff --git a/examples/cactus-example-tcs-huawei/docker-compose.yml b/examples/cactus-example-tcs-huawei/docker-compose.yml deleted file mode 100644 index 8414e7ff26..0000000000 --- a/examples/cactus-example-tcs-huawei/docker-compose.yml +++ /dev/null @@ -1,69 +0,0 @@ -version: "3.4" - -# Start the ledgers first -# ./etc/cactus should already exist and contain cactus node configs - -services: - ethereum-validator: - container_name: cactus-example-electricity-trade-ethereum-validator - image: cactus-plugin-ledger-connector-go-ethereum-socketio - build: - context: ../../packages/cactus-plugin-ledger-connector-go-ethereum-socketio/ - ports: - - "5050:5050" - networks: - - geth1net - - cactus-example-electricity-trade-net - volumes: - - type: bind - source: ./etc/cactus - target: /etc/cactus - - tcs-validator: - container_name: cactus-example-electricity-trade-tcs-validator - image: cactus-plugin-ledger-connector-tcs - build: - context: ../../packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/ - ports: - - "5140:5140" - networks: - - example_tcs_huawei_testnet_1x - - cactus-example-electricity-trade-net - volumes: - - type: bind - source: ./etc/cactus - target: /etc/cactus - - cmd-socketio-base-image: - # Build base image and immediately exit - container_name: cmd-socketio-base-dummy - image: cactus-cmd-socketio-server - build: - context: ../../packages/cactus-cmd-socketio-server/ - command: ["echo", "OK - Exit"] - - cactus-example-electricity-trade-blp: - container_name: cactus-example-electricity-trade-blp - image: cactus-example-electricity-trade-blp - build: - context: . - ports: - - "5034:5034" - networks: - - cactus-example-electricity-trade-net - depends_on: - - ethereum-validator - - tcs-validator - - cmd-socketio-base-image - volumes: - - type: bind - source: ./etc/cactus - target: /etc/cactus - -networks: - example_tcs_huawei_testnet_1x: - external: true - geth1net: - external: true - cactus-example-electricity-trade-net: - driver: bridge diff --git a/examples/cactus-example-tcs-huawei/electricity-trade.ts b/examples/cactus-example-tcs-huawei/electricity-trade.ts deleted file mode 100644 index c6aeb4d7d0..0000000000 --- a/examples/cactus-example-tcs-huawei/electricity-trade.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * electricity-trade.ts - */ - -import { Router, NextFunction, Request, Response } from "express"; -import { - TransactionManagement, - RIFError, - ConfigUtil, -} from "@hyperledger/cactus-cmd-socketio-server"; -import escapeHtml from "escape-html"; - -const config: any = ConfigUtil.getConfig(); -import { getLogger } from "log4js"; -const moduleName = "trades"; -const logger = getLogger(`${moduleName}`); -logger.level = config.logLevel; - -const router: Router = Router(); -export const transactionManagement: TransactionManagement = - new TransactionManagement(); - -// Request Execution of Trade -router.post("/", (req: Request, res: Response, next: NextFunction) => { - try { - logger.warn("pre startBusinessLogic "); - const tradeID = transactionManagement.startBusinessLogic(req); - if (!tradeID) { - throw new RIFError(`Could not run BLP, tradeId = ${tradeID}`); - } - const result = { tradeID: tradeID }; - res.status(200).json(result); - } catch (err) { - if (err instanceof RIFError) { - res.status(err.statusCode); - res.send(escapeHtml(err.message)); - return; - } - - next(err); - } -}); - -// Request Execution of Trade -router.post( - "/meter/register/", - (req: Request, res: Response, next: NextFunction) => { - try { - const result = transactionManagement.setBusinessLogicConfig(req); - - if (!result) { - throw new RIFError("Error when running setBusinessLogicConfig"); - } - - let status = 200; - if (result["action"] === "add") { - status = 201; - } - res.status(status).json(result); - } catch (err) { - if (err instanceof RIFError) { - res.status(err.statusCode); - res.send(escapeHtml(err.message)); - return; - } - - next(err); - } - }, -); - -export default router; diff --git a/examples/cactus-example-tcs-huawei/images/electricity-trade-image.png b/examples/cactus-example-tcs-huawei/images/electricity-trade-image.png deleted file mode 100644 index 4fa9881524..0000000000 Binary files a/examples/cactus-example-tcs-huawei/images/electricity-trade-image.png and /dev/null differ diff --git a/examples/cactus-example-tcs-huawei/images/electricity-trade-image.pptx b/examples/cactus-example-tcs-huawei/images/electricity-trade-image.pptx deleted file mode 100644 index c7cc25a4c4..0000000000 Binary files a/examples/cactus-example-tcs-huawei/images/electricity-trade-image.pptx and /dev/null differ diff --git a/examples/cactus-example-tcs-huawei/package.json b/examples/cactus-example-tcs-huawei/package.json deleted file mode 100644 index 250ebd982b..0000000000 --- a/examples/cactus-example-tcs-huawei/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "@hyperledger/cactus-example-tcs-huawei", - "version": "2.0.0-rc.1", - "license": "Apache-2.0", - "main": "dist/www.js", - "module": "dist/www.js", - "types": "dist/www.d.ts", - "scripts": { - "build": "npm run build-ts && npm run build:dev:backend:postbuild", - "build-ts": "tsc", - "build:dev:backend:postbuild": "cp -f ../../yarn.lock ./dist/", - "start": "docker-compose build && docker-compose up" - }, - "dependencies": { - "@hyperledger/cactus-cmd-socketio-server": "2.0.0-rc.1", - "@hyperledger/cactus-core-api": "2.0.0-rc.1", - "@hyperledger/cactus-verifier-client": "2.0.0-rc.1", - "@types/node": "18.11.9", - "@types/uuid": "9.0.8", - "body-parser": "1.20.2", - "cookie-parser": "1.4.6", - "debug": "2.6.9", - "escape-html": "1.0.3", - "ethereumjs-common": "1.5.2", - "ethereumjs-tx": "2.1.2", - "express": "4.19.2", - "fabric-ca-client": "2.2.20", - "fabric-network": "2.2.20", - "http-errors": "1.6.3", - "js-yaml": "3.14.1", - "jsonwebtoken": "8.5.1", - "log4js": "6.4.0", - "morgan": "1.9.1", - "shelljs": "0.8.5", - "socket.io": "4.5.4", - "ts-node": "8.9.1", - "uuid": "9.0.1", - "web3": "1.7.0", - "xmlhttprequest": "1.8.0" - }, - "devDependencies": { - "@types/body-parser": "1.19.3", - "@types/cookie-parser": "1.4.2", - "@types/escape-html": "1.0.1", - "@types/express": "4.17.21" - }, - "engines": { - "node": ">=18", - "npm": ">=8" - } -} diff --git a/examples/cactus-example-tcs-huawei/script-cleanup.sh b/examples/cactus-example-tcs-huawei/script-cleanup.sh deleted file mode 100644 index e8f02d166f..0000000000 --- a/examples/cactus-example-tcs-huawei/script-cleanup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020-2022 Hyperledger Cactus Contributors -# SPDX-License-Identifier: Apache-2.0 - -ROOT_DIR="../.." # Path to cactus root dir - -echo ">> Remove the config files on your machine" -rm -rf ./etc/cactus/ - -# pushd ${ROOT_DIR}/tools/docker/tcs-huawei-testnet/example -# docker-compose down & -# popd - -echo ">> Stop and remove the docker containers" -docker rm -f geth1 \ - cactus-example-electricity-trade-blp \ - cactus-example-electricity-trade-ethereum-validator \ - cactus-example-electricity-trade-tcs-validator \ - cmd-socketio-base-dummy \ - agent - -echo ">> Remove docker networks" -docker network rm tcs_huawei_testnet_1x \ - cactus-example-tcs_default \ - cactus-example-tcs_cactus-example-electricity-trade-net \ - geth1net \ - geth-testnet_default - - -echo "Cleanup done." diff --git a/examples/cactus-example-tcs-huawei/script-gen-electricity-usage.sh b/examples/cactus-example-tcs-huawei/script-gen-electricity-usage.sh deleted file mode 100644 index c6427592a1..0000000000 --- a/examples/cactus-example-tcs-huawei/script-gen-electricity-usage.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020-2022 Hyperledger Cactus Contributors -# SPDX-License-Identifier: Apache-2.0 - -# echo "# Create intkey representing electricity usage" -# docker exec -t sawtooth_all_in_one_ledger_1x shell intkey set MI000001 50 --url http://rest-api:8008 - -# echo "# Increase usage" -# docker exec -t sawtooth_all_in_one_ledger_1x shell intkey inc MI000001 24 --url http://rest-api:8008 - -curl --location -k --request POST 'https://127.0.0.1:8001/v1/cross/transaction/query' \ ---header 'Content-Type: text/plain' --data '{ - "to_chain":"B01234567890123456789012345678901234567890123456789", - "from_chaincode_id":"ExcuteChainCode", - "to_chaincode_id":"ExcuteChainCode", - "to_query_func_name":"set", - "args":["MI000001", "50"] - }' --cert ../../packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/sample-config/cert.pem --key ../../packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/sample-config/key.pem - -curl --location -k --request POST 'https://127.0.0.1:8001/v1/cross/transaction/query' \ ---header 'Content-Type: text/plain' --data '{ - "to_chain":"B01234567890123456789012345678901234567890123456789", - "from_chaincode_id":"ExcuteChainCode", - "to_chaincode_id":"ExcuteChainCode", - "to_query_func_name":"inc", - "args":["MI000001", "24"] - }' --cert ../../packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/sample-config/cert.pem --key ../../packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/sample-config/key.pem \ No newline at end of file diff --git a/examples/cactus-example-tcs-huawei/script-get-app.sh b/examples/cactus-example-tcs-huawei/script-get-app.sh deleted file mode 100644 index f1873bed1d..0000000000 --- a/examples/cactus-example-tcs-huawei/script-get-app.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020-2022 Hyperledger Cactus Contributors -# SPDX-License-Identifier: Apache-2.0 - -echo "# Source Eth balance:" -curl localhost:5034/api/v1/bl/balance/06fc56347d91c6ad2dae0c3ba38eb12ab0d72e97 - -echo -e "\n\n# Destination Eth balance:" -curl localhost:5034/api/v1/bl/balance/9d624f7995e8bd70251f8265f2f9f2b49f169c55 - -echo -e "\n\n# Electricity usage" -# docker exec -t sawtooth_all_in_one_ledger_1x shell intkey list --url http://rest-api:8008 diff --git a/examples/cactus-example-tcs-huawei/script-post-setup-request.sh b/examples/cactus-example-tcs-huawei/script-post-setup-request.sh deleted file mode 100644 index 7851c4be4b..0000000000 --- a/examples/cactus-example-tcs-huawei/script-post-setup-request.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020-2022 Hyperledger Cactus Contributors -# SPDX-License-Identifier: Apache-2.0 - -echo "Register electricity-trade account information" -curl localhost:5034/api/v1/bl/electricity-trade/meter/register/ -XPOST \ - -H "Content-Type: application/json" \ - -d '{"businessLogicID":"h40Q9eMD", - "meterParams":[ - "MI000001", - "06fc56347d91c6ad2dae0c3ba38eb12ab0d72e97", - "cb5d48d371916a4ea1627189d8af4f642a5d72746a06b559780c3f5932658207", - "9d624f7995e8bd70251f8265f2f9f2b49f169c55" - ] - }' diff --git a/examples/cactus-example-tcs-huawei/script-post-start-request.sh b/examples/cactus-example-tcs-huawei/script-post-start-request.sh deleted file mode 100644 index 99c084df76..0000000000 --- a/examples/cactus-example-tcs-huawei/script-post-start-request.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020-2022 Hyperledger Cactus Contributors -# SPDX-License-Identifier: Apache-2.0 - -echo "Start electricity-trade" -curl localhost:5034/api/v1/bl/electricity-trade/ -XPOST -H "Content-Type: application/json" -d '{"businessLogicID":"h40Q9eMD"}' diff --git a/examples/cactus-example-tcs-huawei/script-start-ledgers.sh b/examples/cactus-example-tcs-huawei/script-start-ledgers.sh deleted file mode 100644 index e9fb702ae2..0000000000 --- a/examples/cactus-example-tcs-huawei/script-start-ledgers.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020-2022 Hyperledger Cactus Contributors -# SPDX-License-Identifier: Apache-2.0 - -set -e - -ROOT_DIR="../.." # Path to cactus root dir -CONFIG_VOLUME_PATH="./etc/cactus" # Docker volume with shared configuration -WAIT_TIME=10 # How often to check container status - -# Cert options -CERT_CURVE_NAME="prime256v1" -CERT_COUNTRY="JP" -CERT_STATE="Tokyo" -CERT_LOCALITY="Minato-Ku" -CERT_ORG="CactusSamples" - -# generate_certificate -function generate_certificate() { - # Check OpenSSL command existance - if ! openssl version > /dev/null; then - echo "Could not execute [openssl version], check if OpenSSL tool is available on the system." - exit 1; - fi - - # Check input parameters - ARGS_NUMBER=2 - if [ "$#" -lt "$ARGS_NUMBER" ]; then - echo "generate_certificate called with wrong number of arguments (expected - $ARGS_NUMBER, actual - $#)"; - exit 2 - fi - - common_name=$1 - destination=$2 - subject="/C=$CERT_COUNTRY/ST=$CERT_STATE/L=$CERT_LOCALITY/O=$CERT_ORG/CN=$common_name" - echo "Create new cert in '${destination}' with subject '${subject}'" - - # Crete destination path - if [ ! -d "$destination" ]; then - echo "Re-create destination dir..." - rm -rf "$destination" - mkdir -p "$destination" - fi - - keyPath="${destination}/connector.priv" - csrPath="${destination}/connector.csr" - certPath="${destination}/connector.crt" - - # Generate keys - openssl ecparam -genkey -name "$CERT_CURVE_NAME" -out "$keyPath" - openssl req -new -sha256 -key "$keyPath" -out "$csrPath" -subj "$subject" - openssl req -x509 -sha256 -days 365 -key "$keyPath" -in "$csrPath" -out "$certPath" -} - -function start_ethereum_testnet() { - pushd "${ROOT_DIR}/tools/docker/geth-testnet" - ./script-start-docker.sh - popd -} - -function copy_ethereum_validator_config() { - echo ">> copy_ethereum_validator_config()" - cp -fr ${ROOT_DIR}/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/sample-config/* \ - "${CONFIG_VOLUME_PATH}/connector-go-ethereum-socketio/" - generate_certificate "GoEthereumCactusValidator" "${CONFIG_VOLUME_PATH}/connector-go-ethereum-socketio/CA/" - echo ">> copy_ethereum_validator_config() done." -} - -function copy_tcs_config() { - cp -fr ${ROOT_DIR}/packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/sample-config/* \ - "${CONFIG_VOLUME_PATH}/connector-tcs-huawei/" - generate_certificate "TcsCactusValidator" "${CONFIG_VOLUME_PATH}/connector-tcs-huawei/CA/" -} - -function start_tcs_agent(){ - echo ">> start_tcs_agent()" - docker network create tcs_huawei_testnet_1x - pushd ${ROOT_DIR}/tools/docker/tcs-huawei-testnet/agent/example - docker-compose up > tcs-agent.log & - popd - echo ">> start_tcs_agent() done" -} - -function start_ledgers() { - prepare_certificate - - # Clear ./etc/cactus - mkdir -p "${CONFIG_VOLUME_PATH}/" - rm -fr ${CONFIG_VOLUME_PATH}/* - - # Copy cmd-socketio-config - cp -f ./config/*.yaml "${CONFIG_VOLUME_PATH}/" - - # Start Ethereum - mkdir -p "${CONFIG_VOLUME_PATH}/connector-go-ethereum-socketio" - start_ethereum_testnet - copy_ethereum_validator_config - - # Start tcs-agent - mkdir -p "${CONFIG_VOLUME_PATH}/connector-tcs-huawei" - start_tcs_agent - copy_tcs_config - -} - -function prepare_certificate(){ - mkdir Server_Cert - pushd ./Server_Cert - openssl genrsa -out cakey.pem 2048 - openssl req -new -key cakey.pem -out ca.csr -subj "/C=CN/ST=myprovince/L=mycity/O=myorganization/OU=mygroup/CN=myCA" - openssl x509 -req -days 365 -sha1 -extensions v3_ca -signkey cakey.pem -in ca.csr -out cacert.pem - - openssl genrsa -out key.pem 2048 - openssl req -new -key key.pem -out server.csr -subj "/C=CN/ST=myprovince/L=mycity/O=myorganization/OU=mygroup/CN=myServer" - openssl x509 -req -days 365 -sha1 -extensions v3_req -CA ./cacert.pem -CAkey ./cakey.pem -CAserial ca.srl -CAcreateserial -in server.csr -out cert.pem - - openssl genrsa -out clikey.pem 2048 - openssl req -new -key clikey.pem -out client.csr -subj "/C=CN/ST=myprovince/L=mycity/O=myorganization/OU=mygroup/CN=myClient" - openssl x509 -req -days 365 -sha1 -extensions v3_req -CA ./cacert.pem -CAkey ./cakey.pem -CAserial ./ca.srl -in client.csr -out clicert.pem - - openssl x509 -in clicert.pem -out client.crt - openssl rsa -in clikey.pem -out client.key - popd - cp ./Server_Cert/cert.pem ./Server_Cert/key.pem ${ROOT_DIR}/packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/sample-config - mv ./Server_Cert ${ROOT_DIR}/tools/docker/tcs-huawei-testnet/agent/example -} - -start_ledgers - -echo "All Done." diff --git a/examples/cactus-example-tcs-huawei/tools/periodicExecuter/package.json b/examples/cactus-example-tcs-huawei/tools/periodicExecuter/package.json deleted file mode 100644 index 9d079b4dfc..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/periodicExecuter/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "periodicExecuter", - "version": "0.0.1", - "license": "Apache-2.0", - "private": true, - "scripts": { - "build": "npm run build-ts", - "build-ts": "tsc", - "tslint": "tslint -c tslint.json -p tsconfig.json" - }, - "dependencies": { - "@types/node": "18.11.9", - "ts-node": "9.1.1" - }, - "devDependencies": { - "typescript": "5.3.3" - } -} diff --git a/examples/cactus-example-tcs-huawei/tools/periodicExecuter/periodicExecuter.ts b/examples/cactus-example-tcs-huawei/tools/periodicExecuter/periodicExecuter.ts deleted file mode 100644 index 441de7b685..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/periodicExecuter/periodicExecuter.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * periodicExecuter.ts - */ - -import { execSync } from "child_process"; - -console.log("## start periodicExecuter"); - -if (process.argv.length !== 5 && process.argv.length !== 6) { - console.log("Number of parameters is abnormal."); - process.exit(-1); -} - -const keyString = process.argv[3]; -const dockerExecString = "docker exec sawtooth-shell-default "; -const submitCommand = - "sawtooth batch submit -f batches.intkey --url http://rest-api:8008"; - -if (process.argv.length === 6) { - const valueInitial = process.argv[5]; - - const setCommand = - "intkey create_batch --key-name " + - keyString + - " --value-set " + - valueInitial; - console.log(`setCommand : ${setCommand}`); - const stdoutSet = execSync(dockerExecString + setCommand); - console.log(`setCommand stdout: ${stdoutSet.toString()}`); - - console.log(`submitCommand(set) : ${submitCommand}`); - const stdoutSetSubmit = execSync(dockerExecString + submitCommand); - console.log(`submitCommand(set) stdout: ${stdoutSetSubmit.toString()}`); -} diff --git a/examples/cactus-example-tcs-huawei/tools/periodicExecuter/tsconfig.json b/examples/cactus-example-tcs-huawei/tools/periodicExecuter/tsconfig.json deleted file mode 100644 index a19738369b..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/periodicExecuter/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "sourceMap": false, - "declaration": false, - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "target": "ES2017", - "module": "CommonJS", - "typeRoots": [ - "node_modules/@types", - "./typings" - ], - "lib": [ - "es2017", - "dom" - ] - }, - "include": [ - "./*.ts" - ] -} diff --git a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/config/default.js b/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/config/default.js deleted file mode 100644 index 2827d3391c..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/config/default.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * default.js - */ - -module.exports = { - // URL to validator - validatorUrl: "https://localhost:5050", - gethUrl: "http://localhost:8545", - - // forCustomChain - chainName: "geth1", - networkId: 10, - chainId: 10, -}; diff --git a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/copyStaticAssets.ts b/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/copyStaticAssets.ts deleted file mode 100644 index 8aac76aa55..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/copyStaticAssets.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * copyStaticAssets.ts - */ -import * as shell from "shelljs"; -shell.cp("config/default.js", "./dist/config"); diff --git a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/package.json b/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/package.json deleted file mode 100644 index f3ffe970bb..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "transferNumericAsset", - "version": "0.0.0", - "license": "Apache-2.0", - "private": true, - "scripts": { - "build": "npm run build-ts && npm run copy-static-assets", - "build-ts": "tsc", - "tslint": "tslint -c tslint.json -p tsconfig.json", - "copy-static-assets": "ts-node copyStaticAssets.ts" - }, - "dependencies": { - "@types/node": "18.11.9", - "config": "1.31.0", - "ethereumjs-common": "1.5.2", - "ethereumjs-tx": "2.1.2", - "ts-node": "9.1.1", - "web3": "1.7.0", - "socket.io": "4.5.4" - }, - "devDependencies": { - "typescript": "5.3.3" - } -} \ No newline at end of file diff --git a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/transferNumericAsset.ts b/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/transferNumericAsset.ts deleted file mode 100644 index 0f1b9edd0a..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/transferNumericAsset.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2021 Hyperledger Cactus Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * transferNumericAsset.ts - */ - -import { io } from "socket.io-client-fixed-types"; - -{ - // Validator test program.(socket.io client) - const config = require("config"); - - // Specify the server (Validator) of the communication destination - const validatorUrl = config.validatorUrl; - console.log("validatorUrl: " + validatorUrl); - const options = { - rejectUnauthorized: false, // temporary avoidance since self-signed certificates are used - reconnection: false, - timeout: 20000, - }; - const socket = io(validatorUrl, options); - - // ## Request for "transferNumericAsset" - if (process.argv.length !== 5) { - console.log("Number of parameters is abnormal."); - process.exit(-1); - } - const paramAmount: number = parseInt(process.argv[4]); - if (Number.isNaN(paramAmount)) { - console.log(`Third parameter is not numeric. ${process.argv[4]}`); - process.exit(-1); - } - - console.log( - `execution parameter : fromAddress = ${process.argv[2]}, toAddress = ${process.argv[3]}, amount = ${process.argv[4]}`, - ); - - const fromAddress = process.argv[2]; - const toAddress = process.argv[3]; - const amount = paramAmount; - const reqID = "reqID_TNA_001"; - - // function param - const requestData = { - contract: {}, - method: { - type: "web3Eth", - command: "sendTransaction", - }, - args: { - args: [ - { - from: fromAddress, - to: toAddress, - value: amount, - }, - ], - }, - reqID: reqID, - }; - - const json2str = (jsonObj) => { - try { - return JSON.stringify(jsonObj); - } catch (error) { - return null; - } - }; - - socket.on("connect_error", (err) => { - console.log("####connect_error:", err); - // end communication - socket.disconnect(); - process.exit(0); - }); - - socket.on("connect_timeout", (err) => { - console.log("####Error:", err); - // end communication - socket.disconnect(); - process.exit(0); - }); - - socket.on("error", (err) => { - console.log("####Error:", err); - }); - - socket.on("eventReceived", function (res) { - // output the data received from the client - console.log("#[recv]eventReceived, res: " + json2str(res)); - }); - - const requestStopMonitor = () => { - console.log("##exec requestStopMonitor()"); - socket.emit("stopMonitor"); - - setTimeout(function () { - // end communication - socket.disconnect(); - process.exit(0); - }, 5000); - }; - - // request StartMonitor - const requestStartMonitor = () => { - console.log("##exec requestStartMonitor()"); - socket.emit("startMonitor"); - - setTimeout(requestStopMonitor, 15000); - }; - - const sendRequest = () => { - console.log("exec sendRequest()"); - console.log("#[send]requestData: " + json2str(requestData)); - socket.emit("request2", requestData); - }; - - setTimeout(requestStartMonitor, 2000); - setTimeout(sendRequest, 4000); -} diff --git a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/tsconfig.json b/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/tsconfig.json deleted file mode 100644 index b0f7b49357..0000000000 --- a/examples/cactus-example-tcs-huawei/tools/transferNumericAsset/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "sourceMap": false, - "declaration": false, - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "target": "ES2017", - "module": "CommonJS", - "typeRoots": [ - "node_modules/@types", - "./typings" - ], - "lib": [ - "es2017", - "dom" - ] - }, - "include": [ - "./*.ts" - ], - "exclude": [ - "copyStaticAssets.ts" - ] -} diff --git a/examples/cactus-example-tcs-huawei/tsconfig.json b/examples/cactus-example-tcs-huawei/tsconfig.json deleted file mode 100644 index 2fef5f7509..0000000000 --- a/examples/cactus-example-tcs-huawei/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./dist/", - "rootDir": "./", - "tsBuildInfoFile": "../../.build-cache/cactus-example-tcs-huawei.tsbuildinfo", - "strict": false // TODO - true, fix warnings - }, - "include": [ - "./*.ts", - ], - "references": [ - { - "path": "../../packages/cactus-cmd-socketio-server/tsconfig.json" - }, - { - "path": "../../packages/cactus-verifier-client/tsconfig.json" - } - ] -} \ No newline at end of file diff --git a/examples/cactus-example-tcs-huawei/tslint.json b/examples/cactus-example-tcs-huawei/tslint.json deleted file mode 100644 index 9a00b4aa19..0000000000 --- a/examples/cactus-example-tcs-huawei/tslint.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "variable-name": { - "options": [ - "allow-leading-underscore", - "ban-keywords", - "check-format" - ] - }, - "no-string-literal": false, - "no-var-requires": false, - "object-literal-shorthand": false, - "max-classes-per-file": false, - "no-console": false - }, - "rulesDirectory": [], - "linterOptions": { - "exclude": [ - "packages/cactus-sdk/src/main/typescript/generated/**/*.ts", - "packages/cactus-sdk/src/main/typescript/public-api.ts" - ] - } -} diff --git a/examples/cactus-example-tcs-huawei/www.ts b/examples/cactus-example-tcs-huawei/www.ts deleted file mode 100644 index 3c3295767b..0000000000 --- a/examples/cactus-example-tcs-huawei/www.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BusinessLogicElectricityTrade } from "./BusinessLogicTcsElectricityTrade"; -import { startCactusSocketIOServer } from "@hyperledger/cactus-cmd-socketio-server"; - -startCactusSocketIOServer({ - id: "h40Q9eMD", - plugin: new BusinessLogicElectricityTrade("h40Q9eMD"), -}); diff --git a/tsconfig.json b/tsconfig.json index 3bef46b01f..4b178b2b13 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -151,9 +151,6 @@ { "path": "./examples/cactus-example-supply-chain-frontend/tsconfig.json" }, - { - "path": "./examples/cactus-example-tcs-huawei/tsconfig.json" - }, { "path": "./packages/cactus-plugin-satp-hermes/tsconfig.json" }, diff --git a/yarn.lock b/yarn.lock index dadb5758d3..6e50cf81a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8186,42 +8186,6 @@ __metadata: languageName: unknown linkType: soft -"@hyperledger/cactus-example-tcs-huawei@workspace:examples/cactus-example-tcs-huawei": - version: 0.0.0-use.local - resolution: "@hyperledger/cactus-example-tcs-huawei@workspace:examples/cactus-example-tcs-huawei" - dependencies: - "@hyperledger/cactus-cmd-socketio-server": "npm:2.0.0-rc.1" - "@hyperledger/cactus-core-api": "npm:2.0.0-rc.1" - "@hyperledger/cactus-verifier-client": "npm:2.0.0-rc.1" - "@types/body-parser": "npm:1.19.3" - "@types/cookie-parser": "npm:1.4.2" - "@types/escape-html": "npm:1.0.1" - "@types/express": "npm:4.17.21" - "@types/node": "npm:18.11.9" - "@types/uuid": "npm:9.0.8" - body-parser: "npm:1.20.2" - cookie-parser: "npm:1.4.6" - debug: "npm:2.6.9" - escape-html: "npm:1.0.3" - ethereumjs-common: "npm:1.5.2" - ethereumjs-tx: "npm:2.1.2" - express: "npm:4.19.2" - fabric-ca-client: "npm:2.2.20" - fabric-network: "npm:2.2.20" - http-errors: "npm:1.6.3" - js-yaml: "npm:3.14.1" - jsonwebtoken: "npm:8.5.1" - log4js: "npm:6.4.0" - morgan: "npm:1.9.1" - shelljs: "npm:0.8.5" - socket.io: "npm:4.5.4" - ts-node: "npm:8.9.1" - uuid: "npm:9.0.1" - web3: "npm:1.7.0" - xmlhttprequest: "npm:1.8.0" - languageName: unknown - linkType: soft - "@hyperledger/cactus-plugin-bungee-hermes@workspace:packages/cactus-plugin-bungee-hermes": version: 0.0.0-use.local resolution: "@hyperledger/cactus-plugin-bungee-hermes@workspace:packages/cactus-plugin-bungee-hermes" @@ -14624,15 +14588,6 @@ __metadata: languageName: node linkType: hard -"@types/cookie-parser@npm:1.4.2": - version: 1.4.2 - resolution: "@types/cookie-parser@npm:1.4.2" - dependencies: - "@types/express": "npm:*" - checksum: 10/110ab558beb59f772ca43aa7257a3595536e71e08891810f7db88cc2e58b3c2b552c970e3e0806d787642923ff1d5b7717650257febcdfc632c8b5d6e2d301a0 - languageName: node - linkType: hard - "@types/cookie-parser@npm:1.4.5": version: 1.4.5 resolution: "@types/cookie-parser@npm:1.4.5" @@ -50281,17 +50236,6 @@ __metadata: languageName: node linkType: hard -"web3-bzz@npm:1.7.0": - version: 1.7.0 - resolution: "web3-bzz@npm:1.7.0" - dependencies: - "@types/node": "npm:^12.12.6" - got: "npm:9.6.0" - swarm-js: "npm:^0.1.40" - checksum: 10/98a93635c27581806132535c107ca2c8aee2dfd6e107915cc515da8807bfdf3b4b0ed4d48e53417511e363fe3ecc8a6d400501f5d51467cba4f9325f35289f56 - languageName: node - linkType: hard - "web3-bzz@npm:1.7.3": version: 1.7.3 resolution: "web3-bzz@npm:1.7.3" @@ -50344,16 +50288,6 @@ __metadata: languageName: node linkType: hard -"web3-core-helpers@npm:1.7.0": - version: 1.7.0 - resolution: "web3-core-helpers@npm:1.7.0" - dependencies: - web3-eth-iban: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/70008fc2cccb207502f4fc6491c1635c4121aecfde23a21996718919ab2c189708c40f48b6effc87f7527da752749247bcd0eab7362a23f20dff1032c314d781 - languageName: node - linkType: hard - "web3-core-helpers@npm:1.7.3": version: 1.7.3 resolution: "web3-core-helpers@npm:1.7.3" @@ -50413,19 +50347,6 @@ __metadata: languageName: node linkType: hard -"web3-core-method@npm:1.7.0": - version: 1.7.0 - resolution: "web3-core-method@npm:1.7.0" - dependencies: - "@ethersproject/transactions": "npm:^5.0.0-beta.135" - web3-core-helpers: "npm:1.7.0" - web3-core-promievent: "npm:1.7.0" - web3-core-subscriptions: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/f6290cd1de1aa733058a7e15aa42a16d9f827e18f02a7a2c5fb3172b13ecf9df3b694248e6c36064f384788f2942fe3a9fc57320bb78071d7c7170de67645200 - languageName: node - linkType: hard - "web3-core-method@npm:1.7.3": version: 1.7.3 resolution: "web3-core-method@npm:1.7.3" @@ -50479,15 +50400,6 @@ __metadata: languageName: node linkType: hard -"web3-core-promievent@npm:1.7.0": - version: 1.7.0 - resolution: "web3-core-promievent@npm:1.7.0" - dependencies: - eventemitter3: "npm:4.0.4" - checksum: 10/93774b2b954b7b60cd60ebd3bc299cfef1080c5460ddad7c0ed3ca9262ecce374253202500a63eb27a83323c0d0b7275ca7ceaa76a9c560652d0bc5fb34173ff - languageName: node - linkType: hard - "web3-core-promievent@npm:1.7.3": version: 1.7.3 resolution: "web3-core-promievent@npm:1.7.3" @@ -50545,19 +50457,6 @@ __metadata: languageName: node linkType: hard -"web3-core-requestmanager@npm:1.7.0": - version: 1.7.0 - resolution: "web3-core-requestmanager@npm:1.7.0" - dependencies: - util: "npm:^0.12.0" - web3-core-helpers: "npm:1.7.0" - web3-providers-http: "npm:1.7.0" - web3-providers-ipc: "npm:1.7.0" - web3-providers-ws: "npm:1.7.0" - checksum: 10/59fe839ce6dac40f88d2740c94bc7c05905c3f3ac12146bbae910ff6e88fb780adaa5e71c1d4f1a2838c9576df074c7e1bdc91f060b2782859a6d12c5daa3dec - languageName: node - linkType: hard - "web3-core-requestmanager@npm:1.7.3": version: 1.7.3 resolution: "web3-core-requestmanager@npm:1.7.3" @@ -50614,16 +50513,6 @@ __metadata: languageName: node linkType: hard -"web3-core-subscriptions@npm:1.7.0": - version: 1.7.0 - resolution: "web3-core-subscriptions@npm:1.7.0" - dependencies: - eventemitter3: "npm:4.0.4" - web3-core-helpers: "npm:1.7.0" - checksum: 10/465d7e6d13831dbd55fce37c77174357656ade01754fd24d5a528ace005e1ed5af06772cc72601567438d39a82f52e70774db8722afdced8e6d6c6d7230409ab - languageName: node - linkType: hard - "web3-core-subscriptions@npm:1.7.3": version: 1.7.3 resolution: "web3-core-subscriptions@npm:1.7.3" @@ -50689,21 +50578,6 @@ __metadata: languageName: node linkType: hard -"web3-core@npm:1.7.0": - version: 1.7.0 - resolution: "web3-core@npm:1.7.0" - dependencies: - "@types/bn.js": "npm:^4.11.5" - "@types/node": "npm:^12.12.6" - bignumber.js: "npm:^9.0.0" - web3-core-helpers: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-core-requestmanager: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/1a4ef5b0ba217f2896d9b6e0f66c97058f9f6abda638d426f90b2432b54afee9de8db862c280896b9c45bfa8c2be1f5ecf3198f33ba68d22bffb13ab2a46d14e - languageName: node - linkType: hard - "web3-core@npm:1.7.3": version: 1.7.3 resolution: "web3-core@npm:1.7.3" @@ -50876,16 +50750,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-abi@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth-abi@npm:1.7.0" - dependencies: - "@ethersproject/abi": "npm:5.0.7" - web3-utils: "npm:1.7.0" - checksum: 10/02aab1fe25fcdbb66b82297e4957605b36214fa66cebaf2e31207c4ea62b43cf3ffa15e9b8e900d3ff74c84cf2455eaaef3d516b2665c57264acead1fb099a4b - languageName: node - linkType: hard - "web3-eth-abi@npm:1.7.3": version: 1.7.3 resolution: "web3-eth-abi@npm:1.7.3" @@ -51026,25 +50890,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-accounts@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth-accounts@npm:1.7.0" - dependencies: - "@ethereumjs/common": "npm:^2.5.0" - "@ethereumjs/tx": "npm:^3.3.2" - crypto-browserify: "npm:3.12.0" - eth-lib: "npm:0.2.8" - ethereumjs-util: "npm:^7.0.10" - scrypt-js: "npm:^3.0.1" - uuid: "npm:3.3.2" - web3-core: "npm:1.7.0" - web3-core-helpers: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/b67ca7982546dc252a08d87c573f6d3390e8776b886e1f33d98dfe31d971a0f86bb6bf924528d851e2a11584847d1707574f46a663ed3a5ff6f133fc07343e9f - languageName: node - linkType: hard - "web3-eth-accounts@npm:1.7.3": version: 1.7.3 resolution: "web3-eth-accounts@npm:1.7.3" @@ -51191,22 +51036,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-contract@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth-contract@npm:1.7.0" - dependencies: - "@types/bn.js": "npm:^4.11.5" - web3-core: "npm:1.7.0" - web3-core-helpers: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-core-promievent: "npm:1.7.0" - web3-core-subscriptions: "npm:1.7.0" - web3-eth-abi: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/7e0864f2fd8ecda47a9623e7da5bea1fa7a0648c3750fe6bb26eead72f0e980f07ee7727b0018ce9d43bf32ea0bc15bae0c23978d697ef8846b36aa6763a0deb - languageName: node - linkType: hard - "web3-eth-contract@npm:1.7.3": version: 1.7.3 resolution: "web3-eth-contract@npm:1.7.3" @@ -51332,22 +51161,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-ens@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth-ens@npm:1.7.0" - dependencies: - content-hash: "npm:^2.5.2" - eth-ens-namehash: "npm:2.0.8" - web3-core: "npm:1.7.0" - web3-core-helpers: "npm:1.7.0" - web3-core-promievent: "npm:1.7.0" - web3-eth-abi: "npm:1.7.0" - web3-eth-contract: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/79ab22acfd37d92faa42817e69b386a6c1453ecadd58340753f91ab49b1cc92b6cf912ae9c9045d0e9d134671e3b6cd04551d5c8953584f8c6f37bc3f2d83f53 - languageName: node - linkType: hard - "web3-eth-ens@npm:1.7.3": version: 1.7.3 resolution: "web3-eth-ens@npm:1.7.3" @@ -51444,16 +51257,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-iban@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth-iban@npm:1.7.0" - dependencies: - bn.js: "npm:^4.11.9" - web3-utils: "npm:1.7.0" - checksum: 10/26d141d4da56b1ae3f506c19b9c3206609430176d367088fdf8f01af57ff71532cf6341fa0ac2de7f7d0825f7e07b830457ad54f49e82c2a4d625b0d87f869fa - languageName: node - linkType: hard - "web3-eth-iban@npm:1.7.3": version: 1.7.3 resolution: "web3-eth-iban@npm:1.7.3" @@ -51540,20 +51343,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-personal@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth-personal@npm:1.7.0" - dependencies: - "@types/node": "npm:^12.12.6" - web3-core: "npm:1.7.0" - web3-core-helpers: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-net: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/973134071fd7ec8dc509b5a187d506d3381a7e18438e9dd824b13686617ec58a21145336aa0511c12c3405a576c260ce45777a9b7661f9fa440949accf1e8d73 - languageName: node - linkType: hard - "web3-eth-personal@npm:1.7.3": version: 1.7.3 resolution: "web3-eth-personal@npm:1.7.3" @@ -51670,26 +51459,6 @@ __metadata: languageName: node linkType: hard -"web3-eth@npm:1.7.0": - version: 1.7.0 - resolution: "web3-eth@npm:1.7.0" - dependencies: - web3-core: "npm:1.7.0" - web3-core-helpers: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-core-subscriptions: "npm:1.7.0" - web3-eth-abi: "npm:1.7.0" - web3-eth-accounts: "npm:1.7.0" - web3-eth-contract: "npm:1.7.0" - web3-eth-ens: "npm:1.7.0" - web3-eth-iban: "npm:1.7.0" - web3-eth-personal: "npm:1.7.0" - web3-net: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/9a6c50c9f69fe3d8a7d8512a3c53c5ec6f6a7cc00173c575f7483f94c26e06f3bcceb3eb31fa18b6ba3326a92d18b17de206e9a8eee19bffb98fb2e7e90a5a5c - languageName: node - linkType: hard - "web3-eth@npm:1.7.3": version: 1.7.3 resolution: "web3-eth@npm:1.7.3" @@ -51820,17 +51589,6 @@ __metadata: languageName: node linkType: hard -"web3-net@npm:1.7.0": - version: 1.7.0 - resolution: "web3-net@npm:1.7.0" - dependencies: - web3-core: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/896d54ed14e211c64c8a67081a479068bbac427196a8f1d7f5f12960ef404438aff9739c8d0860316dc5e7c98d55910cdfc6bedc38464cb986e845fa97176f15 - languageName: node - linkType: hard - "web3-net@npm:1.7.3": version: 1.7.3 resolution: "web3-net@npm:1.7.3" @@ -51911,16 +51669,6 @@ __metadata: languageName: node linkType: hard -"web3-providers-http@npm:1.7.0": - version: 1.7.0 - resolution: "web3-providers-http@npm:1.7.0" - dependencies: - web3-core-helpers: "npm:1.7.0" - xhr2-cookies: "npm:1.1.0" - checksum: 10/38a07de53743ee8007725cbe10e6b972b5adb4058428237fa972b672490476d1244035599a61be8b4fd1e586fda30f149324efd65bee8309921274c4e0a3d2d7 - languageName: node - linkType: hard - "web3-providers-http@npm:1.7.3": version: 1.7.3 resolution: "web3-providers-http@npm:1.7.3" @@ -51997,16 +51745,6 @@ __metadata: languageName: node linkType: hard -"web3-providers-ipc@npm:1.7.0": - version: 1.7.0 - resolution: "web3-providers-ipc@npm:1.7.0" - dependencies: - oboe: "npm:2.1.5" - web3-core-helpers: "npm:1.7.0" - checksum: 10/8587803ca244098e194bb5c2dff064a3fa57ffc8893298135346e502036b8d7c2cafc190c41187798eddbecb8843f4c7992ad68799eb8a57aef5f5b391dd165a - languageName: node - linkType: hard - "web3-providers-ipc@npm:1.7.3": version: 1.7.3 resolution: "web3-providers-ipc@npm:1.7.3" @@ -52082,17 +51820,6 @@ __metadata: languageName: node linkType: hard -"web3-providers-ws@npm:1.7.0": - version: 1.7.0 - resolution: "web3-providers-ws@npm:1.7.0" - dependencies: - eventemitter3: "npm:4.0.4" - web3-core-helpers: "npm:1.7.0" - websocket: "npm:^1.0.32" - checksum: 10/1e560cfd8c4a27d13c4b6d8c3e01f6cbc29d8659d7e5f8c1ad1d0437b0a7ef7f6acdcaeb458b60c7b149c91ca9958d577b710cb44116fbc9eda710b58f48ce04 - languageName: node - linkType: hard - "web3-providers-ws@npm:1.7.3": version: 1.7.3 resolution: "web3-providers-ws@npm:1.7.3" @@ -52212,18 +51939,6 @@ __metadata: languageName: node linkType: hard -"web3-shh@npm:1.7.0": - version: 1.7.0 - resolution: "web3-shh@npm:1.7.0" - dependencies: - web3-core: "npm:1.7.0" - web3-core-method: "npm:1.7.0" - web3-core-subscriptions: "npm:1.7.0" - web3-net: "npm:1.7.0" - checksum: 10/69daeebe5413061ba92fe4ab3d8ca6cb7b132ebef6c47e29248af28f66c5387eb622a9701a95e0edd408aed61f73d8ec8fd1ef22af818e9f522425ac956f0f80 - languageName: node - linkType: hard - "web3-shh@npm:1.7.3": version: 1.7.3 resolution: "web3-shh@npm:1.7.3" @@ -52343,21 +52058,6 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:1.7.0": - version: 1.7.0 - resolution: "web3-utils@npm:1.7.0" - dependencies: - bn.js: "npm:^4.11.9" - ethereum-bloom-filters: "npm:^1.0.6" - ethereumjs-util: "npm:^7.1.0" - ethjs-unit: "npm:0.1.6" - number-to-bn: "npm:1.7.0" - randombytes: "npm:^2.1.0" - utf8: "npm:3.0.0" - checksum: 10/05d2091630a9bcf4e7e90cfabf46e62d47546511abaecc271f1cb442d42ba91232a6d41813f245544821214fca41c92d34635370ad00f744281305427dc68576 - languageName: node - linkType: hard - "web3-utils@npm:1.7.3": version: 1.7.3 resolution: "web3-utils@npm:1.7.3" @@ -52551,21 +52251,6 @@ __metadata: languageName: node linkType: hard -"web3@npm:1.7.0": - version: 1.7.0 - resolution: "web3@npm:1.7.0" - dependencies: - web3-bzz: "npm:1.7.0" - web3-core: "npm:1.7.0" - web3-eth: "npm:1.7.0" - web3-eth-personal: "npm:1.7.0" - web3-net: "npm:1.7.0" - web3-shh: "npm:1.7.0" - web3-utils: "npm:1.7.0" - checksum: 10/6b66909a0910e2040656c39ec741f213647a61144a6b62dc527ac46a33ac176e131f774b27ffcf1811ac105fea08607f1ee1e7d0769a90e96bdf8bf5ef670faf - languageName: node - linkType: hard - "web3@npm:1.7.3": version: 1.7.3 resolution: "web3@npm:1.7.3"