Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WS support for 0.3.1 #12

Open
chinmay241 opened this issue Jun 9, 2020 · 3 comments
Open

WS support for 0.3.1 #12

chinmay241 opened this issue Jun 9, 2020 · 3 comments

Comments

@chinmay241
Copy link

Tested in both these environment:

  1. If the Geth+Caliper both come up together
    Errors:
:~/caliper-benchmarks$ npx caliper launch master     --caliper-workspace .     --caliper-benchconfig benchmarks/scenario/simple/config.yaml     --caliper-networkconfig networks/ethereum/1node/ethereum.json
2020.06.09-08:56:55.571 info  [caliper] [cli-launch-master]     Set workspace path: /home/brl/caliper-benchmarks
2020.06.09-08:56:55.572 info  [caliper] [cli-launch-master]     Set benchmark configuration path: /home/brl/caliper-benchmarks/benchmarks/scenario/simple/config.yaml
2020.06.09-08:56:55.572 info  [caliper] [cli-launch-master]     Set network configuration path: /home/brl/caliper-benchmarks/networks/ethereum/1node/ethereum.json
2020.06.09-08:56:55.573 info  [caliper] [cli-launch-master]     Set SUT type: ethereum
2020.06.09-08:56:55.866 info  [caliper] [benchmark-validator]   No observer specified, will default to `none`
2020.06.09-08:56:55.866 info  [caliper] [caliper-engine]        Starting benchmark flow
2020.06.09-08:56:55.894 info  [caliper] [caliper-utils]         Executing command: cd .; docker-compose -f networks/ethereum/1node/docker-compose.yml up -d && sleep 20
Creating network "1node_default" with the default driver
Creating ethereum ... done
2020.06.09-08:57:17.214 info  [caliper] [caliper-engine]        Executed start command in 21.315 seconds
connection not open on send()
2020.06.09-08:57:17.240 error [caliper] [caliper-engine]        Error while performing "init" step: Error: connection not open
2020.06.09-08:57:17.241 info  [caliper] [caliper-engine]        Executed "init" step in 0.016 seconds
2020.06.09-08:57:17.241 info  [caliper] [caliper-utils]         Executing command: cd .; docker-compose -f networks/ethereum/1node/docker-compose.yml down
Stopping ethereum ... done
Removing ethereum ... done
Removing network 1node_default
2020.06.09-08:57:20.598 info  [caliper] [caliper-engine]        Executed end command in 3.357 seconds
2020.06.09-08:57:20.601 error [caliper] [cli-launch-master]     Benchmark failed with error code 4
  1. Geth is running and you just run Caliper.
    Errors:
