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

feat(cactus-plugin-ledger-connector-ethereum): refactor connector API #2631

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

outSH
Copy link
Contributor

@outSH outSH commented Aug 22, 2023

  • Refactor to single invokeContract endpoint that can accept multiple methods of
    supplying contract definition (directly, from keychain, etc..).
  • Same for deployContract method.
  • Update cactus-common safeStringifyException function to better handle axios errors
    (and other custom exceptions that support toJSON() method.).
  • Use common error handling in all connector endpoints (except prometheus).
  • Fix the tests.
  • Switch to Cacti work in entire connector (except for package name)

Depends on #2630

Signed-off-by: Michal Bajer [email protected]

@outSH outSH force-pushed the eth_connector_refactor_pr branch from fb3cdb5 to 4540c1b Compare September 11, 2023 10:18
outSH added a commit to outSH/cactus that referenced this pull request Sep 18, 2023
- Return JSON error before checking for Error instance in safeStringifyException
    (for cases when custom errror extends `Error` with `toJSON()` method)
- Move artillery dependency up to the root (since its common tool depdenecy)
- Add web3js http/ws provider options to connector.
- Make http provider optional (can run on ws web3js provider only)
- Don't register async endpoints when WS provider is not available.
- Return 400 for invalid responses from ethereum ledger (to distinguish from connector errors)
- In docker `geth-all-in-one` allow overwriting of default options when starting the ledger.
- Add artillery stress test scripts
    - Template config and artillery functions file
    - Common environment setup file
    - CLI for running the test environment on a separate machine.
    - Jest test to run quickly stress test on same machine.

Depends on hyperledger-cacti#2631

Signed-off-by: Michal Bajer <[email protected]>
@github-actions github-actions bot removed the dependent label Oct 3, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

This PR/issue depends on:

@outSH outSH force-pushed the eth_connector_refactor_pr branch from 4540c1b to 1171f97 Compare October 3, 2023 07:59
@outSH outSH requested a review from petermetz October 3, 2023 08:16
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

LGTM

outSH added a commit to outSH/cactus that referenced this pull request Oct 5, 2023
- Refactor persistence ethereum plugin to use openapi ethereum connector
    instead of ethereum-socketio.
- Upgrade web3js to 4.X in both persistence plugin and its tests.
- Update persistence plugin dependency list.
- Recompile base token contracts in persistence plugin to match format
    required by ethereum connector (full compilation output, not just ABI)
- Minor fix in ethereum connector to return empty transactions
    array instead of undefined.
- Fix minor runtime issues in geth-test-ledger

Depends on hyperledger-cacti#2631

Signed-off-by: Michal Bajer <[email protected]>
Copy link
Contributor

@izuru0 izuru0 left a comment

Choose a reason for hiding this comment

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

LGTM

@outSH outSH force-pushed the eth_connector_refactor_pr branch from 1171f97 to 74327d0 Compare October 10, 2023 09:02
- Refactor to single `invokeContract` endpoint that can accept multiple methods of
    supplying contract definition (directly, from keychain, etc..).
- Same for `deployContract` method.
- Update cactus-common `safeStringifyException` function to better handle axios errors
    (and other custom exceptions that support `toJSON()` method.).
- Use common error handling in all connector endpoints (except prometheus).
- Fix the tests.
- Switch to `Cacti` work in entire connector (except for package name)

Co-authored-by: Peter Somogyvari <[email protected]>

1. Updated the yarn.lock file to reflect the changes in the package.json

Depends on: hyperledger-cacti#2630

Signed-off-by: Michal Bajer <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
@petermetz petermetz force-pushed the eth_connector_refactor_pr branch from 74327d0 to cda279f Compare October 10, 2023 18:37
@petermetz petermetz merged commit cda279f into hyperledger-cacti:main Oct 10, 2023
103 of 132 checks passed
outSH added a commit to outSH/cactus that referenced this pull request Oct 16, 2023
- Return JSON error before checking for Error instance in safeStringifyException
    (for cases when custom errror extends `Error` with `toJSON()` method)
