hyperledger / fabric

Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.
https://wiki.hyperledger.org/display/fabric
Apache License 2.0
15.75k stars 8.85k forks source link

Native Support For 64bit ARM in fabric #2994

Closed davidkel closed 1 year ago

davidkel commented 3 years ago

With the introduction of the M1 ARM chip for Apple Macbooks plus the increasing interest in ARM as an alternative to Intel it would be good if fabric supported and published native ARM binaries

M1 Mac users at the moment can make use of Rosetta 2 to use fabric (although the bootstrap script currently fails to pull down binaries and images as it looks for a non-existent ARM architecture in the image name or binary package)

On top of Mac book support it would also facilitate being able to run fabric nodes on 64bit raspberry pi 4 distros which seems to be quite popular for IOT projects

hhyxx commented 2 years ago

Guys, I find a solutions, refer to https://jira.hyperledger.org/browse/FAB-18389?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true

denyeart commented 2 years ago

Note that a workaround has been merged in bootstrap script to pull down amd64 when using M1 Mac (Rosetta approach that Dave K mentioned). Got confirmation that this approach works.

bestbeforetoday commented 2 years ago

Confirmed that with current (v2.4) Fabric release and current fabric-samples, these things work:

What doesn't work is deploying Node and Java chaincode using the test-network/network.sh script, with suitable nodeenv and javaenv Docker images not found:

Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Failed to pull hyperledger/fabric-nodeenv:2.4: no matching manifest for linux/arm64/v8 in the manifest list entries
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Failed to pull hyperledger/fabric-javaenv:2.4: no matching manifest for linux/arm64/v8 in the manifest list entries

A workaround is to manually pull the x86 node/javaenv Docker images in advance so the chaincode deployment process doesn't try to pull the native arm64 images, which don't exist:

1055373165 commented 1 year ago

I already solve this question on my mac m1.

https://juejin.cn/post/7175001573045567548/

bestbeforetoday commented 1 year ago

I already solve this question on my mac m1.

https://juejin.cn/post/7175001573045567548/

I'm not sure the arm64 Fabric Docker images you are using are a good solution for current Fabric versions, given that they were published three years ago and include this message:

"NOTE: These images were created as part of a project at Linköping University, they have not been tested in detail and will not be maintained."

jkneubuh commented 1 year ago

All set! Additional details and discussion thread at #3876

Release pipeline is now set up to generate arm64 and amd64 builds for binaries and docker images. We should also be OK extending with additional arch specs (ppc, etc.) with minimal updates, or the next time Steve Jobs reaches out from the grave to remove a few decibels from a laptop fan.

Really looking forward to seeing this used for IoT, cel, and broadcom/Pi devices.

Happy hacking.