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(fabric-connector): add getChainInfo, improve getBlock output #3298

Conversation

outSH
Copy link
Contributor

@outSH outSH commented Jun 6, 2024

  • Add new method getChainInfo for quering chain information from qscc.
  • Add GetChainInfoEndpointV1 to allow calling getChainInfo remotely.
  • Refactor getBlock so it can return same custom block formats as WatchBlocks. Default remains the same (full decode block). BREAKING CHANGE: It accepts type instead of skipDecode flag.
  • Move common block formatting logic to cacti-block-formatters.ts.
  • Add tests for new features. Move test common to quering qscc to single file to increase CI speed.

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

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.

@outSH LGTM, thank you!

@outSH outSH force-pushed the persistence_plugin_fabric_connector_changes_pr branch from 07e3bb6 to 3ac2cbb Compare June 7, 2024 09:46
@outSH outSH requested a review from RafaelAPB as a code owner June 7, 2024 09:46
outSH added a commit to outSH/cactus that referenced this pull request Jun 11, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on hyperledger-cacti#3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
@outSH
Copy link
Contributor Author

outSH commented Jun 14, 2024

As per @petermetz suggestion in https://github.com/hyperledger/cacti/pull/3308#discussion_r1637090342, I've rebased with main and changed the following:

  • Added openapi.tpl.json, built openapi.json from it.
  • Changed FullBlockTransactionEventV1.type to transactionType
  • Changed GetBlockRequestV1.type -> responseType

@outSH outSH force-pushed the persistence_plugin_fabric_connector_changes_pr branch from 3ac2cbb to 2e1dada Compare June 14, 2024 10:17
@petermetz
Copy link
Contributor

As per @petermetz suggestion in #3308 (comment), I've rebased with main and changed the following:

* Added `openapi.tpl.json`, built `openapi.json` from it.

* Changed `FullBlockTransactionEventV1.type` to `transactionType`

* Changed `GetBlockRequestV1.type` -> `responseType`

@outSH Thank you very much!

Copy link
Contributor

@RafaelAPB RafaelAPB left a comment

Choose a reason for hiding this comment

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

LGTM, nice work

- Add new method `getChainInfo` for quering chain information from qscc.
- Add `GetChainInfoEndpointV1` to allow calling `getChainInfo` remotely.
- Refactor `getBlock` so it can return same custom block formats
  as `WatchBlocks`. Default remains the same (full decode block).
  BREAKING CHANGE: It accepts `type` instead of `skipDecode` flag.
- Move common block formatting logic to `cacti-block-formatters.ts`.
- Add tests for new features. Move test common to quering `qscc` to single file
  to increase CI speed.

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
@petermetz petermetz force-pushed the persistence_plugin_fabric_connector_changes_pr branch from 2e1dada to 9b2d4a8 Compare July 4, 2024 17:14
@petermetz petermetz merged commit 8c030ae into hyperledger-cacti:main Jul 4, 2024
144 of 150 checks passed
outSH added a commit to outSH/cactus that referenced this pull request Jul 18, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on hyperledger-cacti#3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Jul 18, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on hyperledger-cacti#3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Jul 18, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on hyperledger-cacti#3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Jul 18, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on hyperledger-cacti#3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
petermetz pushed a commit to outSH/cactus that referenced this pull request Jul 18, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on hyperledger-cacti#3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit that referenced this pull request Jul 18, 2024
- Rewrite fabric persistence plugin to match persistence ethereum
  plugin methods and behavior.
- Change DB schema for persistence.
- Add tests and sample data to the new plugin. Add them to project CI.

Depends on #3298

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
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