Skip to content

Commit

Permalink
build(deps): upgrade to [email protected], [email protected]
Browse files Browse the repository at this point in the history
Also upgraded the ESLint related packages such as the typescript parser
plugin and all the other plugins or configuration management packages
related to ESLint in general.

The reason why it's important that we keep up to date with ESLint is
because newer versions of Typescript are not getting backported to older
versions of ESLint fast enough (if at all) so to be able to reliably
lint our newer Typescript code, we need to keep up to date with ESLint
as well.

In addition to the dependency upgrades we are also applying the automatic
formatter's changes that it started making after the upgrade.

To-do for later: Consolidate the ESLint versions used among the different
components of the project because right now we still have a few packages
that declare much older versions of ESLint such as 3.x and 4.x.

Depends on hyperledger-cacti#3052 because that pull request also applies some of the
automatic formatting changes that were forgotten in an earlier pull request.

Signed-off-by: Peter Somogyvari <[email protected]>
  • Loading branch information
petermetz committed Mar 10, 2024
1 parent 1fb18d2 commit fb3fb72
Show file tree
Hide file tree
Showing 6 changed files with 835 additions and 214 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
"@types/tape-promise": "4.0.1",
"@types/uuid": "9.0.8",
"@types/yargs": "17.0.24",
"@typescript-eslint/eslint-plugin": "6.4.0",
"@typescript-eslint/parser": "6.4.0",
"@typescript-eslint/eslint-plugin": "7.1.0",
"@typescript-eslint/parser": "7.1.0",
"adm-zip": "0.5.10",
"benchmark": "2.1.4",
"buffer": "6.0.3",
Expand All @@ -138,13 +138,13 @@
"del-cli": "4.0.1",
"depcheck": "1.4.7",
"es-main": "1.2.0",
"eslint": "7.32.0",
"eslint-config-prettier": "8.10.0",
"eslint-config-standard": "16.0.3",
"eslint-plugin-import": "2.28.1",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-standard": "5.0.0",
"fast-safe-stringify": "2.1.1",
"fs-extra": "10.1.0",
Expand All @@ -164,7 +164,7 @@
"npm-run-all": "4.1.5",
"npm-watch": "0.11.0",
"openapi-types": "12.1.3",
"prettier": "3.0.3",
"prettier": "3.2.5",
"protoc-gen-ts": "0.8.7",
"run-time-error": "1.4.0",
"run-time-error-cjs": "1.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ try {
delete data["services"]["peer0.org3.example.com"];

// l.33: container port
data["services"][orgName][
"environment"
][1] = `CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb4:${containerPort}`;
data["services"][orgName]["environment"][1] =
`CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb4:${containerPort}`;