- Move artillery dependency up to the root (since its common tool depdenecy)
- Add web3js http/ws provider options to connector.
- Make http provider optional (can run on ws web3js provider only)
- Don't register async endpoints when WS provider is not available.
- Return 400 for invalid responses from ethereum ledger (to distinguish from connector errors)
- In docker `geth-all-in-one` allow overwriting of default options when starting the ledger.
- Add artillery stress test scripts
    - Template config and artillery functions file
    - Common environment setup file
    - CLI for running the test environment on a separate machine.
    - Jest test to run quickly stress test on same machine.

Depends on hyperledger-cacti#2631

Signed-off-by: Michal Bajer <[email protected]>
petermetz pushed a commit that referenced this pull request Oct 16, 2023
- Return JSON error before checking for Error instance in safeStringifyException
    (for cases when custom errror extends `Error` with `toJSON()` method)
- Move artillery dependency up to the root (since its common tool depdenecy)
- Add web3js http/ws provider options to connector.
- Make http provider optional (can run on ws web3js provider only)
- Don't register async endpoints when WS provider is not available.
- Return 400 for invalid responses from ethereum ledger (to distinguish from connector errors)
- In docker `geth-all-in-one` allow overwriting of default options when starting the ledger.
- Add artillery stress test scripts
    - Template config and artillery functions file
    - Common environment setup file
    - CLI for running the test environment on a separate machine.
    - Jest test to run quickly stress test on same machine.

Depends on #2631

Signed-off-by: Michal Bajer <[email protected]>
outSH added a commit to outSH/cactus that referenced this pull request Oct 17, 2023
- Refactor persistence ethereum plugin to use openapi ethereum connector
    instead of ethereum-socketio.
- Upgrade web3js to 4.X in both persistence plugin and its tests.
- Update persistence plugin dependency list.
- Recompile base token contracts in persistence plugin to match format
    required by ethereum connector (full compilation output, not just ABI)
- Minor fix in ethereum connector to return empty transactions
    array instead of undefined.
- Fix minor runtime issues in geth-test-ledger

Depends on hyperledger-cacti#2631

Signed-off-by: Michal Bajer <[email protected]>
petermetz pushed a commit that referenced this pull request Oct 17, 2023
- Refactor persistence ethereum plugin to use openapi ethereum connector
    instead of ethereum-socketio.
- Upgrade web3js to 4.X in both persistence plugin and its tests.
- Update persistence plugin dependency list.
- Recompile base token contracts in persistence plugin to match format
    required by ethereum connector (full compilation output, not just ABI)
- Minor fix in ethereum connector to return empty transactions
    array instead of undefined.
- Fix minor runtime issues in geth-test-ledger

Depends on #2631

Signed-off-by: Michal Bajer <[email protected]>
sandeepnRES pushed a commit to sandeepnRES/cacti that referenced this pull request Dec 21, 2023
- Return JSON error before checking for Error instance in safeStringifyException
    (for cases when custom errror extends `Error` with `toJSON()` method)
- Move artillery dependency up to the root (since its common tool depdenecy)
- Add web3js http/ws provider options to connector.
- Make http provider optional (can run on ws web3js provider only)
- Don't register async endpoints when WS provider is not available.
- Return 400 for invalid responses from ethereum ledger (to distinguish from connector errors)
- In docker `geth-all-in-one` allow overwriting of default options when starting the ledger.
- Add artillery stress test scripts
    - Template config and artillery functions file
    - Common environment setup file
    - CLI for running the test environment on a separate machine.
    - Jest test to run quickly stress test on same machine.

Depends on hyperledger-cacti#2631

Signed-off-by: Michal Bajer <[email protected]>
sandeepnRES pushed a commit to sandeepnRES/cacti that referenced this pull request Dec 21, 2023
- Refactor persistence ethereum plugin to use openapi ethereum connector
    instead of ethereum-socketio.
- Upgrade web3js to 4.X in both persistence plugin and its tests.
- Update persistence plugin dependency list.
- Recompile base token contracts in persistence plugin to match format
    required by ethereum connector (full compilation output, not just ABI)
- Minor fix in ethereum connector to return empty transactions
    array instead of undefined.
- Fix minor runtime issues in geth-test-ledger

Depends on hyperledger-cacti#2631

Signed-off-by: Michal Bajer <[email protected]>
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.

3 participants