Fetch the repository succeeded.
/*
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,
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。