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

Middleware's New Architecture #4

Merged
merged 89 commits into from
Aug 19, 2023
Merged

Middleware's New Architecture #4

merged 89 commits into from
Aug 19, 2023

Conversation

ToolmanP
Copy link
Contributor

Description

What type of PR is this? (check all applicable)

  • ๐Ÿง‘โ€๐Ÿ’ป Refactor
  • โฉ Revert
  • ๐ŸŽจ Style
  • ๐Ÿค– Build
  • ๐Ÿ“ฆ Chore
  • ๐Ÿ• Feat
  • ๐Ÿ—๏ธ Base
  • ๐Ÿ”ฅ Perf
  • โœ… Test
  • ๐Ÿ“ Docs
  • ๐Ÿ› Fix
  • ๐Ÿ” CI
  • โ˜ฎ๏ธ Overhaul

Related Tickets & Documents

resolved #2
resolved #3

Direct Issues

#2 On moving firefly back to fabric gateway
#3 Unittests and Load tests

Added tests?

  • ๐Ÿ‘ yes
  • ๐Ÿ™… no, because they aren't needed
  • ๐Ÿ™‹ no, because I need help

Added to documentation?

  • ๐Ÿ“œ README.md
  • ๐Ÿ““ New Documentation
  • ๐Ÿ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

See README.md

ToolmanP added 30 commits July 27, 2023 18:34
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Refactor FireflyConfig out of Config for

later on firefly api endpoints reflections.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Use register interface to register api endpoints

instead of explicitly designating endpoints.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Refactor images uploading to ImagesBase64ToIPFS.

Refactor query and invoke interfaces.

Use reflection api for runtime endpoint assignments.

Use Proto.MiddlewareError for error handling.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Wrap ipfs shell inside ipfsManager.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Refactor verification parts.

Use register to dynamically register session storage.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Two struct with PostBlock stored on the chain and

Post stored offchain with gorm/postgres.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Split userprofile into User + Profile

Profile belongs to User and Frontend shall display

user when browsing.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Basically the same as the post model.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Seperate GatewayConfig, PostgresConfig and FireflyConfig

for better config parameterizing.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Chaincode middleware registers two special handlers.

ChaincodeInvoke - wiring the http request to the cc invoke.

ChaincodeCallback - Listen for the cc server to send event

back to the server and perform offchain storing.

ChaincodeInvoke is grouped as the ../invoke/{actionName}

The middleware will create goroutine to listen event and

call the corresponding callback when possible.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Gateway holds multiple chaincodes middlewares and

registers them on the given name /api/{name}.

It will start all the goroutines needed to listen to the

ledger callbacks

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
The offchain store uses gorm ORM.

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Add go-sqlmock + sqlite3 drivers

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Add gorm mysql driver

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Add chaincode network interface mocking

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Use package importing to simply codes

Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
Signed-off-by: Yiyang Wu <toolmanp@outlook.com>
@ToolmanP ToolmanP merged commit 5c9d590 into master Aug 19, 2023
@ToolmanP ToolmanP deleted the dev_newarch branch September 5, 2023 15:44
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.

[Dev] Load Tests + Unittests [Dev] New Architecture
1 participant