Giter Site home page Giter Site logo

vanitas92 / fabric-external-chaincodes Goto Github PK

View Code? Open in Web Editor NEW
78.0 5.0 57.0 62 KB

Hyperledger Fabric network in K8s with External Chaincodes as pods

License: Apache License 2.0

Shell 18.97% Dockerfile 2.04% Go 79.00%
hyperledger-fabric kubernetes chaincodes

fabric-external-chaincodes's Introduction

Hyperledger Fabric network in K8s with External Chaincodes as pods

Refer the tutorial and instructions in this article: https://medium.com/@pau.aragones/how-to-implement-hyperledger-fabric-external-chaincodes-within-a-kubernetes-cluster-fd01d7544523

Install the binaries

wget https://github.com/hyperledger/fabric/releases/download/v2.3.1/hyperledger-fabric-linux-amd64-2.3.1.tar.gz

tar -xzf hyperledger-fabric-linux-amd64-2.3.1.tar.gz

# Move to the bin path
mv bin/* /bin

# Check that you have successfully installed the tools by executing
configtxgen --version

# Should print the following output:
# configtxgen:
#  Version: 2.3.1
#  Commit SHA: 2f69b4222
#  Go version: go1.14.12
#  OS/Arch: linux/amd64

Launching the network

./fabricOps.sh start

Create the namespace and launch the workload:

kubectl create ns hyperledger
kubectl create -f orderer-service/
kubectl create -f org1/
kubectl create -f org2/

Configure the network

peer channel create -o orderer0:7050 -c mychannel -f ./scripts/channel-artifacts/channel.tx --tls true --cafile $ORDERER_CA
peer channel join -b mychannel.block
peer channel fetch 0 mychannel.block -c mychannel -o orderer0:7050 --tls --cafile $ORDERER_CA

Package the chaincode information for the peer and install it

cd chaincode/packaging
tar cfz code.tar.gz connection.json
tar cfz marbles-org1.tgz code.tar.gz metadata.json
peer lifecycle chaincode install marbles-org1.tgz

Build and deploy the chaincode

docker build -t chaincode/marbles:1.0 .
kubectl create -f chaincode/k8s

Approve the chaincode and commit it to the channel

peer lifecycle chaincode approveformyorg --channelID mychannel --name marbles --version 1.0 --init-required --package-id marbles:d8140fbc1a0903bd88611a96c5b0077a2fdeef00a95c05bfe52e207f5f9ab79d --sequence 1 -o orderer0:7050 --tls --cafile $ORDERER_CA

peer lifecycle chaincode approveformyorg --channelID mychannel --name marbles --version 1.0 --init-required --package-id marbles:af45e0faa9676dd884a56e34b6a9bc1f7f1df04d6356aa1b2b9f123bd1d9e9e6 --sequence 1 -o orderer0:7050 --tls --cafile $ORDERER_CA

peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name marbles --version 1.0 --init-required --sequence 1 -o -orderer0:7050 --tls --cafile $ORDERER_CA

peer lifecycle chaincode commit -o orderer0:7050 --channelID mychannel --name marbles --version 1.0 --sequence 1 --init-required --tls true --cafile $ORDERER_CA --peerAddresses peer0-org1:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1/peers/peer0-org1/tls/ca.crt --peerAddresses peer0-org2:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt

Invoke and query the chaincode

peer chaincode invoke -o orderer0:7050 --isInit --tls true --cafile $ORDERER_CA -C mychannel -n marbles --peerAddresses peer0-org1:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1/peers/peer0-org1/tls/ca.crt --peerAddresses peer0-org2:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt -c '{"Args":["initMarble","marble1","blue","35","tom"]}' --waitForEvent

peer chaincode invoke -o orderer0:7050 --tls true --cafile $ORDERER_CA -C mychannel -n marbles --peerAddresses peer0-org1:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1/peers/peer0-org1/tls/ca.crt --peerAddresses peer0-org2:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt -c '{"Args":["initMarble","marble1","blue","35","tom"]}' --waitForEvent

peer chaincode invoke -o orderer0:7050 --tls true --cafile $ORDERER_CA -C mychannel -n marbles --peerAddresses peer0-org1:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1/peers/peer0-org1/tls/ca.crt --peerAddresses peer0-org2:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt -c '{"Args":["initMarble","marble2","red","50","tom"]}' --waitForEvent

peer chaincode query -C mychannel -n marbles -c '{"Args":["readMarble","marble1"]}'

Commands for ContractApi based External Chaincode

peer lifecycle chaincode approveformyorg --channelID mychannel --name fabcar --version 1.0 --package-id fabcar:005c35f4f172c056723eca09d41e8048e0beaa2712d920c19af837640df7e2aa --sequence 1 -o orderer0:7050 --tls --cafile $ORDERER_CA


peer lifecycle chaincode approveformyorg --channelID mychannel --name fabcar --version 1.0 --package-id fabcar:61ab817a6ad76098d340952e5d8e928d9c5ddff1a53341dc8d0c64b4345564b0 --sequence 1 -o orderer0:7050 --tls --cafile $ORDERER_CA


peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name fabcar --version 1.0 --sequence 1 -o -orderer0:7050 --tls --cafile $ORDERER_CA

peer lifecycle chaincode commit -o orderer0:7050 --channelID mychannel --name fabcar --version 1.0 --sequence 1 --tls true --cafile $ORDERER_CA --peerAddresses peer0-org1:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1/peers/peer0-org1/tls/ca.crt --peerAddresses peer0-org2:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt


peer chaincode invoke -o orderer0:7050 --tls true --cafile $ORDERER_CA -C mychannel -n fabcar --peerAddresses peer0-org1:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1/peers/peer0-org1/tls/ca.crt --peerAddresses peer0-org2:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt -c '{"Args":["InitLedger"]}' --waitForEvent

peer chaincode query -C mychannel -n fabcar -c '{"Args":["QueryAllCars"]}' 

fabric-external-chaincodes's People

Contributors

vanitas92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fabric-external-chaincodes's Issues

Error on kubectl create -f orderer-service/

Hi

When execute the command: kubectl create -f orderer-service/

Can you help me ?

Thanks in advance
Paolo

I got this error:

2020-05-19 09:56:17.211 UTC [viperutil] getKeysRecursively -> DEBU 0d1 Found real value for general.LocalMSPID setting to string OrdererMSP
2020-05-19 09:56:17.211 UTC [viperutil] EnhancedExactUnmarshal -> DEBU 0d2 map[consensus:map[SnapDir:/var/hyperledger/production/orderer/etcdraft/snapshot WALDir:/var/hyperledger/production/orderer/etcdraft/wal] debug:map[BroadcastTraceDir: DeliverTraceDir:] fileledger:map[Location:/var/hyperledger/production/orderer Prefix:hyperledger-fabric-ordererledger] general:map[Authentication:map[NoExpirationChecks: TimeWindow:15m] BCCSP:map[Default:SW PKCS11:map[FileKeyStore:map[KeyStore:] Hash: Label: Library: Pin: Security:] SW:map[FileKeyStore:map[KeyStore:] Hash:SHA2 Security:256]] BootstrapFile: BootstrapMethod:file Cluster:map[CertExpirationWarningThreshold: ClientCertificate:/var/hyperledger/orderer/tls/server.crt ClientPrivateKey:/var/hyperledger/orderer/tls/server.key DialTimeout: ListenAddress: ListenPort: RPCTimeout: ReplicationBackgroundRefreshInterval: ReplicationBufferSize: ReplicationMaxRetries: ReplicationPullTimeout: ReplicationRetryTimeout: RootCAs:[/var/hyperledger/orderer/tls/ca.crt] SendBufferSize:10 ServerCertificate: ServerPrivateKey: TLSHandshakeTimeShift:] ConnectionTimeout: GenesisFile:/var/hyperledger/orderer/genesis.block GenesisMethod:file Keepalive:map[ServerInterval:7200s ServerMinInterval:60s ServerTimeout:20s] ListenAddress:0.0.0.0 ListenPort:7050 LocalMSPDir:/var/hyperledger/orderer/msp LocalMSPID:OrdererMSP Profile:map[Address:0.0.0.0:6060 Enabled:false] TLS:map[Certificate:/var/hyperledger/orderer/tls/server.crt ClientAuthRequired:false ClientRootCAs: Enabled:true PrivateKey:/var/hyperledger/orderer/tls/server.key RootCAs:[/var/hyperledger/orderer/tls/ca.crt]]] kafka:map[Retry:map[Consumer:map[RetryBackoff:2s] LongInterval:5m LongTotal:12h Metadata:map[RetryBackoff:250ms RetryMax:3] NetworkTimeouts:map[DialTimeout:10s ReadTimeout:10s WriteTimeout:10s] Producer:map[RetryBackoff:100ms RetryMax:3] ShortInterval:5s ShortTotal:10m] SASLPlain:map[Enabled:false Password: User:] TLS:map[Certificate: ClientAuthRequired: ClientRootCAs: Enabled:false PrivateKey: RootCAs:] Topic:map[ReplicationFactor:3] Verbose:false Version:] metrics:map[Provider:prometheus Statsd:map[Address:127.0.0.1:8125 Network:udp Prefix: WriteInterval:30s]] operations:map[ListenAddress:0.0.0.0:8443 TLS:map[Certificate: ClientAuthRequired:false ClientRootCAs:[] Enabled:false PrivateKey: RootCAs:]]]
2020-05-19 09:56:17.212 UTC [localconfig] completeInitialization -> WARN 0d3 General.GenesisFile should be replaced by General.BootstrapFile
2020-05-19 09:56:17.212 UTC [localconfig] completeInitialization -> INFO 0d4 Kafka.Version unset, setting to 0.10.2.0
2020-05-19 09:56:17.213 UTC [orderer.common.server] prettyPrintStruct -> INFO 0d5 Orderer config values:
General.ListenAddress = "0.0.0.0"
General.ListenPort = 7050
General.TLS.Enabled = true
General.TLS.PrivateKey = "/var/hyperledger/orderer/tls/server.key"
General.TLS.Certificate = "/var/hyperledger/orderer/tls/server.crt"
General.TLS.RootCAs = [/var/hyperledger/orderer/tls/ca.crt]
General.TLS.ClientAuthRequired = false
General.TLS.ClientRootCAs = []
General.Cluster.ListenAddress = ""
General.Cluster.ListenPort = 0
General.Cluster.ServerCertificate = ""
General.Cluster.ServerPrivateKey = ""
General.Cluster.ClientCertificate = "/var/hyperledger/orderer/tls/server.crt"
General.Cluster.ClientPrivateKey = "/var/hyperledger/orderer/tls/server.key"
General.Cluster.RootCAs = [/var/hyperledger/orderer/tls/ca.crt]
General.Cluster.DialTimeout = 5s
General.Cluster.RPCTimeout = 7s
General.Cluster.ReplicationBufferSize = 20971520
General.Cluster.ReplicationPullTimeout = 5s
General.Cluster.ReplicationRetryTimeout = 5s
General.Cluster.ReplicationBackgroundRefreshInterval = 5m0s
General.Cluster.ReplicationMaxRetries = 12
General.Cluster.SendBufferSize = 10
General.Cluster.CertExpirationWarningThreshold = 168h0m0s
General.Cluster.TLSHandshakeTimeShift = 0s
General.Keepalive.ServerMinInterval = 1m0s
General.Keepalive.ServerInterval = 2h0m0s
General.Keepalive.ServerTimeout = 20s
General.ConnectionTimeout = 0s
General.GenesisMethod = "file"
General.GenesisFile = "/var/hyperledger/orderer/genesis.block"
General.BootstrapMethod = "file"
General.BootstrapFile = "/var/hyperledger/orderer/genesis.block"
General.Profile.Enabled = false
General.Profile.Address = "0.0.0.0:6060"
General.LocalMSPDir = "/var/hyperledger/orderer/msp"
General.LocalMSPID = "OrdererMSP"
General.BCCSP.ProviderName = "SW"
General.BCCSP.SwOpts.SecLevel = 256
General.BCCSP.SwOpts.HashFamily = "SHA2"
General.BCCSP.SwOpts.Ephemeral = true
General.BCCSP.SwOpts.FileKeystore.KeyStorePath = ""
General.BCCSP.SwOpts.DummyKeystore =
General.BCCSP.SwOpts.InmemKeystore =
General.Authentication.TimeWindow = 15m0s
General.Authentication.NoExpirationChecks = false
FileLedger.Location = "/var/hyperledger/production/orderer"
FileLedger.Prefix = "hyperledger-fabric-ordererledger"
Kafka.Retry.ShortInterval = 5s
Kafka.Retry.ShortTotal = 10m0s
Kafka.Retry.LongInterval = 5m0s
Kafka.Retry.LongTotal = 12h0m0s
Kafka.Retry.NetworkTimeouts.DialTimeout = 10s
Kafka.Retry.NetworkTimeouts.ReadTimeout = 10s
Kafka.Retry.NetworkTimeouts.WriteTimeout = 10s
Kafka.Retry.Metadata.RetryMax = 3
Kafka.Retry.Metadata.RetryBackoff = 250ms
Kafka.Retry.Producer.RetryMax = 3
Kafka.Retry.Producer.RetryBackoff = 100ms
Kafka.Retry.Consumer.RetryBackoff = 2s
Kafka.Verbose = false
Kafka.Version = 0.10.2.0
Kafka.TLS.Enabled = false
Kafka.TLS.PrivateKey = ""
Kafka.TLS.Certificate = ""
Kafka.TLS.RootCAs = []
Kafka.TLS.ClientAuthRequired = false
Kafka.TLS.ClientRootCAs = []
Kafka.SASLPlain.Enabled = false
Kafka.SASLPlain.User = ""
Kafka.SASLPlain.Password = ""
Kafka.Topic.ReplicationFactor = 3
Debug.BroadcastTraceDir = ""
Debug.DeliverTraceDir = ""
Consensus = map[SnapDir:/var/hyperledger/production/orderer/etcdraft/snapshot WALDir:/var/hyperledger/production/orderer/etcdraft/wal]
Operations.ListenAddress = "0.0.0.0:8443"
Operations.TLS.Enabled = false
Operations.TLS.PrivateKey = ""
Operations.TLS.Certificate = ""
Operations.TLS.RootCAs = []
Operations.TLS.ClientAuthRequired = false
Operations.TLS.ClientRootCAs = []
Metrics.Provider = "prometheus"
Metrics.Statsd.Network = "udp"
Metrics.Statsd.Address = "127.0.0.1:8125"
Metrics.Statsd.WriteInterval = 30s
Metrics.Statsd.Prefix = ""
2020-05-19 09:56:17.213 UTC [bccsp] GetDefault -> DEBU 0d6 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2020-05-19 09:56:17.214 UTC [bccsp_sw] createKeyStore -> DEBU 0d7 Creating KeyStore at [/var/hyperledger/orderer/msp/keystore]...
2020-05-19 09:56:17.214 UTC [bccsp_sw] createKeyStore -> DEBU 0d8 KeyStore created at [/var/hyperledger/orderer/msp/keystore].
2020-05-19 09:56:17.214 UTC [bccsp_sw] openKeyStore -> DEBU 0d9 KeyStore opened at [/var/hyperledger/orderer/msp/keystore]...done
2020-05-19 09:56:17.214 UTC [msp] getPemMaterialFromDir -> DEBU 0da Reading directory /var/hyperledger/orderer/msp/signcerts
2020-05-19 09:56:17.214 UTC [orderer.common.server] loadLocalMSP -> PANI 0db Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directory
panic: Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directory****

goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0000ba6e0, 0x0, 0x0, 0x0)
/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:230 +0x545
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc000116220, 0x4, 0x1006f4c, 0x22, 0xc000283530, 0x1, 0x1, 0x0, 0x0, 0x0)
/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x100
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(...)
/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(...)
/go/src/github.com/hyperledger/fabric/common/flogging/zap.go:74
github.com/hyperledger/fabric/orderer/common/server.loadLocalMSP(0xc00019e000, 0xc000166000, 0x0)
/go/src/github.com/hyperledger/fabric/orderer/common/server/main.go:664 +0x10b
github.com/hyperledger/fabric/orderer/common/server.Main()
/go/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x252
main.main()
/go/src/github.com/hyperledger/fabric/cmd/orderer/main.go:15 +0x20

Chaincode Modification

Howdy,

I am wondering how one can modify the chaincode. I was working with fabcar and modified the fabcar.go file and remade the chaincode image to contain the changes. However, upon interacting with the chaincode from the clients, the changes did not take effect. Is the chaincode defined somewhere else?

an error when installing chaincode on peer node

I got an error when installing chaincode on peer node . How should i fix this?

/opt/gopath/src/github.com/hyperledger/chaincode/packaging # peer lifecycle chaincode install marbles-org1.tgz
Error: chaincode install failed with status: 500 - Failed to authorize invocation due to failed ACL check: Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [The identity is not an admin under this MSP [org1MSP]: The identity does not
contain OU [ADMIN], MSP: [org1MSP]]

Deploying HLF 2.2

Hello, I have a question. Can I use this repository to deploy my HLF 2.2 network and let k8s make the management? For example the restore of the pods if something fails? Also, can I use this project to maintain my HLF network after deploying? For example, to extend the number of channels, or orgs, or peers in an easy way?

Got unexpected status BAD_REQUEST on channel creation

Deployed the project on kubernetes 1.19.10 (k3s) cluster and got the following error:

peer channel create -o orderer0:7050 -c mychannel -f ./scripts/channel-artifacts/channel.tx --tls true --cafile $ORDERER_CA
2021-05-11 14:49:44.650 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied

error on kubectl create -f orderer-service/

kubectl logs -n hyperledger orderer0-6455f764fc-ljpv9
2021-02-16 08:11:42.563 UTC [localconfig] completeInitialization -> WARN 001 General.GenesisFile should be replaced by General.BootstrapFile
2021-02-16 08:11:42.563 UTC [localconfig] completeInitialization -> INFO 002 Kafka.Version unset, setting to 0.10.2.0
2021-02-16 08:11:42.563 UTC [orderer.common.server] prettyPrintStruct -> INFO 003 Orderer config values:
General.ListenAddress = "0.0.0.0"
General.ListenPort = 7050
General.TLS.Enabled = true
General.TLS.PrivateKey = "/var/hyperledger/orderer/tls/server.key"
General.TLS.Certificate = "/var/hyperledger/orderer/tls/server.crt"
General.TLS.RootCAs = [/var/hyperledger/orderer/tls/ca.crt]
General.TLS.ClientAuthRequired = false
General.TLS.ClientRootCAs = []
General.Cluster.ListenAddress = ""
General.Cluster.ListenPort = 0
General.Cluster.ServerCertificate = ""
General.Cluster.ServerPrivateKey = ""
General.Cluster.ClientCertificate = "/var/hyperledger/orderer/tls/server.crt"
General.Cluster.ClientPrivateKey = "/var/hyperledger/orderer/tls/server.key"
General.Cluster.RootCAs = [/var/hyperledger/orderer/tls/ca.crt]
General.Cluster.DialTimeout = 5s
General.Cluster.RPCTimeout = 7s
General.Cluster.ReplicationBufferSize = 20971520
General.Cluster.ReplicationPullTimeout = 5s
General.Cluster.ReplicationRetryTimeout = 5s
General.Cluster.ReplicationBackgroundRefreshInterval = 5m0s
General.Cluster.ReplicationMaxRetries = 12
General.Cluster.SendBufferSize = 10
General.Cluster.CertExpirationWarningThreshold = 168h0m0s
General.Cluster.TLSHandshakeTimeShift = 0s
General.Keepalive.ServerMinInterval = 1m0s
General.Keepalive.ServerInterval = 2h0m0s
General.Keepalive.ServerTimeout = 20s
General.ConnectionTimeout = 0s
General.GenesisMethod = "file"
General.GenesisFile = "/var/hyperledger/orderer/genesis.block"
General.BootstrapMethod = "file"
General.BootstrapFile = "/var/hyperledger/orderer/genesis.block"
General.Profile.Enabled = false
General.Profile.Address = "0.0.0.0:6060"
General.LocalMSPDir = "/var/hyperledger/orderer/msp"
General.LocalMSPID = "OrdererMSP"
General.BCCSP.ProviderName = "SW"
General.BCCSP.SwOpts.SecLevel = 256
General.BCCSP.SwOpts.HashFamily = "SHA2"
General.BCCSP.SwOpts.Ephemeral = true
General.BCCSP.SwOpts.FileKeystore.KeyStorePath = ""
General.BCCSP.SwOpts.DummyKeystore =
General.BCCSP.SwOpts.InmemKeystore =
General.Authentication.TimeWindow = 15m0s
General.Authentication.NoExpirationChecks = false
FileLedger.Location = "/var/hyperledger/production/orderer"
FileLedger.Prefix = "hyperledger-fabric-ordererledger"
Kafka.Retry.ShortInterval = 5s
Kafka.Retry.ShortTotal = 10m0s
Kafka.Retry.LongInterval = 5m0s
Kafka.Retry.LongTotal = 12h0m0s
Kafka.Retry.NetworkTimeouts.DialTimeout = 10s
Kafka.Retry.NetworkTimeouts.ReadTimeout = 10s
Kafka.Retry.NetworkTimeouts.WriteTimeout = 10s
Kafka.Retry.Metadata.RetryMax = 3
Kafka.Retry.Metadata.RetryBackoff = 250ms
Kafka.Retry.Producer.RetryMax = 3
Kafka.Retry.Producer.RetryBackoff = 100ms
Kafka.Retry.Consumer.RetryBackoff = 2s
Kafka.Verbose = false
Kafka.Version = 0.10.2.0
Kafka.TLS.Enabled = false
Kafka.TLS.PrivateKey = ""
Kafka.TLS.Certificate = ""
Kafka.TLS.RootCAs = []
Kafka.TLS.ClientAuthRequired = false
Kafka.TLS.ClientRootCAs = []
Kafka.SASLPlain.Enabled = false
Kafka.SASLPlain.User = ""
Kafka.SASLPlain.Password = ""
Kafka.Topic.ReplicationFactor = 3
Debug.BroadcastTraceDir = ""
Debug.DeliverTraceDir = ""
Consensus = map[SnapDir:/var/hyperledger/production/orderer/etcdraft/snapshot WALDir:/var/hyperledger/production/orderer/etcdraft/wal]
Operations.ListenAddress = "0.0.0.0:8443"
Operations.TLS.Enabled = false
Operations.TLS.PrivateKey = ""
Operations.TLS.Certificate = ""
Operations.TLS.RootCAs = []
Operations.TLS.ClientAuthRequired = false
Operations.TLS.ClientRootCAs = []
Metrics.Provider = "prometheus"
Metrics.Statsd.Network = "udp"
Metrics.Statsd.Address = "127.0.0.1:8125"
Metrics.Statsd.WriteInterval = 30s
Metrics.Statsd.Prefix = ""
ChannelParticipation.Enabled = false
ChannelParticipation.RemoveStorage = false
2021-02-16 08:11:42.970 UTC [msp] getPemMaterialFromDir -> WARN 004 Failed reading file /var/hyperledger/orderer/msp/tlscacerts/tlsca.consortium-cert.pem: reading fromfile /var/hyperledger/orderer/msp/tlscacerts/tlsca.consortium-cert.pem failed: could not read file /var/hyperledger/orderer/msp/tlscacerts/tlsca.consortium-cert.pem: read /var/hyperledger/orderer/msp/tlscacerts/tlsca.consortium-cert.pem: interrupted system call
2021-02-16 08:11:43.024 UTC [orderer.common.server] loadLocalMSP -> PANI 005 Failed to setup local msp with config: KeyMaterial not found in SigningIdentityInfo
panic: Failed to setup local msp with config: KeyMaterial not found in SigningIdentityInfo

goroutine 1 [running]:
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0001a7ad0, 0x0, 0x0, 0x0)
/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:230 +0x545
go.uber.org/zap.(*SugaredLogger).log(0xc000010220, 0xc000082104, 0x10275db, 0x29, 0xc0005b9478, 0x1, 0x1, 0x0, 0x0, 0x0)
/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x100
go.uber.org/zap.(*SugaredLogger).Panicf(...)
/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(...)
/go/src/github.com/hyperledger/fabric/common/flogging/zap.go:74
github.com/hyperledger/fabric/orderer/common/server.loadLocalMSP(0xc00014b200, 0xc0003e4e60, 0x0)
/go/src/github.com/hyperledger/fabric/orderer/common/server/main.go:683 +0x314
github.com/hyperledger/fabric/orderer/common/server.Main()
/go/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x252
main.main()
/go/src/github.com/hyperledger/fabric/cmd/orderer/main.go:15 +0x20

peer not able to join channel

Repo is very helpful. Thanks
Was able to set all things up on EKS and ran below commands on org1-cli container

peer channel create -o orderer0:7050 -c mychannel -f ./scripts/channel-artifacts/channel.tx --tls true --cafile $ORDERER_CA
which created mychannel.block

On running
peer channel fetch 0 mychannel.block -c mychannel -o orderer0:7050 --tls --cafile $ORDERER_CA

ERROR:
2021-02-13 17:26:00.882 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: proposal failed (err: rpc error: code = Unknown desc = error validating proposal: access denied: channel [] creator org [org1MSP])

Appreciate your help on above error.

Minikube install chaincode

Hi Pau.

I am using minikube and when I install the chaincode from the "CLI" container using "peer lifecycle chaincode install marbles-org1.tgz" I get:

Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: cannot connect to Docker endpoint
can you help?

I got an error when I installed chaincode

when I execute the command: peer lifecycle chaincode install marbles-org1.tgz, the following error has occurred:
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: cannot connect to Docker endpoint
Can you help me with this? I'd appreciate it.

bug on msp

hello, I have successfully created all the crypto materials, and the hostPath is correct, but i got the following bug:

2020-05-02 15:24:50.192 UTC [orderer.common.server] loadLocalMSP -> PANI 0db Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directory

I have no idea about this,Can you give me some guidance?thx

Orderers Pods are not creating, status CrashLoopBackOff

I am trying to run this using minikube and I have mounted folder manually each command in seperate terminal as I read that in minikube we have to mount all the volumes

eg:

minikube mount /home/storage/orderer:/var/hyperledger/production
minikube mount /home/fabric-external-chaincodes/channel-artifacts/genesis.block:/var/hyperledger/orderer/genesis.block
minikube mount /home/fabric-external-chaincodes/crypto-config/ordererOrganizations/consortium/orderers/orderer0/msp:/var/hyperledger/orderer/msp
minikube mount /home/fabric-external-chaincodes/crypto-config/ordererOrganizations/consortium/orderers/orderer0/tls:/var/hyperledger/orderer/tls
..................................
........................

still I am getting this error, I have attached the complete log of orderer0 in the file as well.
order0-log.txt

2021-01-17 08:00:21.894 UTC [orderer.common.server] loadLocalMSP -> PANI 0dd Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directory
panic: Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directory

PANI 0dd Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts

Yep, same issue here too. Config :
Minikube 1.16 with docker driver
host : ubuntu 20.04

Metrics.Statsd.Network = "udp" Metrics.Statsd.Address = "127.0.0.1:8125" Metrics.Statsd.WriteInterval = 30s Metrics.Statsd.Prefix = "" ChannelParticipation.Enabled = false ChannelParticipation.RemoveStorage = false2020-12-29 15:20:53.618 UTC [bccsp] GetDefault -> DEBU 0d8 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.2020-12-29 15:20:53.618 UTC [bccsp_sw] createKeyStore -> DEBU 0d9 Creating KeyStore at [/var/hyperledger/orderer/msp/keystore]...2020-12-29 15:20:53.618 UTC [bccsp_sw] createKeyStore -> DEBU 0da KeyStore created at [/var/hyperledger/orderer/msp/keystore].2020-12-29 15:20:53.618 UTC [bccsp_sw] openKeyStore -> DEBU 0db KeyStore opened at [/var/hyperledger/orderer/msp/keystore]...done2020-12-29 15:20:53.618 UTC [msp] getPemMaterialFromDir -> DEBU 0dc Reading directory /var/hyperledger/orderer/msp/signcerts2020-12-29 15:20:53.618 UTC [orderer.common.server] loadLocalMSP -> PANI 0dd Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directorypanic: Failed to get local msp config: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directorygoroutine 1 [running]:go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000428000, 0x0, 0x0, 0x0) /go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:230 +0x545go.uber.org/zap.(*SugaredLogger).log(0xc00011e218, 0x4, 0x101e170, 0x22, 0xc0001594a8, 0x1, 0x1, 0x0, 0x0, 0x0) /go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x100go.uber.org/zap.(*SugaredLogger).Panicf(...) /go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(...) /go/src/github.com/hyperledger/fabric/common/flogging/zap.go:74github.com/hyperledger/fabric/orderer/common/server.loadLocalMSP(0xc00019e000, 0xc0001ac050, 0x0) /go/src/github.com/hyperledger/fabric/orderer/common/server/main.go:668 +0x10bgithub.com/hyperledger/fabric/orderer/common/server.Main() /go/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x252main.main() /go/src/github.com/hyperledger/fabric/cmd/orderer/main.go:15 +0x20

I moved the repo folder to /home/julien/fabric-external-chaincodes, the storage in /home/julien/storage and updated all refs in code.

I ran succesfully ./fabricOps.sh start, and I have my cryptomaterial in:

/home/julien/fabric-external-chaincodes/crypto-config/ordererOrganizations/consortium/orderers/orderer0/msp/signcerts/orderer0-cert.pem

which is coherent with yaml :

- name: orderer-claim1
          hostPath:
            path: /home/julien/fabric-external-chaincodes/crypto-config/ordererOrganizations/consortium/orderers/orderer0/msp

So it should have a:

/var/hyperledger/orderer/msp/signcerts/orderer0-cert.pem

I notice there is no volumes created like orderer1-persistentdata, and directory /home/julien/storage/orderer0 has not been created

Repo license

Thanks a lot for this tutorial and the detailed intructions, it's very helpful ! Could you include a license file in the repo ?

Error during deployment of orderers

The creation is fine but when I type kubectl get pods -n hyperledger, I get:
orderer0-5c4b9dc9dd-f8jcr 0/1 CrashLoopBackOff 11 32m
orderer1-6995df9695-vtmhc 0/1 CrashLoopBackOff 11 32m
orderer2-84c77cc48d-wcw7c 0/1 CrashLoopBackOff 11 32m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.