1 Star 0 Fork 0

BUPT-ZKJC/fabric

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
components.go 1.56 KB
Copy Edit Raw Blame History
MJL authored 2021-08-06 18:37 +08:00 . first commit
/*
Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package nwo
import (
"fmt"
"io/ioutil"
"net/http"
"gitee.com/bupt-zkjc/fabric/integration/runner"
. "github.com/onsi/gomega"
)
type Components struct {
ServerAddress string `json:"server_address"`
}
func (c *Components) ConfigTxGen() string {
return c.Build("gitee.com/bupt-zkjc/fabric/cmd/configtxgen")
}
func (c *Components) Cryptogen() string {
return c.Build("gitee.com/bupt-zkjc/fabric/cmd/cryptogen")
}
func (c *Components) Discover() string {
return c.Build("gitee.com/bupt-zkjc/fabric/cmd/discover")
}
func (c *Components) Idemixgen() string {
return c.Build("gitee.com/bupt-zkjc/fabric/cmd/idemixgen")
}
func (c *Components) Orderer() string {
return c.Build("gitee.com/bupt-zkjc/fabric/cmd/orderer")
}
func (c *Components) Peer() string {
return c.Build("gitee.com/bupt-zkjc/fabric/cmd/peer")
}
func (c *Components) Cleanup() {}
func (c *Components) Build(path string) string {
Expect(c.ServerAddress).NotTo(BeEmpty(), "build server address is empty")
resp, err := http.Get(fmt.Sprintf("http://%s/%s", c.ServerAddress, path))
Expect(err).NotTo(HaveOccurred())
body, err := ioutil.ReadAll(resp.Body)
Expect(err).NotTo(HaveOccurred())
if resp.StatusCode != http.StatusOK {
Expect(resp.StatusCode).To(Equal(http.StatusOK), fmt.Sprintf("%s", body))
}
return string(body)
}
const CCEnvDefaultImage = "hyperledger/fabric-ccenv:latest"
var RequiredImages = []string{
CCEnvDefaultImage,
runner.CouchDBDefaultImage,
runner.KafkaDefaultImage,
runner.ZooKeeperDefaultImage,
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bupt-zkjc/fabric.git
git@gitee.com:bupt-zkjc/fabric.git
bupt-zkjc
fabric
fabric
98d302355562

Search