//console.log("After modification");
//console.log(util.inspect(data, true, 10, true));
Expand Down Expand Up @@ -95,58 +94,48 @@ try {
data["services"][orgName]["environment"][8] = `CORE_PEER_ID=${orgName}`;

// CORE_PEER_ADDRESS=peer0.org3.example.com:11051
data["services"][orgName][
"environment"
][9] = `CORE_PEER_ADDRESS=${orgName}:${hostPort}`;
data["services"][orgName]["environment"][9] =
`CORE_PEER_ADDRESS=${orgName}:${hostPort}`;

// CORE_PEER_LISTENADDRESS=0.0.0.0:11051
data["services"][orgName][
"environment"
][10] = `CORE_PEER_LISTENADDRESS=0.0.0.0:${hostPort}`;
data["services"][orgName]["environment"][10] =
`CORE_PEER_LISTENADDRESS=0.0.0.0:${hostPort}`;

// - CORE_PEER_CHAINCODEADDRESS=peer0.org3.example.com:11052
const chaincodePort = parseInt(hostPort) + 1;
data["services"][orgName][
"environment"
][11] = `CORE_PEER_CHAINCODEADDRESS=${orgName}:${chaincodePort}`;
data["services"][orgName]["environment"][11] =
`CORE_PEER_CHAINCODEADDRESS=${orgName}:${chaincodePort}`;

// CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052
data["services"][orgName][
"environment"
][12] = `CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:${chaincodePort}`;
data["services"][orgName]["environment"][12] =
`CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:${chaincodePort}`;

// - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:11051
data["services"][orgName][
"environment"
][13] = `CORE_PEER_GOSSIP_BOOTSTRAP=${orgName}:${hostPort}`;
data["services"][orgName]["environment"][13] =
`CORE_PEER_GOSSIP_BOOTSTRAP=${orgName}:${hostPort}`;

// - - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:11051

data["services"][orgName][
"environment"
][14] = `CORE_PEER_GOSSIP_EXTERNALENDPOINT=${orgName}:${hostPort}`;
data["services"][orgName]["environment"][14] =
`CORE_PEER_GOSSIP_EXTERNALENDPOINT=${orgName}:${hostPort}`;

// - CORE_PEER_LOCALMSPID=Org3MSP

data["services"][orgName][
"environment"
][15] = `CORE_PEER_LOCALMSPID=${mspId}`;
data["services"][orgName]["environment"][15] =
`CORE_PEER_LOCALMSPID=${mspId}`;

/// Volumes
// - ../../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/etc/hyperledger/fabric/msp
data["services"][orgName][
"volumes"
][1] = `../../organizations/peerOrganizations/${orgName}/peers/${orgName}/msp:/etc/hyperledger/fabric/msp`;
data["services"][orgName]["volumes"][1] =
`../../organizations/peerOrganizations/${orgName}/peers/${orgName}/msp:/etc/hyperledger/fabric/msp`;

// - ../../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls
data["services"][orgName][
"volumes"
][2] = `../../organizations/peerOrganizations/${orgName}/peers/${orgName}/tls:/etc/hyperledger/fabric/tls`;
data["services"][orgName]["volumes"][2] =
`../../organizations/peerOrganizations/${orgName}/peers/${orgName}/tls:/etc/hyperledger/fabric/tls`;

// - peer0.org3.example.com:/var/hyperledger/production
data["services"][orgName][
"volumes"
][3] = `${orgName}:/var/hyperledger/production`;
data["services"][orgName]["volumes"][3] =
`${orgName}:/var/hyperledger/production`;

data["services"][orgName]["ports"] = `${hostPort}:${hostPort}`;

Expand Down Expand Up @@ -177,21 +166,18 @@ try {
delete data["services"]["ca_org3"];

// - FABRIC_CA_SERVER_CA_NAME=ca-org3
data["services"][caName][
"environment"
][1] = `FABRIC_CA_SERVER_CA_NAME=${caName}`;
data["services"][caName]["environment"][1] =
`FABRIC_CA_SERVER_CA_NAME=${caName}`;

// - FABRIC_CA_SERVER_PORT=11054
data["services"][caName][
"environment"
][3] = `FABRIC_CA_SERVER_PORT=${hostPort}`;
data["services"][caName]["environment"][3] =
`FABRIC_CA_SERVER_PORT=${hostPort}`;

// - "11054:11054"
data["services"][caName]["ports"] = `${hostPort}:${hostPort}`;

data["services"][caName][
"volumes"
] = `../fabric-ca/${orgName}:/etc/hyperledger/fabric-ca-server`;
data["services"][caName]["volumes"] =
`../fabric-ca/${orgName}:/etc/hyperledger/fabric-ca-server`;

data["services"][caName]["container_name"] = caName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ export class IrohaV2TestEnv {

if (this.socketioServer) {
this.log.info("Stop the SocketIO server connector...");
await new Promise<void>(
(resolve) => this.socketioServer?.close(() => resolve()),
await new Promise<void>((resolve) =>
this.socketioServer?.close(() => resolve()),
);
}

if (this.connectorServer) {
this.log.info("Stop the iroha2 connector...");
await new Promise<void>(
(resolve) => this.connectorServer?.close(() => resolve()),
await new Promise<void>((resolve) =>
this.connectorServer?.close(() => resolve()),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,18 +686,16 @@ export class FabricTestLedgerV1 implements ITestLedger {

dataCouch["networks"]["test"]["name"] = networkName;

dataCouch["services"][couchDbName][
"container_name"
] = `couchdb${orgName}`;
dataCouch["services"][couchDbName]["container_name"] =
`couchdb${orgName}`;
dataCouch["services"][couchDbName]["ports"] = [`${port}:5984`];

// services: orgX.example.com:
dataCouch["services"][peer0OrgName] =
dataCouch["services"]["peer0.org3.example.com"];

dataCouch["services"][peer0OrgName][
"environment"
][1] = `CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=${couchDbName}:5984`;
dataCouch["services"][peer0OrgName]["environment"][1] =
`CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=${couchDbName}:5984`;

dataCouch["services"][peer0OrgName]["depends_on"] = [couchDbName];

Expand Down Expand Up @@ -756,52 +754,43 @@ export class FabricTestLedgerV1 implements ITestLedger {

// - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=cactusfabrictestnetwork_test

dataCompose["services"][peer0OrgName][
"environment"
][1] = `CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${networkName}`;
dataCompose["services"][peer0OrgName]["environment"][1] =
`CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${networkName}`;

// CORE_PEER_ID=peer0.org3.example.com
dataCompose["services"][peer0OrgName][
"environment"
][8] = `CORE_PEER_ID=${peer0OrgName}`;
dataCompose["services"][peer0OrgName]["environment"][8] =
`CORE_PEER_ID=${peer0OrgName}`;

// CORE_PEER_ADDRESS=peer0.org3.example.com:11051
dataCompose["services"][peer0OrgName][
"environment"
][9] = `CORE_PEER_ADDRESS=${peer0OrgName}:${port}`;
dataCompose["services"][peer0OrgName]["environment"][9] =
`CORE_PEER_ADDRESS=${peer0OrgName}:${port}`;

// CORE_PEER_LISTENADDRESS=0.0.0.0:11051
dataCompose["services"][peer0OrgName][
"environment"
][10] = `CORE_PEER_LISTENADDRESS=0.0.0.0:${port}`;
dataCompose["services"][peer0OrgName]["environment"][10] =
`CORE_PEER_LISTENADDRESS=0.0.0.0:${port}`;

// - CORE_PEER_CHAINCODEADDRESS=peer0.org3.example.com:11052
const chaincodePort = parseInt(port) + 1;
dataCompose["services"][peer0OrgName][
"environment"
][11] = `CORE_PEER_CHAINCODEADDRESS=${peer0OrgName}:${chaincodePort}`;
dataCompose["services"][peer0OrgName]["environment"][11] =
`CORE_PEER_CHAINCODEADDRESS=${peer0OrgName}:${chaincodePort}`;

// CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052
dataCompose["services"][peer0OrgName][
"environment"
][12] = `CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:${chaincodePort}`;
dataCompose["services"][peer0OrgName]["environment"][12] =
`CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:${chaincodePort}`;

// - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:11051
dataCompose["services"][peer0OrgName][
"environment"
][13] = `CORE_PEER_GOSSIP_BOOTSTRAP=${peer0OrgName}:${port}`;
dataCompose["services"][peer0OrgName]["environment"][13] =
`CORE_PEER_GOSSIP_BOOTSTRAP=${peer0OrgName}:${port}`;

// - - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:11051

dataCompose["services"][peer0OrgName][
"environment"
][14] = `CORE_PEER_GOSSIP_EXTERNALENDPOINT=${peer0OrgName}:${port}`;
dataCompose["services"][peer0OrgName]["environment"][14] =
`CORE_PEER_GOSSIP_EXTERNALENDPOINT=${peer0OrgName}:${port}`;

// - CORE_PEER_LOCALMSPID=Org3MSP

dataCompose["services"][peer0OrgName][
"environment"
][15] = `CORE_PEER_LOCALMSPID=${mspId}`;
dataCompose["services"][peer0OrgName]["environment"][15] =
`CORE_PEER_LOCALMSPID=${mspId}`;

/*
dataCompose["services"][peer0OrgName][
Expand All @@ -812,19 +801,16 @@ export class FabricTestLedgerV1 implements ITestLedger {

/// Volumes
// - ../../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/etc/hyperledger/fabric/msp
dataCompose["services"][peer0OrgName][
"volumes"
][1] = `/add-org-${orgName}/organizations/peerOrganizations/${orgName}.example.com/peers/peer0.${orgName}.example.com/msp:/etc/hyperledger/fabric/msp`;
dataCompose["services"][peer0OrgName]["volumes"][1] =
`/add-org-${orgName}/organizations/peerOrganizations/${orgName}.example.com/peers/peer0.${orgName}.example.com/msp:/etc/hyperledger/fabric/msp`;

// - ../../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls
dataCompose["services"][peer0OrgName][
"volumes"
][2] = `/add-org-${orgName}/organizations/peerOrganizations/${orgName}.example.com/peers/peer0.${orgName}.example.com/tls:/etc/hyperledger/fabric/tls`;
dataCompose["services"][peer0OrgName]["volumes"][2] =
`/add-org-${orgName}/organizations/peerOrganizations/${orgName}.example.com/peers/peer0.${orgName}.example.com/tls:/etc/hyperledger/fabric/tls`;

// - peer0.org3.example.com:/var/hyperledger/production
dataCompose["services"][peer0OrgName][
"volumes"
][3] = `${peer0OrgName}:/var/hyperledger/production`;
dataCompose["services"][peer0OrgName]["volumes"][3] =
`${peer0OrgName}:/var/hyperledger/production`;

dataCompose["services"][peer0OrgName]["ports"] = [`${port}:${port}`];

Expand Down Expand Up @@ -870,14 +856,12 @@ export class FabricTestLedgerV1 implements ITestLedger {
delete dataCa["services"]["ca_org3"];

// - FABRIC_CA_SERVER_CA_NAME=ca-org3
dataCa["services"][caName][
"environment"
][1] = `FABRIC_CA_SERVER_CA_NAME=${caName}`;
dataCa["services"][caName]["environment"][1] =
`FABRIC_CA_SERVER_CA_NAME=${caName}`;

// - FABRIC_CA_SERVER_PORT=11054
dataCa["services"][caName][
"environment"
][3] = `FABRIC_CA_SERVER_PORT=${port}`;
dataCa["services"][caName]["environment"][3] =
`FABRIC_CA_SERVER_PORT=${port}`;

// - "11054:11054"
dataCa["services"][caName]["ports"] = [`${port}:${port}`];
Expand Down Expand Up @@ -960,19 +944,15 @@ export class FabricTestLedgerV1 implements ITestLedger {
//dataConfigTxGen["Organizations"][orgName] = dataConfigTxGen["Organizations"];
dataConfigTxGen["Organizations"][0]["Name"] = mspId;
dataConfigTxGen["Organizations"][0]["ID"] = mspId;
dataConfigTxGen["Organizations"][0][
"MSPDir"
] = `organizations/peerOrganizations/${orgName}.example.com/msp`;
dataConfigTxGen["Organizations"][0]["Policies"]["Readers"][
"Rule"
] = `OR('${mspId}.admin','${mspId}.peer','${mspId}.client')`;

dataConfigTxGen["Organizations"][0]["Policies"]["Writers"][
"Rule"
] = `OR('${mspId}.admin','${mspId}.client')`;
dataConfigTxGen["Organizations"][0]["Policies"]["Admins"][
"Rule"
] = `OR('${mspId}.admin')`;
dataConfigTxGen["Organizations"][0]["MSPDir"] =
`organizations/peerOrganizations/${orgName}.example.com/msp`;
dataConfigTxGen["Organizations"][0]["Policies"]["Readers"]["Rule"] =
`OR('${mspId}.admin','${mspId}.peer','${mspId}.client')`;

dataConfigTxGen["Organizations"][0]["Policies"]["Writers"]["Rule"] =
`OR('${mspId}.admin','${mspId}.client')`;
dataConfigTxGen["Organizations"][0]["Policies"]["Admins"]["Rule"] =
`OR('${mspId}.admin')`;
dataConfigTxGen["Organizations"][0]["Policies"]["Endorsement"][
"Rule"
] = `OR('${mspId}.peer')`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export {
/**
* Utility type for retrieving monitoring event / new block type from generic ISocketApiClient interface.
*/
type BlockTypeFromSocketApi<T> = T extends ISocketApiClient<infer U>
? U
: never;
type BlockTypeFromSocketApi<T> =
T extends ISocketApiClient<infer U> ? U : never;

/**
* Extends ledger connector ApiClient with additional monitoring methods (using callbacks, instead of reactive).
Expand Down
Loading

0 comments on commit fb3fb72

Please sign in to comment.