Skip to content

Conversation

Eajunnn
Copy link

@Eajunnn Eajunnn commented May 20, 2025

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.

@Eajunnn
Copy link
Author

Eajunnn commented May 20, 2025

I created a whole new supply-chain workflow by adding wallet authentication, using sepolia testnet as ethereum network for testing. All endpoints now are in fabric. Public data stored in sepolia while private are in fabric. User can see certain information based on their connected wallet role. I also created a payment endpoint where it uses sepolia to pay the shipment. If you guys wanted this as additional 3 examples of supply chain in that examples directory can just put all these as new 3 folders in examples directory instead of merging into the original ones. The original ones are using besu and xdai preset testing account, but this is more real world approach. Thanks

Copy link
Contributor

@outSH outSH left a comment

Choose a reason for hiding this comment

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

It all looks great, although I've left some high level comments to be addressed first.

Additionally, please update the PR and commit to match our contributors guide (https://github.com/hyperledger-cacti/cacti/blob/main/CONTRIBUTING.md). In particular:

  • Name of the commit and PR should be something like (feat(supply-chain): add wallet authentication (the key thing is to include in paranthesis after feat).
  • Squash all commits in this PR into single one.
  • Include a signoff in your commit.
  • Add description to the commit and PR body.
  • (optional) Create an issue where you describe and justify feature shortly, then link to it in PR body by including Closes: #XXXX where XXXX is number of your issue.

Comment on lines +330 to +344
"dependencies": {
"@angular/animations": "17.3.0",
"@angular/cdk": "17.3.0",
"@angular/common": "17.3.11",
"@angular/core": "17.3.11",
"@angular/forms": "17.3.11",
"@angular/material": "17.3.0",
"@angular/platform-browser": "17.3.11",
"@angular/platform-browser-dynamic": "17.3.11",
"@angular/router": "17.3.11",
"@hyperledger/cactus-plugin-ledger-connector-ethereum": "workspace:^",
"@metamask/detect-provider": "^2.0.0",
"ether": "^0.0.9",
"ethers": "6.13.5"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be no dependencies in root package.json file

"devDependencies": {
"@types/express": "5.0.1",
"@types/uuid": "10.0.0"
"@types/jest": "^29.5.14",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please pin the dependencies version (i.e. 29.5.14). We use pinned versions to prevent supply chain attacks.

Copy link
Contributor

Choose a reason for hiding this comment

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

This applies to all package.json affected by this PR

Comment on lines +227 to +232
const ethereumConnector = new PluginLedgerConnectorEthereum({
instanceId: "PluginLedgerConnectorEthereum_Sepolia",
rpcApiHttpHost: SEPOLIA_RPC_ENDPOINT,
logLevel: "DEBUG",
pluginRegistry,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to force users to have access to sepolia node, through Alchemy or any other provider, to run the test application. Is it possible to make the sample app run on local ethereum network by default? Running on Sepolia could be an optional way of testing the application (must be well documented), but the default should work without much additional setup.

I think you can run geth-all-in-one (tools/docker/geth-all-in-one/README.md) the same way we run besu right now, and deploy and use all the necessary contracts there, or even use besu as sepolia alternative for local run. Please investigate which option suits you better :)

Copy link
Author

Choose a reason for hiding this comment

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

Maybe I can make the sepolia approach optional by checking if they inserted in the process.env? If not it will just go through the original process (Besu and Xdai)? Because now I changed all to Sepolia and Fabric only. Or you guys wanted this to be another directory in examples?

Copy link
Contributor

Choose a reason for hiding this comment

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

That works :) For me it's good to keep it single place, unless other maintainers have other opinion on it

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.

Thank you for your contribution. I agree with all that outSH said, rest LGTM.
Please make sure not to add dependencies from example to the root package

@RafaelAPB
Copy link
Contributor

@Eajunnn we are cleaning up merge requests that are stale. Please rebase, address comments, and solve conflicts so we can incorporate your contribution onto main. Thank you!

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