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)
| 2012 | // removeConsenter removes a consenter with the given certificate in PEM format |
| 2013 | // from the given channel. |
| 2014 | func 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. |
no test coverage detected