brl:~/caliper-benchmarks$ npx caliper launch master     --caliper-workspace .     --caliper-benchconfig benchmarks/scenario/simple/config.yaml     --caliper-networkconfig networks/ethereum/1node/ethereum.json
2020.06.09-08:59:20.881 info  [caliper] [cli-launch-master]     Set workspace path: /home/brl/caliper-benchmarks
2020.06.09-08:59:20.882 info  [caliper] [cli-launch-master]     Set benchmark configuration path: /home/brl/caliper-benchmarks/benchmarks/scenario/simple/config.yaml
2020.06.09-08:59:20.882 info  [caliper] [cli-launch-master]     Set network configuration path: /home/brl/caliper-benchmarks/networks/ethereum/1node/ethereum.json
2020.06.09-08:59:20.882 info  [caliper] [cli-launch-master]     Set SUT type: ethereum
2020.06.09-08:59:21.683 info  [caliper] [benchmark-validator]   No observer specified, will default to `none`
2020.06.09-08:59:21.683 info  [caliper] [caliper-engine]        Starting benchmark flow
2020.06.09-08:59:21.732 info  [caliper] [caliper-engine]        Network configuration attribute "caliper.command.start" is not present, skipping start command
2020.06.09-08:59:24.800 info  [caliper] [caliper-engine]        Executed "init" step in 3.068 seconds
2020.06.09-08:59:24.801 info  [caliper] [ethereum.js]   Creating contracts...
2020.06.09-08:59:44.562 info  [caliper] [ethereum.js]   Deployed contract simple at 0x91496eafe3C54C48D1Add5c1Fb30655d6b76e56b
2020.06.09-08:59:44.567 info  [caliper] [caliper-engine]        Executed "install" step in 19.766 seconds
2020.06.09-08:59:44.569 info  [caliper] [messenger.js]  Creating messenger of type "process-master"
2020.06.09-08:59:44.579 info  [caliper] [null-observer]         Configured "null" observer
2020.06.09-08:59:44.589 info  [caliper] [round-orchestrator]    Monitors successfully started
2020.06.09-08:59:44.589 info  [caliper] [round-orchestrator]    Started round 1 (open)
2020.06.09-08:59:44.591 info  [caliper] [worker-orchestrator]   Launching worker 1 of 1
2020.06.09-08:59:44.610 info  [caliper] [worker-orchestrator]   Messenger not configured, entering configure phase...
2020.06.09-08:59:44.611 info  [caliper] [worker-orchestrator]   No existing workers detected, entering worker launch phase...
2020.06.09-08:59:44.611 info  [caliper] [worker-orchestrator]   Waiting for 1 workers to be connected...
2020.06.09-08:59:46.047 info  [caliper] [cli-launch-worker]     Set workspace path: /home/brl/caliper-benchmarks
2020.06.09-08:59:46.048 info  [caliper] [cli-launch-worker]     Set benchmark configuration path: /home/brl/caliper-benchmarks/benchmarks/scenario/simple/config.yaml
2020.06.09-08:59:46.049 info  [caliper] [cli-launch-worker]     Set network configuration path: /home/brl/caliper-benchmarks/networks/ethereum/1node/ethereum.json
2020.06.09-08:59:46.049 info  [caliper] [cli-launch-worker]     Set SUT type: ethereum
2020.06.09-08:59:46.686 info  [caliper] [messenger.js]  Creating messenger of type "process-worker"  for SUT ethereum
2020.06.09-08:59:49.616 info  [caliper] [worker-orchestrator]   1 workers connected, progressing to worker assignment phase.
2020.06.09-08:59:49.616 info  [caliper] [worker-orchestrator]   Workers currently unassigned, awaiting index assignment...
2020.06.09-08:59:49.617 info  [caliper] [worker-orchestrator]   Waiting for 1 workers to be assigned...
2020.06.09-08:59:49.618 info  [caliper] [worker-orchestrator]   1 workers assigned, progressing to worker initialization phase.
2020.06.09-08:59:49.619 info  [caliper] [worker-orchestrator]   Waiting for 1 workers to be ready...
2020.06.09-08:59:49.620 info  [caliper] [message-handler]       Handling "init" message
2020.06.09-08:59:49.641 info  [caliper] [message-handler]       Handled successful "init" message for worker 0
2020.06.09-08:59:49.643 info  [caliper] [worker-orchestrator]   1 workers ready, progressing to test preparation phase.
2020.06.09-08:59:49.645 info  [caliper] [message-handler]       Handling "prepare" message
2020.06.09-08:59:49.868 info  [caliper] [caliper-local-client.js]       Client[0] encountered an error during prepare test phase: TypeError: this.web3.eth.getChainId is not a function
    at Ethereum.getContext (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-ethereum/lib/ethereum.js:147:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:49.869 info  [caliper] [caliper-local-client.js]       Info: client 0 prepare test :opening accountsphase complete
2020.06.09-08:59:49.870 error [caliper] [message-handler]       Handled unsuccessful "prepare" message for worker 0 and test round 0 with error TypeError: this.web3.eth.getChainId is not a function
    at Ethereum.getContext (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-ethereum/lib/ethereum.js:147:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:49.872 error [caliper] [round-orchestrator]    Failed round 1 (open): Error: TypeError: this.web3.eth.getChainId is not a function
    at WorkerOrchestrator.updateWorkerPhase (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:211:61)
    at WorkerOrchestrator.processWorkerUpdate (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:124:18)
    at ChildProcess.<anonymous> (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/common/messaging/process-master.js:51:30)
    at ChildProcess.emit (events.js:198:13)
    at emit (internal/child_process.js:832:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
2020.06.09-08:59:49.873 info  [caliper] [round-orchestrator]    Started round 2 (query)
2020.06.09-08:59:49.873 info  [caliper] [worker-orchestrator]   Existing 1 connected workers detected, progressing to worker assignment phase.
2020.06.09-08:59:49.874 info  [caliper] [worker-orchestrator]   Existing 1 connected workers detected are assigned, progressing to worker initialization phase.
2020.06.09-08:59:49.874 info  [caliper] [worker-orchestrator]   Existing 1 prepared workers detected, progressing to test preparation phase.
2020.06.09-08:59:49.875 info  [caliper] [message-handler]       Handling "prepare" message
2020.06.09-08:59:49.892 info  [caliper] [caliper-local-client.js]       Client[0] encountered an error during prepare test phase: TypeError: this.web3.eth.getChainId is not a function
    at Ethereum.getContext (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-ethereum/lib/ethereum.js:147:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:49.892 info  [caliper] [caliper-local-client.js]       Info: client 0 prepare test :querying accountsphase complete
2020.06.09-08:59:49.893 error [caliper] [message-handler]       Handled unsuccessful "prepare" message for worker 0 and test round 1 with error TypeError: this.web3.eth.getChainId is not a function
    at Ethereum.getContext (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-ethereum/lib/ethereum.js:147:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:49.894 error [caliper] [round-orchestrator]    Failed round 2 (query): Error: TypeError: this.web3.eth.getChainId is not a function
    at WorkerOrchestrator.updateWorkerPhase (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:211:61)
    at WorkerOrchestrator.processWorkerUpdate (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:124:18)
    at ChildProcess.<anonymous> (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/common/messaging/process-master.js:51:30)
    at ChildProcess.emit (events.js:198:13)
    at emit (internal/child_process.js:832:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
2020.06.09-08:59:49.904 info  [caliper] [round-orchestrator]    Started round 3 (transfer)
2020.06.09-08:59:49.904 info  [caliper] [worker-orchestrator]   Existing 1 connected workers detected, progressing to worker assignment phase.
2020.06.09-08:59:49.905 info  [caliper] [worker-orchestrator]   Existing 1 connected workers detected are assigned, progressing to worker initialization phase.
2020.06.09-08:59:49.905 info  [caliper] [worker-orchestrator]   Existing 1 prepared workers detected, progressing to test preparation phase.
2020.06.09-08:59:49.906 info  [caliper] [message-handler]       Handling "prepare" message
2020.06.09-08:59:49.925 info  [caliper] [caliper-local-client.js]       Client[0] encountered an error during prepare test phase: TypeError: this.web3.eth.getChainId is not a function
    at Ethereum.getContext (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-ethereum/lib/ethereum.js:147:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:49.926 info  [caliper] [caliper-local-client.js]       Info: client 0 prepare test :transfering moneyphase complete
2020.06.09-08:59:49.927 error [caliper] [message-handler]       Handled unsuccessful "prepare" message for worker 0 and test round 2 with error TypeError: **this.web3.eth.getChainId** is not a function
    at Ethereum.getContext (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-ethereum/lib/ethereum.js:147:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:49.927 error [caliper] [round-orchestrator]    Failed round 3 (transfer): Error: TypeError: this.web3.eth.getChainId is not a function
    at WorkerOrchestrator.updateWorkerPhase (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:211:61)
    at WorkerOrchestrator.processWorkerUpdate (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:124:18)
    at ChildProcess.<anonymous> (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/common/messaging/process-master.js:51:30)
    at ChildProcess.emit (events.js:198:13)
    at emit (internal/child_process.js:832:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
2020.06.09-08:59:49.928 info  [caliper] [report-builder]        ### All test results ###
2020.06.09-08:59:49.928 error [caliper] [report-builder]        No data within test result; implies error within configuration files
2020.06.09-08:59:49.929 error [caliper] [round-orchestrator]    Error while finalizing the report: Error: unrecognized report table
    at ReportBuilder.setSummaryTable (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/report/report-builder.js:142:19)
    at Report.printResultsByRound (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/report/report.js:254:28)
    at RoundOrchestrator.run (/home/brl/caliper-benchmarks/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/round-orchestrator.js:221:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020.06.09-08:59:50.031 info  [caliper] [message-handler]       Handling "exit" message
2020.06.09-08:59:50.032 info  [caliper] [round-orchestrator]    Benchmark finished in 5.442 seconds. Total rounds: 3. Successful rounds: 0. Failed rounds: 3.
2020.06.09-08:59:50.033 info  [caliper] [caliper-engine]        Network configuration attribute "caliper.command.end" is not present, skipping end command
2020.06.09-08:59:50.033 info  [caliper] [cli-launch-master]     Benchmark successfully finished

So I can see solution for the:

  1. is adding some delay before executing the smart contract step. The node takes a while so does WS it tries connecting and it fails with no Open Connection.

  2. Its about the method web3.eth.getChainId which is not a function; I can see something here about this here: Add eth.getChainId method to 1.x web3/web3.js#3113 Core issue: Proposal to stabilize Web3 1.x web3/web3.js#3070 need to understand this better ^^

@kiview
Copy link
Contributor

kiview commented Jun 9, 2020

So 1. means it is a bad implementation in Caliper side. Adding delay does not help, this just changes the race condition. Instead, you need a real health check from Caliper to the node/network. But you are right, they just do the sleep there, this is not good. Let's ignore this for now and work with executing against a running network.

With regards to 2, this would mean there is probably the wrong web3j version used somewhere. This means, it is either wrong in Caliper or just in your local environment? Try to install the correct version in your local npm in a version that has the method.

@chinmay241
Copy link
Author

In that case the 1.2.2 version would have the method eth.getChainId

@kiview
Copy link
Contributor

kiview commented Jun 9, 2020

Will hopefully fixed by hyperledger-caliper/caliper#862.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants