MCPcopy
hub / github.com/hyperledger/fabric / removeConsenter

Function removeConsenter

integration/raft/config_test.go:2014–2026  ·  view source on GitHub ↗

removeConsenter removes a consenter with the given certificate in PEM format from the given channel.

(n *nwo.Network, peer *nwo.Peer, orderer *nwo.Orderer, channel string, certificate []byte)

Source from the content-addressed store, hash-verified

2012// removeConsenter removes a consenter with the given certificate in PEM format
2013// from the given channel.
2014func removeConsenter(n *nwo.Network, peer *nwo.Peer, orderer *nwo.Orderer, channel string, certificate []byte) {
2015 updateEtcdRaftMetadata(n, peer, orderer, channel, func(metadata *etcdraft.ConfigMetadata) {
2016 var newConsenters []*etcdraft.Consenter
2017 for _, consenter := range metadata.Consenters {
2018 if bytes.Equal(consenter.ClientTlsCert, certificate) || bytes.Equal(consenter.ServerTlsCert, certificate) {
2019 continue
2020 }
2021 newConsenters = append(newConsenters, consenter)
2022 }
2023
2024 metadata.Consenters = newConsenters
2025 })
2026}
2027
2028// updateEtcdRaftMetadata executes a config update that updates the etcdraft
2029// metadata according to the given function f.

Callers 2

config_test.goFile · 0.85
cft_test.goFile · 0.85

Calls 2

updateEtcdRaftMetadataFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected