{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package nwo\n\n## Constants\n\n```go\nconst DefaultConfigTxTemplate = `---\n{{ with $w := . -}}\nOrganizations:{{ range .PeerOrgs }}\n- \u0026{{ .MSPID }}\n  Name: {{ .Name }}\n  ID: {{ .MSPID }}\n  MSPDir: {{ $w.PeerOrgMSPDir . }}\n  Policies:\n    Readers:\n      Type: Signature\n      Rule: OR('{{.MSPID}}.admin', '{{.MSPID}}.peer', '{{.MSPID}}.client')\n    Writers:\n      Type: Signature\n      Rule: OR('{{.MSPID}}.admin', '{{.MSPID}}.client')\n    Admins:\n      Type: Signature\n      Rule: OR('{{.MSPID}}.admin')\n  AnchorPeers:{{ range $w.AnchorsInOrg .Name }}\n  - Host: 127.0.0.1\n    Port: {{ $w.PeerPort . \"Listen\" }}\n  {{- end }}\n{{- end }}\n{{- range .OrdererOrgs }}\n- \u0026{{ .MSPID }}\n  Name: {{ .Name }}\n  ID: {{ .MSPID }}\n  MSPDir: {{ $w.OrdererOrgMSPDir . }}\n  Policies:\n    Readers:\n      Type: Signature\n      Rule: OR('{{.MSPID}}.member')\n    Writers:\n      Type: Signature\n      Rule: OR('{{.MSPID}}.member')\n    Admins:\n      Type: Signature\n      Rule: OR('{{.MSPID}}.admin')\n  OrdererEndpoints:{{ range $w.OrderersInOrg .Name }}\n  - 127.0.0.1:{{ $w.OrdererPort . \"Listen\" }}\n  {{- end }}\n{{ end }}\n\nChannel: \u0026ChannelDefaults\n  Capabilities:\n    V1_4_3: true\n  Policies:\n    Readers:\n      Type: ImplicitMeta\n      Rule: ANY Readers\n    Writers:\n      Type: ImplicitMeta\n      Rule: ANY Writers\n    Admins:\n      Type: ImplicitMeta\n      Rule: MAJORITY Admins\n\nProfiles:{{ range .Profiles }}\n  {{ .Name }}:\n    \u003c\u003c: *ChannelDefaults\n    {{- if .Orderers }}\n    Orderer:\n      OrdererType: {{ $w.Consensus.Type }}\n      BatchTimeout: 1s\n      BatchSize:\n        MaxMessageCount: 1\n        AbsoluteMaxBytes: 98 MB\n        PreferredMaxBytes: 512 KB\n      Capabilities:\n        V1_1: true\n\n      {{- if eq $w.Consensus.Type \"kafka\" }}\n      Kafka:\n        Brokers:{{ range $w.BrokerAddresses \"HostPort\" }}\n        - {{ . }}\n        {{- end }}\n      {{- end }}\n      {{- if eq $w.Consensus.Type \"etcdraft\" }}\n      EtcdRaft:\n        Options:\n          TickInterval: 500ms\n          SnapshotIntervalSize: 1 KB\n        Consenters:{{ range .Orderers }}{{ with $w.Orderer . }}\n        - Host: 127.0.0.1\n          Port: {{ $w.OrdererPort . \"Cluster\" }}\n          ClientTLSCert: {{ $w.OrdererLocalCryptoDir . \"tls\" }}/server.crt\n          ServerTLSCert: {{ $w.OrdererLocalCryptoDir . \"tls\" }}/server.crt\n        {{- end }}{{- end }}\n      {{- end }}\n      Organizations:{{ range $w.OrgsForOrderers .Orderers }}\n      - *{{ .MSPID }}\n      {{- end }}\n      Policies:\n        Readers:\n          Type: ImplicitMeta\n          Rule: ANY Readers\n        Writers:\n          Type: ImplicitMeta\n          Rule: ANY Writers\n        Admins:\n          Type: ImplicitMeta\n          Rule: MAJORITY Admins\n        BlockValidation:\n          Type: ImplicitMeta\n          Rule: ANY Writers\n    {{- end }}\n    {{- if .Consortium }}\n    Consortium: {{ .Consortium }}\n    Application:\n      Capabilities:\n        V1_3: true\n        CAPABILITY_PLACEHOLDER: false\n      Organizations:{{ range .Organizations }}\n      - *{{ ($w.Organization .).MSPID }}\n      {{- end}}\n      Policies:\n        Readers:\n          Type: ImplicitMeta\n          Rule: ANY Readers\n        Writers:\n          Type: ImplicitMeta\n          Rule: ANY Writers\n        Admins:\n          Type: ImplicitMeta\n          Rule: MAJORITY Admins\n        LifecycleEndorsement:\n          Type: ImplicitMeta\n          Rule: \"MAJORITY Endorsement\"\n        Endorsement:\n          Type: ImplicitMeta\n          Rule: \"MAJORITY Endorsement\"\n    {{- else }}\n    Consortiums:{{ range $w.Consortiums }}\n      {{ .Name }}:\n        Organizations:{{ range .Organizations }}\n        - *{{ ($w.Organization .).MSPID }}\n        {{- end }}\n    {{- end }}\n    {{- end }}\n{{- end }}\n{{ end }}\n`\n```\n\n```go\nconst DefaultCoreTemplate = `---\nlogging:\n  format: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -\u003e %{level:.4s} %{id:03x}%{color:reset} %{message}'\n\npeer:\n  id: {{ Peer.ID }}\n  networkId: {{ .NetworkID }}\n  address: 127.0.0.1:{{ .PeerPort Peer \"Listen\" }}\n  addressAutoDetect: true\n  listenAddress: 127.0.0.1:{{ .PeerPort Peer \"Listen\" }}\n  chaincodeListenAddress: 0.0.0.0:{{ .PeerPort Peer \"Chaincode\" }}\n  gomaxprocs: -1\n  keepalive:\n    minInterval: 60s\n    client:\n      interval: 60s\n      timeout: 20s\n    deliveryClient:\n      interval: 60s\n      timeout: 20s\n  gossip:\n    bootstrap: 127.0.0.1:{{ .PeerPort Peer \"Listen\" }}\n    useLeaderElection: true\n    orgLeader: false\n    endpoint:\n    maxBlockCountToStore: 100\n    maxPropagationBurstLatency: 10ms\n    maxPropagationBurstSize: 10\n    propagateIterations: 1\n    propagatePeerNum: 3\n    pullInterval: 4s\n    pullPeerNum: 3\n    requestStateInfoInterval: 4s\n    publishStateInfoInterval: 4s\n    stateInfoRetentionInterval:\n    publishCertPeriod: 10s\n    dialTimeout: 3s\n    connTimeout: 2s\n    recvBuffSize: 20\n    sendBuffSize: 200\n    digestWaitTime: 1s\n    requestWaitTime: 1500ms\n    responseWaitTime: 2s\n    aliveTimeInterval: 5s\n    aliveExpirationTimeout: 25s\n    reconnectInterval: 25s\n    externalEndpoint: 127.0.0.1:{{ .PeerPort Peer \"Listen\" }}\n    election:\n      startupGracePeriod: 15s\n      membershipSampleInterval: 1s\n      leaderAliveThreshold: 10s\n      leaderElectionDuration: 5s\n    pvtData:\n      pullRetryThreshold: 60s\n      transientstoreMaxBlockRetention: 1000\n      pushAckTimeout: 3s\n      reconcileBatchSize: 10\n      reconcileSleepInterval: 10s\n      reconciliationEnabled: true\n  events:\n    address: 127.0.0.1:{{ .PeerPort Peer \"Events\" }}\n    buffersize: 100\n    timeout: 10ms\n    timewindow: 15m\n    keepalive:\n      minInterval: 60s\n  tls:\n    enabled:  true\n    clientAuthRequired: false\n    cert:\n      file: {{ .PeerLocalTLSDir Peer }}/server.crt\n    key:\n      file: {{ .PeerLocalTLSDir Peer }}/server.key\n    rootcert:\n      file: {{ .PeerLocalTLSDir Peer }}/ca.crt\n    clientRootCAs:\n      files:\n      - {{ .PeerLocalTLSDir Peer }}/ca.crt\n  authentication:\n    timewindow: 15m\n  fileSystemPath: filesystem\n  BCCSP:\n    Default: SW\n    SW:\n      Hash: SHA2\n      Security: 256\n      FileKeyStore:\n        KeyStore:\n  mspConfigPath: {{ .PeerLocalMSPDir Peer }}\n  localMspId: {{ (.Organization Peer.Organization).MSPID }}\n  deliveryclient:\n    reconnectTotalTimeThreshold: 3600s\n  localMspType: bccsp\n  profile:\n    enabled:     false\n    listenAddress: 127.0.0.1:{{ .PeerPort Peer \"ProfilePort\" }}\n  adminService:\n    listenAddress: 127.0.0.1:{{ .PeerPort Peer \"AdminServicePort\" }}\n  handlers:\n    authFilters:\n    - name: DefaultAuth\n    - name: ExpirationCheck\n    decorators:\n    - name: DefaultDecorator\n    endorsers:\n      escc:\n        name: DefaultEndorsement\n    validators:\n      vscc:\n        name: DefaultValidation\n  validatorPoolSize:\n  discovery:\n    enabled: true\n    authCacheEnabled: true\n    authCacheMaxSize: 1000\n    authCachePurgeRetentionRatio: 0.75\n    orgMembersAllowedAccess: false\n\nvm:\n  endpoint: unix:///var/run/docker.sock\n  docker:\n    tls:\n      enabled: false\n      ca:\n        file: docker/ca.crt\n      cert:\n        file: docker/tls.crt\n      key:\n        file: docker/tls.key\n    attachStdout: true\n    hostConfig:\n      NetworkMode: host\n      LogConfig:\n        Type: json-file\n        Config:\n          max-size: \"50m\"\n          max-file: \"5\"\n      Memory: 2147483648\n\nchaincode:\n  builder: $(DOCKER_NS)/fabric-ccenv:$(ARCH)-$(PROJECT_VERSION)\n  pull: false\n  golang:\n    runtime: $(BASE_DOCKER_NS)/fabric-baseos:$(ARCH)-$(BASE_VERSION)\n    dynamicLink: false\n  car:\n    runtime: $(BASE_DOCKER_NS)/fabric-baseos:$(ARCH)-$(BASE_VERSION)\n  java:\n    runtime: $(DOCKER_NS)/fabric-javaenv:$(ARCH)-$(PROJECT_VERSION)\n  node:\n      runtime: $(BASE_DOCKER_NS)/fabric-baseimage:$(ARCH)-$(BASE_VERSION)\n  startuptimeout: 300s\n  executetimeout: 30s\n  mode: net\n  keepalive: 0\n  system:\n    cscc: enable\n    lscc: enable\n    qscc: enable\n  systemPlugins:\n  logging:\n    level:  info\n    shim:   warning\n    format: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -\u003e %{level:.4s} %{id:03x}%{color:reset} %{message}'\n\nledger:\n  blockchain:\n  state:\n    stateDatabase: goleveldb\n    couchDBConfig:\n      couchDBAddress: 127.0.0.1:5984\n      username:\n      password:\n      maxRetries: 3\n      maxRetriesOnStartup: 10\n      requestTimeout: 35s\n      queryLimit: 10000\n      maxBatchUpdateSize: 1000\n      warmIndexesAfterNBlocks: 1\n  history:\n    enableHistoryDatabase: true\n\noperations:\n  listenAddress: 127.0.0.1:{{ .PeerPort Peer \"Operations\" }}\n  tls:\n    enabled: true\n    cert:\n      file: {{ .PeerLocalTLSDir Peer }}/server.crt\n    key:\n      file: {{ .PeerLocalTLSDir Peer }}/server.key\n    clientAuthRequired: false\n    clientRootCAs:\n      files:\n      - {{ .PeerLocalTLSDir Peer }}/ca.crt\nmetrics:\n  provider: {{ .MetricsProvider }}\n  statsd:\n    network: udp\n    address: {{ if .StatsdEndpoint }}{{ .StatsdEndpoint }}{{ else }}127.0.0.1:8125{{ end }}\n    writeInterval: 5s\n    prefix: {{ ReplaceAll (ToLower Peer.ID) \".\" \"_\" }}\n`\n```\n\n```go\nconst DefaultCryptoTemplate = `---\n{{ with $w := . -}}\nOrdererOrgs:{{ range .OrdererOrgs }}\n- Name: {{ .Name }}\n  Domain: {{ .Domain }}\n  EnableNodeOUs: {{ .EnableNodeOUs }}\n  {{- if .CA }}\n  CA:{{ if .CA.Hostname }}\n    Hostname: {{ .CA.Hostname }}\n  {{- end -}}\n  {{- end }}\n  Specs:{{ range $w.OrderersInOrg .Name }}\n  - Hostname: {{ .Name }}\n    SANS:\n    - localhost\n    - 127.0.0.1\n    - ::1\n  {{- end }}\n{{- end }}\n\nPeerOrgs:{{ range .PeerOrgs }}\n- Name: {{ .Name }}\n  Domain: {{ .Domain }}\n  EnableNodeOUs: {{ .EnableNodeOUs }}\n  {{- if .CA }}\n  CA:{{ if .CA.Hostname }}\n    hostname: {{ .CA.Hostname }}\n    SANS:\n    - localhost\n    - 127.0.0.1\n    - ::1\n  {{- end }}\n  {{- end }}\n  Users:\n    Count: {{ .Users }}\n  Specs:{{ range $w.PeersInOrg .Name }}\n  - Hostname: {{ .Name }}\n    SANS:\n    - localhost\n    - 127.0.0.1\n    - ::1\n  {{- end }}\n{{- end }}\n{{- end }}\n`\n```\n\n```go\nconst DefaultOrdererTemplate = `---\n{{ with $w := . -}}\nGeneral:\n  LedgerType: file\n  ListenAddress: 127.0.0.1\n  ListenPort: {{ .OrdererPort Orderer \"Listen\" }}\n  TLS:\n    Enabled: true\n    PrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key\n    Certificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt\n    RootCAs:\n    -  {{ $w.OrdererLocalTLSDir Orderer }}/ca.crt\n    ClientAuthRequired: false\n    ClientRootCAs:\n  Cluster:\n    ClientCertificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt\n    ClientPrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key\n    ServerCertificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt\n    ServerPrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key\n    DialTimeout: 5s\n    RPCTimeout: 7s\n    ReplicationBufferSize: 20971520\n    ReplicationPullTimeout: 5s\n    ReplicationRetryTimeout: 5s\n    ListenAddress: 127.0.0.1\n    ListenPort: {{ .OrdererPort Orderer \"Cluster\" }}\n  Keepalive:\n    ServerMinInterval: 60s\n    ServerInterval: 7200s\n    ServerTimeout: 20s\n  GenesisMethod: file\n  GenesisProfile: {{ .SystemChannel.Profile }}\n  GenesisFile: {{ .RootDir }}/{{ .SystemChannel.Name }}_block.pb\n  SystemChannel: {{ .SystemChannel.Name }}\n  LocalMSPDir: {{ $w.OrdererLocalMSPDir Orderer }}\n  LocalMSPID: {{ ($w.Organization Orderer.Organization).MSPID }}\n  Profile:\n    Enabled: false\n    Address: 127.0.0.1:{{ .OrdererPort Orderer \"Profile\" }}\n  BCCSP:\n    Default: SW\n    SW:\n      Hash: SHA2\n      Security: 256\n      FileKeyStore:\n        KeyStore:\n  Authentication:\n    TimeWindow: 15m\nFileLedger:\n  Location: {{ .OrdererDir Orderer }}/system\n  Prefix: hyperledger-fabric-ordererledger\nRAMLedger:\n  HistorySize: 1000\n{{ if eq .Consensus.Type \"kafka\" -}}\nKafka:\n  Retry:\n    ShortInterval: 5s\n    ShortTotal: 10m\n    LongInterval: 5m\n    LongTotal: 12h\n    NetworkTimeouts:\n      DialTimeout: 10s\n      ReadTimeout: 10s\n      WriteTimeout: 10s\n    Metadata:\n      RetryBackoff: 250ms\n      RetryMax: 3\n    Producer:\n      RetryBackoff: 100ms\n      RetryMax: 3\n    Consumer:\n      RetryBackoff: 2s\n  Topic:\n    ReplicationFactor: 1\n  Verbose: false\n  TLS:\n    Enabled: false\n    PrivateKey:\n    Certificate:\n    RootCAs:\n  SASLPlain:\n    Enabled: false\n    User:\n    Password:\n  Version:{{ end }}\nDebug:\n  BroadcastTraceDir:\n  DeliverTraceDir:\nConsensus:\n  WALDir: {{ .OrdererDir Orderer }}/etcdraft/wal\n  SnapDir: {{ .OrdererDir Orderer }}/etcdraft/snapshot\n  EvictionSuspicion: 10s\nOperations:\n  ListenAddress: 127.0.0.1:{{ .OrdererPort Orderer \"Operations\" }}\n  TLS:\n    Enabled: true\n    PrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key\n    Certificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt\n    RootCAs:\n    -  {{ $w.OrdererLocalTLSDir Orderer }}/ca.crt\n    ClientAuthRequired: false\n    ClientRootCAs:\n    -  {{ $w.OrdererLocalTLSDir Orderer }}/ca.crt\nMetrics:\n  Provider: {{ .MetricsProvider }}\n  Statsd:\n    Network: udp\n    Address: {{ if .StatsdEndpoint }}{{ .StatsdEndpoint }}{{ else }}127.0.0.1:8125{{ end }}\n    WriteInterval: 5s\n    Prefix: {{ ReplaceAll (ToLower Orderer.ID) \".\" \"_\" }}\n{{- end }}\n`\n```\n\n## Variables\n\n```go\nvar RequiredImages = []string{\n\tfmt.Sprintf(\"hyperledger/fabric-ccenv:%s-latest\", runtime.GOARCH),\n\trunner.CouchDBDefaultImage,\n\trunner.KafkaDefaultImage,\n\trunner.ZooKeeperDefaultImage,\n}\n```\n\n## Functions\n\n```go\nfunc AddConsenter(n *Network, peer *Peer, orderer *Orderer, channel string, consenter ectdraft_protos.Consenter)\n```\nAddConsenter adds a new consenter to the given channel\n\n```go\nfunc ComputeUpdateOrdererConfig(updateFile string, n *Network, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Orderer)\n```\n\n```go\nfunc ConnectsToOrderer(c Command) bool\n```\n\n```go\nfunc CurrentConfigBlockNumber(n *Network, peer *Peer, orderer *Orderer, channel string) uint64\n```\nCurrentConfigBlockNumber retrieves the block number from the header of the current config block. This can be used to detect when configuration change has completed. If an orderer is not provided, the current config block will be fetched from the peer.\n\n```go\nfunc CurrentConfigBlockNumberFromPeer(n *Network, peer *Peer, channel, output string) uint64\n```\nCurrentConfigBlockNumberFromPeer retrieves the block number from the header of the peer's current config block.\n\n```go\nfunc DeployChaincode(n *Network, channel string, orderer *Orderer, chaincode Chaincode, peers ...*Peer)\n```\nDeployChaincode is a helper that will install chaincode to all peers that are connected to the specified channel, instantiate the chaincode on one of the peers, and wait for the instantiation to complete on all of the peers.\n\nNOTE: This helper should not be used to deploy the same chaincode on multiple channels as the install will fail on subsequent calls. Instead, simply use InstantiateChaincode().\n\n```go\nfunc DiscoverPeers(n *Network, p *Peer, user, channelName string) func() []DiscoveredPeer\n```\nrunning discovery service command discover peers against peer using channel name and user as specified in the function arguments. return a slice of the discovered peers\n\n```go\nfunc EnableCapabilities(network *Network, channel, capabilitiesGroup, capabilitiesVersion string, orderer *Orderer, peers ...*Peer)\n```\nEnableCapabilities enables a specific capabilities flag for a running network. It generates the config update using the first peer, signs the configuration with the subsequent peers, and then submits the config update using the first peer.\n\n```go\nfunc EnableCapabilitiesOrdererAdmin(network *Network, channel, capabilitiesGroup, capabilitiesVersion string, orderer *Orderer, peer *Peer, additionalSigners ...*Orderer)\n```\nEnableCapabilitiesOrdererAdmin enables a specific capabilities flag for a running network, using an Orderer Admin Session. This is required to make changes on the system channel, for example.\n\n```go\nfunc EnsureInstantiated(n *Network, channel, name, version string, peers ...*Peer)\n```\n\n```go\nfunc FetchConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string, output string)\n```\nFetchConfigBlock fetches latest config block.\n\n```go\nfunc GetConfig(n *Network, peer *Peer, orderer *Orderer, channel string) *common.Config\n```\nGetConfig retrieves the last config of the given channel\n\n```go\nfunc GetConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string) *common.Block\n```\nGetConfigBlock retrieves the current config block for a channel\n\n```go\nfunc InstallChaincode(n *Network, chaincode Chaincode, peers ...*Peer)\n```\n\n```go\nfunc InstantiateChaincode(n *Network, channel string, orderer *Orderer, chaincode Chaincode, peer *Peer, checkPeers ...*Peer)\n```\n\n```go\nfunc NewCommand(path string, command Command) *exec.Cmd\n```\n\n```go\nfunc PackageChaincode(n *Network, chaincode Chaincode, peer *Peer)\n```\n\n```go\nfunc RemoveConsenter(n *Network, peer *Peer, orderer *Orderer, channel string, certificate []byte)\n```\nRemoveConsenter removes a consenter with the given certificate in PEM format from the given channel\n\n```go\nfunc UnmarshalBlockFromFile(blockFile string) *common.Block\n```\nUnmarshalBlockFromFile unmarshals a proto encoded block from a file.\n\n```go\nfunc UpdateConfig(n *Network, orderer *Orderer, channel string, current, updated *common.Config, getConfigBlockFromOrderer bool, submitter *Peer, additionalSigners ...*Peer)\n```\nUpdateConfig computes, signs, and submits a configuration update and waits for the update to complete.\n\n```go\nfunc UpdateConsensusMetadata(network *Network, peer *Peer, orderer *Orderer, channel string, mutateMetadata ConsensusMetadataMutator)\n```\nUpdateConsensusMetadata executes a config update that updates the consensus metadata according to the given ConsensusMetadataMutator\n\n```go\nfunc UpdateEtcdRaftMetadata(network *Network, peer *Peer, orderer *Orderer, channel string, f func(md *ectdraft_protos.ConfigMetadata))\n```\nUpdateEtcdRaftMetadata executes a config update that updates the etcdraft metadata according to the given function f\n\n```go\nfunc UpdateOrdererConfig(n *Network, orderer *Orderer, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Orderer)\n```\nUpdateOrdererConfig computes, signs, and submits a configuration update which requires orderers signature and waits for the update to complete.\n\n```go\nfunc UpdateOrdererConfigFail(n *Network, orderer *Orderer, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Orderer)\n```\nUpdateOrdererConfigFail computes, signs, and submits a configuration update which requires orderers signature and waits for the update to FAIL.\n\n```go\nfunc UpgradeChaincode(n *Network, channel string, orderer *Orderer, chaincode Chaincode, peers ...*Peer)\n```\n\n## Types\n\n```go\ntype CA struct {\n\tHostname string `yaml:\"hostname,omitempty\"`\n}\n```\n\n```go\ntype Chaincode struct {\n\tName              string\n\tVersion           string\n\tPath              string\n\tCtor              string\n\tPolicy            string\n\tLang              string\n\tCollectionsConfig string // optional\n\tPackageFile       string\n}\n```\n\n```go\ntype Channel struct {\n\tName        string `yaml:\"name,omitempty\"`\n\tProfile     string `yaml:\"profile,omitempty\"`\n\tBaseProfile string `yaml:\"baseprofile,omitempty\"`\n}\n```\nChannel associates a channel name with a configtxgen profile name.\n\n```go\ntype Command interface {\n\tArgs() []string\n\tSessionName() string\n}\n```\n\n```go\ntype Components struct {\n\tPaths map[string]string\n}\n```\n\n```go\nfunc (c *Components) Build(args ...string)\n```\n\n```go\nfunc (c *Components) Cleanup()\n```\n\n```go\nfunc (c *Components) ConfigTxGen() string\n```\n\n```go\nfunc (c *Components) Cryptogen() string\n```\n\n```go\nfunc (c *Components) Discover() string\n```\n\n```go\nfunc (c *Components) Idemixgen() string\n```\n\n```go\nfunc (c *Components) Orderer() string\n```\n\n```go\nfunc (c *Components) Peer() string\n```\n\n```go\ntype Config struct {\n\tOrganizations []*Organization `yaml:\"organizations,omitempty\"`\n\tConsortiums   []*Consortium   `yaml:\"consortiums,omitempty\"`\n\tSystemChannel *SystemChannel  `yaml:\"system_channel,omitempty\"`\n\tChannels      []*Channel      `yaml:\"channels,omitempty\"`\n\tConsensus     *Consensus      `yaml:\"consensus,omitempty\"`\n\tOrderers      []*Orderer      `yaml:\"orderers,omitempty\"`\n\tPeers         []*Peer         `yaml:\"peers,omitempty\"`\n\tProfiles      []*Profile      `yaml:\"profiles,omitempty\"`\n\tTemplates     *Templates      `yaml:\"templates,omitempty\"`\n}\n```\nConfig holds the basic information needed to generate fabric configuration files.\n\n```go\nfunc BasicEtcdRaft() *Config\n```\n\n```go\nfunc BasicKafka() *Config\n```\n\n```go\nfunc BasicSolo() *Config\n```\n\n```go\nfunc MinimalRaft() *Config\n```\n\n```go\nfunc MultiChannelEtcdRaft() *Config\n```\n\n```go\nfunc MultiNodeEtcdRaft() *Config\n```\n\n```go\nfunc (c *Config) RemovePeer(orgName, peerName string)\n```\n\n```go\ntype Consensus struct {\n\tType       string `yaml:\"type,omitempty\"`\n\tBrokers    int    `yaml:\"brokers,omitempty\"`\n\tZooKeepers int    `yaml:\"zookeepers,omitempty\"`\n}\n```\nConsensus indicates the orderer types and how many broker and zookeeper instances.\n\n```go\ntype ConsensusMetadataMutator func([]byte) []byte\n```\nConsensusMetadataMutator receives ConsensusType.Metadata and mutates it\n\n```go\ntype Consortium struct {\n\tName          string   `yaml:\"name,omitempty\"`\n\tOrganizations []string `yaml:\"organizations,omitempty\"`\n}\n```\nA Consortium is a named collection of Organizations. It is used to populate the Orderer geneesis block profile.\n\n```go\ntype DiscoveredPeer struct {\n\tMSPID      string   `yaml:\"mspid,omitempty\"`\n\tEndpoint   string   `yaml:\"endpoint,omitempty\"`\n\tIdentity   string   `yaml:\"identity,omitempty\"`\n\tChaincodes []string `yaml:\"chaincodes,omitempty\"`\n}\n```\nDiscoveredPeer defines a struct for discovering peers using discovery service. each peer in the result will have these fields\n\n```go\ntype Enver interface {\n\tEnv() []string\n}\n```\n\n```go\ntype Network struct {\n\tRootDir           string\n\tStartPort         uint16\n\tComponents        *Components\n\tDockerClient      *docker.Client\n\tNetworkID         string\n\tEventuallyTimeout time.Duration\n\tMetricsProvider   string\n\tStatsdEndpoint    string\n\n\tPortsByBrokerID  map[string]Ports\n\tPortsByOrdererID map[string]Ports\n\tPortsByPeerID    map[string]Ports\n\tOrganizations    []*Organization\n\tSystemChannel    *SystemChannel\n\tChannels         []*Channel\n\tConsensus        *Consensus\n\tOrdererCap       *OrdererCapabilities\n\tOrderers         []*Orderer\n\tPeers            []*Peer\n\tProfiles         []*Profile\n\tConsortiums      []*Consortium\n\tTemplates        *Templates\n\t// contains filtered or unexported fields\n}\n```\nNetwork holds information about a fabric network.\n\n```go\nfunc New(c *Config, rootDir string, client *docker.Client, startPort int, components *Components) *Network\n```\nNew creates a Network from a simple configuration. All generated or managed artifacts for the network will be located under rootDir. Ports will be allocated sequentially from the specified startPort.\n\n```go\nfunc (n *Network) AnchorsForChannel(chanName string) []*Peer\n```\nAnchorsForChannel returns all Peer instances that are anchors for the named channel.\n\n```go\nfunc (n *Network) AnchorsInOrg(orgName string) []*Peer\n```\nAnchorsInOrg returns all peers that are an anchor for at least one channel in the named organization.\n\n```go\nfunc (n *Network) Bootstrap()\n```\nBootstrap generates the cryptographic material, orderer system channel genesis block, and create channel transactions needed to run a fabric network.\n\nThe cryptogen tool is used to create crypto material from the contents of ${rootDir}/crypto-config.yaml. The generated artifacts will be placed in ${rootDir}/crypto/...\n\nThe gensis block is generated from the profile referenced by the SystemChannel.Profile attribute. The block is written to ${rootDir}/${SystemChannel.Name}\\_block.pb.\n\nThe create channel transactions are generated for each Channel referenced by the Network using the channel's Profile attribute. The transactions are written to ${rootDir}/${Channel.Name}\\_tx.pb.\n\n```go\nfunc (n *Network) BrokerAddresses(portName PortName) []string\n```\nBrokerAddresses returns the list of broker addresses for the network.\n\n```go\nfunc (n *Network) BrokerGroupRunner() ifrit.Runner\n```\nBrokerGroupRunner returns a runner that manages the processes that make up the kafka broker network for fabric.\n\n```go\nfunc (n *Network) BrokerRunner(id int, zookeepers []string) *runner.Kafka\n```\nBrokerRunner returns a runner for an kafka broker instance.\n\n```go\nfunc (n *Network) CACertsBundlePath() string\n```\nCACertsBundlePath returns the path to the bundle of CA certificates for the network. This bundle is used when connecting to peers.\n\n```go\nfunc (n *Network) Cleanup()\n```\nCleanup attempts to cleanup docker related artifacts that may have been created by the network.\n\n```go\nfunc (n *Network) ConcatenateTLSCACertificates()\n```\nconcatenateTLSCACertificates concatenates all TLS CA certificates into a single file to be used by peer CLI.\n\n```go\nfunc (n *Network) ConfigTxConfigPath() string\n```\nConfigTxPath returns the path to the generated configtxgen configuration file.\n\n```go\nfunc (n *Network) ConfigTxGen(command Command) (*gexec.Session, error)\n```\nConfigTxGen starts a gexec.Session for the provided configtxgen command.\n\n```go\nfunc (n *Network) Consortium(name string) *Consortium\n```\nConsortium returns information about the named Consortium.\n\n```go\nfunc (n *Network) CreateAndJoinChannel(o *Orderer, channelName string)\n```\nCreateAndJoinChannel will create the specified channel. The referencing peers will then be joined to the channel.\n\nThe network must be running before this is called.\n\n```go\nfunc (n *Network) CreateAndJoinChannels(o *Orderer)\n```\nCreateAndJoinChannels will create all channels specified in the config that are referenced by peers. The referencing peers will then be joined to the channel(s).\n\nThe network must be running before this is called.\n\n```go\nfunc (n *Network) CreateChannel(channelName string, o *Orderer, p *Peer, additionalSigners ...interface{})\n```\nCreateChannel will submit an existing create channel transaction to the specified orderer. The channel transaction must exist at the location returned by CreateChannelTxPath.  Optionally, additional signers may be included in the case where the channel creation tx modifies other aspects of the channel config for the new channel.\n\nThe orderer must be running when this is called.\n\n```go\nfunc (n *Network) CreateChannelFail(channelName string, o *Orderer, p *Peer, additionalSigners ...interface{})\n```\nCreateChannelFail will submit an existing create channel transaction to the specified orderer, but expect to FAIL. The channel transaction must exist at the location returned by CreateChannelTxPath.\n\nThe orderer must be running when this is called.\n\n```go\nfunc (n *Network) CreateChannelTxPath(channelName string) string\n```\nCreateChannelTxPath returns the path to the create channel transaction for the named channel.\n\n```go\nfunc (n *Network) CryptoConfigPath() string\n```\nCryptoConfigPath returns the path to the generated cryptogen configuration file.\n\n```go\nfunc (n *Network) CryptoPath() string\n```\nCryptoPath returns the path to the directory where cryptogen will place its generated artifacts.\n\n```go\nfunc (n *Network) Cryptogen(command Command) (*gexec.Session, error)\n```\nCryptogen starts a gexec.Session for the provided cryptogen command.\n\n```go\nfunc (n *Network) Discover(command Command) (*gexec.Session, error)\n```\nDiscover starts a gexec.Session for the provided discover command.\n\n```go\nfunc (n *Network) DiscoveredPeer(p *Peer, chaincodes ...string) DiscoveredPeer\n```\nthe function creates a new DiscoveredPeer from the peer and chaincodes passed as arguments\n\n```go\nfunc (n *Network) GenerateConfigTree()\n```\nGenerateConfigTree generates the configuration documents required to bootstrap a fabric network. A configuration file will be generated for cryptogen, configtxgen, and for each peer and orderer. The contents of the documents will be based on the Config used to create the Network.\n\nWhen this method completes, the resulting tree will look something like this:\n\n${rootDir}/configtx.yaml ${rootDir}/crypto-config.yaml ${rootDir}/orderers/orderer0.orderer-org/orderer.yaml ${rootDir}/peers/peer0.org1/core.yaml ${rootDir}/peers/peer0.org2/core.yaml ${rootDir}/peers/peer1.org1/core.yaml ${rootDir}/peers/peer1.org2/core.yaml\n\n```go\nfunc (n *Network) GenerateConfigTxConfig()\n```\n\n```go\nfunc (n *Network) GenerateCoreConfig(p *Peer)\n```\n\n```go\nfunc (n *Network) GenerateCryptoConfig()\n```\n\n```go\nfunc (n *Network) GenerateOrdererConfig(o *Orderer)\n```\n\n```go\nfunc (n *Network) JoinChannel(name string, o *Orderer, peers ...*Peer)\n```\nJoinChannel will join peers to the specified channel. The orderer is used to obtain the current configuration block for the channel.\n\nThe orderer and listed peers must be running before this is called.\n\n```go\nfunc (n *Network) NetworkGroupRunner() ifrit.Runner\n```\nNetworkGroupRunner returns a runner that can be used to start and stop an entire fabric network.\n\n```go\nfunc (n *Network) Orderer(name string) *Orderer\n```\nOrderer returns the information about the named Orderer.\n\n```go\nfunc (n *Network) OrdererAddress(o *Orderer, portName PortName) string\n```\nOrdererAddress returns the address (host and port) exposed by the Orderer for the named port. Command line tools should use the returned address when connecting to the orderer.\n\nThis assumes that the orderer is listening on 0.0.0.0 or 127.0.0.1 and is available on the loopback address.\n\n```go\nfunc (n *Network) OrdererAdminSession(o *Orderer, p *Peer, command Command) (*gexec.Session, error)\n```\nOrdererAdminSession execute a gexec.Session as an orderer node admin user. This is used primarily to generate orderer configuration updates\n\n```go\nfunc (n *Network) OrdererConfigPath(o *Orderer) string\n```\nOrdererConfigPath returns the path to the orderer configuration document for the specified Orderer.\n\n```go\nfunc (n *Network) OrdererDir(o *Orderer) string\n```\nOrdererDir returns the path to the configuration directory for the specified Orderer.\n\n```go\nfunc (n *Network) OrdererGroupRunner() ifrit.Runner\n```\nOrdererGroupRunner returns a runner that can be used to start and stop all orderers in a network.\n\n```go\nfunc (n *Network) OrdererLocalCryptoDir(o *Orderer, cryptoType string) string\n```\nOrdererLocalCryptoDir returns the path to the local crypto directory for the Orderer.\n\n```go\nfunc (n *Network) OrdererLocalMSPDir(o *Orderer) string\n```\nOrdererLocalMSPDir returns the path to the local MSP directory for the Orderer.\n\n```go\nfunc (n *Network) OrdererLocalTLSDir(o *Orderer) string\n```\nOrdererLocalTLSDir returns the path to the local TLS directory for the Orderer.\n\n```go\nfunc (n *Network) OrdererOrgMSPDir(o *Organization) string\n```\nOrdererOrgMSPDir returns the path to the MSP directory of the Orderer organization.\n\n```go\nfunc (n *Network) OrdererOrgs() []*Organization\n```\nOrdererOrgs returns all Organization instances that own at least one orderer.\n\n```go\nfunc (n *Network) OrdererPort(o *Orderer, portName PortName) uint16\n```\nOrdererPort returns the named port reserved for the Orderer instance.\n\n```go\nfunc (n *Network) OrdererRunner(o *Orderer) *ginkgomon.Runner\n```\nOrdererRunner returns an ifrit.Runner for the specified orderer. The runner can be used to start and manage an orderer process.\n\n```go\nfunc (n *Network) OrdererUserCert(o *Orderer, user string) string\n```\nOrdererUserCert returns the path to the certificate for the specified user in the orderer organization.\n\n```go\nfunc (n *Network) OrdererUserKey(o *Orderer, user string) string\n```\nOrdererUserKey returns the path to the private key for the specified user in the orderer organization.\n\n```go\nfunc (n *Network) OrdererUserMSPDir(o *Orderer, user string) string\n```\nOrdererUserMSPDir returns the path to the MSP directory containing the certificates and keys for the specified user of the peer.\n\n```go\nfunc (n *Network) OrderersInOrg(orgName string) []*Orderer\n```\nOrderersInOrg returns all Orderer instances owned by the named organaiztion.\n\n```go\nfunc (n *Network) Organization(orgName string) *Organization\n```\nOrganization returns the information about the named Organization.\n\n```go\nfunc (n *Network) OrgsForOrderers(ordererNames []string) []*Organization\n```\nOrgsForOrderers returns all Organization instances that own at least one of the named orderers.\n\n```go\nfunc (n *Network) OutputBlockPath(channelName string) string\n```\nOutputBlockPath returns the path to the genesis block for the named system channel.\n\n```go\nfunc (n *Network) Peer(orgName, peerName string) *Peer\n```\nPeer returns the information about the named Peer in the named organization.\n\n```go\nfunc (n *Network) PeerAddress(p *Peer, portName PortName) string\n```\nPeerAddress returns the address (host and port) exposed by the Peer for the named port. Command line tools should use the returned address when connecting to a peer.\n\nThis assumes that the peer is listening on 0.0.0.0 and is available on the loopback address.\n\n```go\nfunc (n *Network) PeerAdminSession(p *Peer, command Command) (*gexec.Session, error)\n```\nPeerAdminSession starts a gexec.Session as a peer admin for the provided peer command. This is intended to be used by short running peer cli commands that execute in the context of a peer configuration.\n\n```go\nfunc (n *Network) PeerCert(p *Peer) string\n```\nPeerCert returns the path to the peer's certificate.\n\n```go\nfunc (n *Network) PeerConfigPath(p *Peer) string\n```\nPeerConfigPath returns the path to the peer configuration document for the specified peer.\n\n```go\nfunc (n *Network) PeerDir(p *Peer) string\n```\nPeerDir returns the path to the configuration directory for the specified Peer.\n\n```go\nfunc (n *Network) PeerGroupRunner() ifrit.Runner\n```\nPeerGroupRunner returns a runner that can be used to start and stop all peers in a network.\n\n```go\nfunc (n *Network) PeerLocalMSPDir(p *Peer) string\n```\nPeerLocalMSPDir returns the path to the local MSP directory for the peer.\n\n```go\nfunc (n *Network) PeerLocalTLSDir(p *Peer) string\n```\nPeerLocalTLSDir returns the path to the local TLS directory for the peer.\n\n```go\nfunc (n *Network) PeerOrgMSPDir(org *Organization) string\n```\nPeerOrgMSPDir returns the path to the MSP directory of the Peer organization.\n\n```go\nfunc (n *Network) PeerOrgs() []*Organization\n```\nPeerOrgs returns all Organizations associated with at least one Peer.\n\n```go\nfunc (n *Network) PeerPort(p *Peer, portName PortName) uint16\n```\nPeerPort returns the named port reserved for the Peer instance.\n\n```go\nfunc (n *Network) PeerRunner(p *Peer) *ginkgomon.Runner\n```\nPeerRunner returns an ifrit.Runner for the specified peer. The runner can be used to start and manage a peer process.\n\n```go\nfunc (n *Network) PeerUserCert(p *Peer, user string) string\n```\nPeerUserCert returns the path to the certificate for the specified user in the peer organization.\n\n```go\nfunc (n *Network) PeerUserKey(p *Peer, user string) string\n```\nPeerUserKey returns the path to the private key for the specified user in the peer organization.\n\n```go\nfunc (n *Network) PeerUserMSPDir(p *Peer, user string) string\n```\nPeerUserMSPDir returns the path to the MSP directory containing the certificates and keys for the specified user of the peer.\n\n```go\nfunc (n *Network) PeerUserSession(p *Peer, user string, command Command) (*gexec.Session, error)\n```\nPeerUserSession starts a gexec.Session as a peer user for the provided peer command. This is intended to be used by short running peer cli commands that execute in the context of a peer configuration.\n\n```go\nfunc (n *Network) PeerUserTLSDir(p *Peer, user string) string\n```\nPeerUserTLSDir returns the path to the TLS directory containing the certificates and keys for the specified user of the peer.\n\n```go\nfunc (n *Network) PeersInOrg(orgName string) []*Peer\n```\nPeersInOrg returns all Peer instances that are owned by the named organization.\n\n```go\nfunc (n *Network) PeersWithChannel(chanName string) []*Peer\n```\nPeersWithChannel returns all Peer instances that have joined the named channel.\n\n```go\nfunc (n *Network) ProfileForChannel(channelName string) string\n```\nProfileForChannel gets the configtxgen profile name associated with the specified channel.\n\n```go\nfunc (n *Network) ReadConfigTxConfig() *fabricconfig.ConfigTx\n```\nReadConfigTxConfig  unmarshals the configtx.yaml and returns an object approximating its contents.\n\n```go\nfunc (n *Network) ReadOrdererConfig(o *Orderer) *fabricconfig.Orderer\n```\nReadOrdererConfig  unmarshals an orderer's orderer.yaml and returns an object approximating its contents.\n\n```go\nfunc (n *Network) ReadPeerConfig(p *Peer) *fabricconfig.Core\n```\nReadPeerConfig unmarshals a peer's core.yaml and returns an object approximating its contents.\n\n```go\nfunc (n *Network) ReservePort() uint16\n```\nReservePort allocates the next available port.\n\n```go\nfunc (n *Network) StartSession(cmd *exec.Cmd, name string) (*gexec.Session, error)\n```\nStartSession executes a command session. This should be used to launch command line tools that are expected to run to completion.\n\n```go\nfunc (n *Network) UpdateChannelAnchors(o *Orderer, channelName string)\n```\nUpdateChannelAnchors determines the anchor peers for the specified channel, creates an anchor peer update transaction for each organization, and submits the update transactions to the orderer.\n\n```go\nfunc (n *Network) WriteConfigTxConfig(config *fabricconfig.ConfigTx)\n```\nWriteConfigTxConfig serializes the provided configuration to configtx.yaml.\n\n```go\nfunc (n *Network) WriteOrdererConfig(o *Orderer, config *fabricconfig.Orderer)\n```\nWriteOrdererConfig serializes the provided configuration as the specified orderer's orderer.yaml document.\n\n```go\nfunc (n *Network) WritePeerConfig(p *Peer, config *fabricconfig.Core)\n```\nWritePeerConfig serializes the provided configuration as the specified peer's core.yaml document.\n\n```go\nfunc (n *Network) ZooKeeperRunner(idx int) *runner.ZooKeeper\n```\nZooKeeperRunner returns a runner for a ZooKeeper instance.\n\n```go\ntype Orderer struct {\n\tName         string `yaml:\"name,omitempty\"`\n\tOrganization string `yaml:\"organization,omitempty\"`\n}\n```\nOrderer defines an orderer instance and its owning organization.\n\n```go\nfunc (o Orderer) ID() string\n```\nID provides a unique identifier for an orderer instance.\n\n```go\ntype OrdererCapabilities struct {\n\tV2_0 bool `yaml:\"v20,omitempty\"`\n}\n```\n\n```go\ntype Organization struct {\n\tMSPID         string `yaml:\"msp_id,omitempty\"`\n\tName          string `yaml:\"name,omitempty\"`\n\tDomain        string `yaml:\"domain,omitempty\"`\n\tEnableNodeOUs bool   `yaml:\"enable_node_organizational_units\"`\n\tUsers         int    `yaml:\"users,omitempty\"`\n\tCA            *CA    `yaml:\"ca,omitempty\"`\n}\n```\nOrganization models information about an Organization. It includes the information needed to populate an MSP with cryptogen.\n\n```go\ntype Peer struct {\n\tName         string         `yaml:\"name,omitempty\"`\n\tOrganization string         `yaml:\"organization,omitempty\"`\n\tChannels     []*PeerChannel `yaml:\"channels,omitempty\"`\n}\n```\nPeer defines a peer instance, it's owning organization, and the list of channels that the peer shoudl be joined to.\n\n```go\nfunc (p *Peer) Anchor() bool\n```\nAnchor returns true if this peer is an anchor for any channel it has joined.\n\n```go\nfunc (p *Peer) ID() string\n```\nID provides a unique identifier for a peer instance.\n\n```go\ntype PeerChannel struct {\n\tName   string `yaml:\"name,omitempty\"`\n\tAnchor bool   `yaml:\"anchor\"`\n}\n```\nPeerChannel names of the channel a peer should be joined to and whether or not the peer should be an anchor for the channel.\n\n```go\ntype PortName string\n```\n\n```go\nconst (\n\tChaincodePort    PortName = \"Chaincode\"\n\tEventsPort       PortName = \"Events\"\n\tHostPort         PortName = \"HostPort\"\n\tListenPort       PortName = \"Listen\"\n\tProfilePort      PortName = \"Profile\"\n\tOperationsPort   PortName = \"Operations\"\n\tAdminServicePort PortName = \"AdminService\"\n\tClusterPort      PortName = \"Cluster\"\n)\n```\n\n```go\nfunc BrokerPortNames() []PortName\n```\nBrokerPortNames returns the list of ports that need to be reserved for a Kafka broker.\n\n```go\nfunc OrdererPortNames() []PortName\n```\nOrdererPortNames  returns the list of ports that need to be reserved for an Orderer.\n\n```go\nfunc PeerPortNames() []PortName\n```\nPeerPortNames returns the list of ports that need to be reserved for a Peer.\n\n```go\ntype Ports map[PortName]uint16\n```\n\n```go\ntype Profile struct {\n\tName          string   `yaml:\"name,omitempty\"`\n\tOrderers      []string `yaml:\"orderers,omitempty\"`\n\tConsortium    string   `yaml:\"consortium,omitempty\"`\n\tOrganizations []string `yaml:\"organizations,omitempty\"`\n}\n```\nA profile encapsulates basic information for a configtxgen profile.\n\n```go\ntype SystemChannel struct {\n\tName    string `yaml:\"name,omitempty\"`\n\tProfile string `yaml:\"profile,omitempty\"`\n}\n```\nThe SystemChannel declares the name of the network system channel and its associated configtxgen profile name.\n\n```go\ntype Templates struct {\n\tConfigTx string `yaml:\"configtx,omitempty\"`\n\tCore     string `yaml:\"core,omitempty\"`\n\tCrypto   string `yaml:\"crypto,omitempty\"`\n\tOrderer  string `yaml:\"orderer,omitempty\"`\n}\n```\nTemplates can be used to provide custom templates to GenerateConfigTree.\n\n```go\nfunc (t *Templates) ConfigTxTemplate() string\n```\n\n```go\nfunc (t *Templates) CoreTemplate() string\n```\n\n```go\nfunc (t *Templates) CryptoTemplate() string\n```\n\n```go\nfunc (t *Templates) OrdererTemplate() string\n```\n\n```go\ntype WorkingDirer interface {\n\tWorkingDir() string\n}\n```\n\n","path":"github.com/eric-erki/https-hyperledger.org/integration/nwo","name":"nwo","synopsis":"","isRedistributable":true}
