performancewebsockethyperledgercaliper

Hyperledger Caliper - How to close WebSocket connection


How can I close the WebSocket connection opened by Hyperledger Caliper?

My config.json looks like this

{
    "caliper": {
        "blockchain": "ethereum"
    },
    "ethereum": {
        "url": "ws://<ws_url>",
        "nonceManager": "managed",
.......
}

It appears that each worker opens a WebSocket connection and doesn't close it even after successful execution of the test.


Solution

  • I found the solution.

    In my Mint class that extends the WorkloadModuleBase class, I did override the following function

        async cleanupWorkloadModule() {
            this.sutAdapter.web3.currentProvider.connection._connection.close();
        }