-
Notifications
You must be signed in to change notification settings - Fork 445
The Refactor #735
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
base: lab/kirin-refactor
Are you sure you want to change the base?
The Refactor #735
Conversation
b2553e7 to
4a3123e
Compare
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: KIRIN.CHU 朱祐麟 <[email protected]> Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
I encountered an issue after upgrading my Docker engine to version 29, and it seems to be caused by hyperledger/fabric#5350. Thus, I upgrade Hyperledger Fabric to 2.5.14 and go to 1.25.5 before I realized that the merge fix PR hyperledger/fabric#5355 hasn't been included in a Hyperledger Fabric release yet. Although I ended up downgrading my Docker engine to version 28, still, I commit my changes to these dependencies anyway. Signed-off-by: dodo920306 <[email protected]>
Chaincode installation can take a really long while. It often causes the client gateway timeout. Chaincode installation now uses another thread to wait for the peer command to response as it did before the refactor. Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
|
With the first interaction with a chaincode via Hyperledger Cello done on my PC, I hereby proudly announce that now Hyperledger Cello API Engine has the very basic ability to interact with chaincodes after a1f9e92 🥳! This definitely took a lot longer than expected, and the functionality is definitely not mature enough now ---- it is currently inaccessible via dashboard.
|
Signed-off-by: dodo920306 <[email protected]>
|
Update for this PR: After several meetings and discussions, I officially retract some of my comments in #735 (comment) and acknowledge that agents do indeed have their necessity. However, I also raised my concerns during the meetings — namely, that the logic for interacting with blockchain nodes on the Subsequently, @yeasy proposed moving all current blockchain interaction logic into the agent, allowing the agent to handle all operations. This also aligns with the original intention of Hyperledger Cello: to move blockchain-specific operations into agents, enabling users to support various blockchain projects simply by swapping agents. Fortunately, after this refactoring, user request handling is decoupled from business logic to the maximum extent (i.e., a view-service layered design). This makes it relatively easier to extract service logic and insert it into a standalone agent project compared to the In any case, reintegrating the decoupled agent will be the next and final stage of this refactoring. Hopefully, this process will go more smoothly this time. |
A new version of Hyperledger Fabric Docker Agent has been added to the repo. It has been finished yet. It's written in Python 3.13.7, a version a lot newer than the api-engine, and adopts the latest version of Django (6.0). Also, it uses `drf_spectacular` instead of `drf_yasg` to generate OpenAPI 3.0 schemas. In any respect, it's a fully upgraded version of the old agent. It now supports to create organization crypto materials via Hyperledger Fabric cryptogen. Signed-off-by: dodo920306 <[email protected]>
edeabb0 to
eb936ad
Compare
Signed-off-by: dodo920306 <[email protected]>
|
And as we discussed, the new model can be pushed a a new branch such as |
Yeah. So I did. |
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
These values can be retrieved from files dynamically whenever they're wanted. They shouldn't be stored as DB columns. Signed-off-by: dodo920306 <[email protected]>
They're not necessary. Signed-off-by: dodo920306 <[email protected]>
Node types are parsed as strings rather than enums. Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Use 'w' instead of 'r+' to overwrite files instead of just appending contents. Signed-off-by: dodo920306 <[email protected]>
Package MSP and TLS crypto materials into their own directories respectively. Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Signed-off-by: dodo920306 <[email protected]>
Save TLS certificates in the DB so that they can be accessed by other organizations in the future. Signed-off-by: dodo920306 <[email protected]>

Let's face it: the current state of this project’s code is not so good.
Contributions over time have lacked consistency, leading to duplicated implementations and a fragmented structure that makes maintenance and development difficult.
The combination of Python, Django, and object-oriented design has introduced unnecessary complexity, and without long-term technical stewardship, the project has become hard to extend.
Another pressing issue is the number of long-standing bugs. For a project that has been in existence for over six years, there remain issues that ideally should have been addressed very early on. Many of these are not superficial problems that tools or automated testing could easily detect, but deeper logical flaws that only become evident when the affected code paths are used.
Additionally, it seems that the project has not fully embraced the design principles of Django REST Framework (DRF). For example, serializers are often used only for traffic handling, while much of the core business logic resides in views.py, which goes against DRF’s intended design practices.
To summary, a refactor is inevitable, and to make sure I’m not just another person who criticizes without acting, I’ll do it myself.