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

Implement Ethereum adapter #432

Merged
merged 1 commit into from
Oct 10, 2019
Merged

Conversation

russanto
Copy link
Contributor

@russanto russanto commented May 6, 2019

No description provided.

@aklenik
Copy link
Contributor

aklenik commented May 20, 2019

@russanto Great addition to the platform support 👍
Could you provide some documentation for it:

  1. Official adapter documentation about how to configure Caliper for this platform and how to use the adapter from the user modules (style/content reference: Fabric-CCP docs)
  2. Some high-level architecture doc for us, the reviewers to navigate and review your code more easily :) You can add this description to this PR's description.

@feihujiang
Copy link
Contributor

Ethereum adapter is a great addition. +1

@stale
Copy link

stale bot commented Sep 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 11, 2019
@aklenik aklenik removed the wontfix This will not be worked on label Sep 11, 2019
@aklenik
Copy link
Contributor

aklenik commented Sep 11, 2019

@russanto I'll start to review the pr soon. I'll leave pr remarks, so we can keep the discussion here

@aklenik aklenik self-assigned this Sep 12, 2019
@aklenik aklenik added the PR/under review The PR is currently under review label Sep 12, 2019
@aklenik aklenik added this to the v0.2.0 milestone Sep 12, 2019
@aklenik
Copy link
Contributor

aklenik commented Sep 25, 2019

@russanto Can you join the Caliper call next week (Oct. 2, 3PM UTC+0)? Or even today, but I know it's really short notice :)
I'd like to discuss some things before actually writing up a PR review.

Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General remarks:

  1. Please squash your commits into a single commit after applying the requested changes.
  2. See other remarks among the code remarks.

packages/caliper-ethereum/lib/ethereum.js Outdated Show resolved Hide resolved
],
"dependencies": {
"caliper-core" : "0.1.0",
"web3": "^1.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Web3 should be put under devDeps. It will be installed during binding, similarly to the other adapters. So you need to modify the following file also:

sut:
  ethereum:
    1.0.0:
      packages: [ 'web3@1.0.0' ]

There could be more 1.X.0 entries of course.

Copy link
Contributor Author

@russanto russanto Oct 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the latest version, I don't know if it can be useful to add all the 1.X ones

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@russanto this is awesome! Please do a squash commit so there is only one commit being merged.

@aklenik aklenik added PR/change requested The PR is blocked until the requested changes are applied PR/merge conflict The PR is blocked by merge conflicts and removed PR: work in progress labels Sep 26, 2019
@russanto russanto requested a review from panyu4 as a code owner October 2, 2019 16:53
@russanto russanto force-pushed the ethereum-adapter branch 2 times, most recently from 90dd29c to f9bfc87 Compare October 2, 2019 17:02
@@ -0,0 +1,26 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,16 @@
#
# Licensed under the Apache License, Version 2.0 (the "License");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,18 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,213 @@
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,56 @@
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,25 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,17 @@
# Licensed under the Apache License, Version 2.0 (the "License");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,17 @@
# Licensed under the Apache License, Version 2.0 (the "License");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,53 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

@@ -0,0 +1,56 @@
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding the SPDX header for Apache 2

Copy link
Member

@ryjones ryjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On new files with license headers, please consider adding the SPDX header as well.

https://spdx.org/licenses/Apache-2.0.html

https://spdx.org/ids-how

@aklenik
Copy link
Contributor

aklenik commented Oct 3, 2019

On new files with license headers, please consider adding the SPDX header as well.

https://spdx.org/licenses/Apache-2.0.html

https://spdx.org/ids-how

@ryjones I think we'll need to add this to the automatic license check format on the repo-level. Currently, the CI only enforces the above header formats.

@ryjones
Copy link
Member

ryjones commented Oct 3, 2019

@ryjones I think we'll need to add this to the automatic license check format on the repo-level. Currently, the CI only enforces the above header formats.

Understood! Don't block this PR based on my comments.

Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor modifications needed (aside from querySmartContract, but that's also easy).

packages/caliper-cli/lib/bind/config.yaml Show resolved Hide resolved
packages/caliper-tests-integration/scripts/run-tests.sh Outdated Show resolved Hide resolved
packages/caliper-ethereum/lib/ethereum.js Outdated Show resolved Hide resolved
packages/caliper-ethereum/lib/ethereum.js Show resolved Hide resolved
@aklenik aklenik removed the PR/merge conflict The PR is blocked by merge conflicts label Oct 7, 2019
Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two linting errors (missing semicolons), should be an easy fix

lerna ERR! execute /home/travis/build/hyperledger/caliper/packages/caliper-ethereum/lib/ethereum.js
lerna ERR! execute    70:79  error  Missing semicolon  semi
lerna ERR! execute   202:10  error  Missing semicolon  semi

@aklenik
Copy link
Contributor

aklenik commented Oct 8, 2019

@russanto After buliding the caliper-ethereum-clique image, the test flow stopped with the following error:

2019.10.08-11:16:24.031 error [caliper] [caliper-flow]    	Error: Error: Invalid JSON RPC response: ""

This is originating from your init function. The reason is that the clique container stopped. Docker logs:

Fatal: Account unlock with HTTP access is forbidden!
INFO [10-08|11:29:32.246] HTTP endpoint opened                     url=http://0.0.0.0:8545      cors= vhosts=*
Fatal: Account unlock with HTTP access is forbidden!

UPDATE: Adding this to the command of the docker-compose file solves the problem: --allow-insecure-unlock

@russanto russanto force-pushed the ethereum-adapter branch 3 times, most recently from 261a396 to 19d8724 Compare October 8, 2019 14:32
Signed-off-by: Antonio Russo <rjproj@gmail.com>
@aklenik aklenik removed PR/change requested The PR is blocked until the requested changes are applied PR/under review The PR is currently under review labels Oct 9, 2019
@aklenik aklenik merged commit 01f053f into hyperledger:master Oct 10, 2019
@russanto russanto deleted the ethereum-adapter branch October 10, 2019 22:14
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

Successfully merging this pull request may close these issues.

5 participants