fabric: github.com/hyperledger/fabric/core/container/dockercontroller Index | Files | Directories

package dockercontroller

import "github.com/hyperledger/fabric/core/container/dockercontroller"


Package Files

dockercontroller.go metrics.go


const (
    // Mutual TLS auth client key and cert paths in the chaincode container
    TLSClientKeyPath      string = "/etc/hyperledger/fabric/client.key"
    TLSClientCertPath     string = "/etc/hyperledger/fabric/client.crt"
    TLSClientKeyFile      string = "/etc/hyperledger/fabric/client_pem.key"
    TLSClientCertFile     string = "/etc/hyperledger/fabric/client_pem.crt"
    TLSClientRootCertFile string = "/etc/hyperledger/fabric/peer.crt"

type BuildMetrics Uses

type BuildMetrics struct {
    ChaincodeImageBuildDuration metrics.Histogram

func NewBuildMetrics Uses

func NewBuildMetrics(p metrics.Provider) *BuildMetrics

type ContainerInstance Uses

type ContainerInstance struct {
    CCID     string
    Type     string
    DockerVM *DockerVM

func (*ContainerInstance) ChaincodeServerInfo Uses

func (ci *ContainerInstance) ChaincodeServerInfo() (*ccintf.ChaincodeServerInfo, error)

func (*ContainerInstance) Start Uses

func (ci *ContainerInstance) Start(peerConnection *ccintf.PeerConnection) error

func (*ContainerInstance) Stop Uses

func (ci *ContainerInstance) Stop() error

func (*ContainerInstance) Wait Uses

func (ci *ContainerInstance) Wait() (int, error)

type DockerVM Uses

type DockerVM struct {
    PeerID          string
    NetworkID       string
    BuildMetrics    *BuildMetrics
    HostConfig      *docker.HostConfig
    Client          dockerClient
    AttachStdOut    bool
    ChaincodePull   bool
    NetworkMode     string
    PlatformBuilder PlatformBuilder
    LoggingEnv      []string
    MSPID           string

DockerVM is a vm. It is identified by an image id

func (*DockerVM) Build Uses

func (vm *DockerVM) Build(ccid string, metadata *persistence.ChaincodePackageMetadata, codePackage io.Reader) (container.Instance, error)

Build is responsible for building an image if it does not already exist.

func (*DockerVM) GetArgs Uses

func (vm *DockerVM) GetArgs(ccType string, peerAddress string) ([]string, error)

func (*DockerVM) GetEnv Uses

func (vm *DockerVM) GetEnv(ccid string, tlsConfig *ccintf.TLSConfig) []string

func (*DockerVM) GetVMName Uses

func (vm *DockerVM) GetVMName(ccid string) string

GetVMName generates the VM name from peer information. It accepts a format function parameter to allow different formatting based on the desired use of the name.

func (*DockerVM) GetVMNameForDocker Uses

func (vm *DockerVM) GetVMNameForDocker(ccid string) (string, error)

GetVMNameForDocker formats the docker image from peer information. This is needed to keep image (repository) names unique in a single host, multi-peer environment (such as a development environment). It computes the hash for the supplied image name and then appends it to the lowercase image name to ensure uniqueness.

func (*DockerVM) HealthCheck Uses

func (vm *DockerVM) HealthCheck(ctx context.Context) error

HealthCheck checks if the DockerVM is able to communicate with the Docker daemon.

func (*DockerVM) Start Uses

func (vm *DockerVM) Start(ccid string, ccType string, peerConnection *ccintf.PeerConnection) error

Start starts a container using a previously created docker image

func (*DockerVM) Stop Uses

func (vm *DockerVM) Stop(ccid string) error

Stop stops a running chaincode

func (*DockerVM) Wait Uses

func (vm *DockerVM) Wait(ccid string) (int, error)

Wait blocks until the container stops and returns the exit code of the container.

type PlatformBuilder Uses

type PlatformBuilder interface {
    GenerateDockerBuild(ccType, path string, codePackage io.Reader) (io.Reader, error)


mockCode generated by counterfeiter.

Package dockercontroller imports 22 packages (graph) and is imported by 50 packages. Updated 2020-07-11. Refresh now. Tools for package owners.