1 Star 0 Fork 0

陈文甲/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
discover.go 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package commands
type Peers struct {
UserCert string
UserKey string
MSPID string
Server string
Channel string
}
func (p Peers) SessionName() string {
return "discover-peers"
}
func (p Peers) Args() []string {
return []string{
"--userCert", p.UserCert,
"--userKey", p.UserKey,
"--MSP", p.MSPID,
"peers",
"--server", p.Server,
"--channel", p.Channel,
}
}
type Config struct {
UserCert string
UserKey string
MSPID string
Server string
Channel string
}
func (c Config) SessionName() string {
return "discover-config"
}
func (c Config) Args() []string {
return []string{
"--userCert", c.UserCert,
"--userKey", c.UserKey,
"--MSP", c.MSPID,
"config",
"--server", c.Server,
"--channel", c.Channel,
}
}
type Endorsers struct {
UserCert string
UserKey string
MSPID string
Server string
Channel string
Chaincode string
Chaincodes []string
Collection string
Collections []string
}
func (e Endorsers) SessionName() string {
return "discover-endorsers"
}
func (e Endorsers) Args() []string {
args := []string{
"--userCert", e.UserCert,
"--userKey", e.UserKey,
"--MSP", e.MSPID,
"endorsers",
"--server", e.Server,
"--channel", e.Channel,
}
if e.Chaincode != "" {
args = append(args, "--chaincode", e.Chaincode)
}
for _, cc := range e.Chaincodes {
args = append(args, "--chaincode", cc)
}
if e.Collection != "" {
args = append(args, "--collection", e.Collection)
}
for _, c := range e.Collections {
args = append(args, "--collection", c)
}
return args
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/venjia/fabric.git
git@gitee.com:venjia/fabric.git
venjia
fabric
fabric
v1.4.8

搜索帮助

0d507c66 1850385 C8b1a773 1850385