func (n *Network) userCryptoDir(org *topology.Organization, nodeOrganizationType, user, cryptoMaterialType string) string {
	return filepath.Join(
		n.Context.RootDir(),
		n.Prefix,
		"crypto",
		nodeOrganizationType,
		org.Domain,
		"users",
		fmt.Sprintf("%s@%s", user, org.Domain),
		cryptoMaterialType,
	)
}
userCryptoDir returns the path to the folder with crypto materials for either peers or orderer organizations
specific user
package network
import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"syscall"
	"text/template"
	"time"
	"github.com/hyperledger/fabric/integration/runner"
	"github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gexec"
	. "github.com/onsi/gomega/gstruct"
	"github.com/onsi/gomega/matchers"
	"github.com/onsi/gomega/types"
	"github.com/tedsuo/ifrit"
	"github.com/tedsuo/ifrit/ginkgomon"
	"github.com/tedsuo/ifrit/grouper"
	"gopkg.in/yaml.v2"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/api"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric/commands"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric/fabricconfig"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric/opts"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric/topology"
	"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc"
)
func (n *Network) LogSpec() string {
	if len(n.Logging.Spec) == 0 {
		return "info:fscnode=debug"
	}
	return n.Logging.Spec
}
func (n *Network) LogFormat() string {
	if len(n.Logging.Format) == 0 {
		return "'%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}'"
	}
	return n.Logging.Format
}
func (n *Network) AddOrg(o *topology.Organization, peers ...*topology.Peer) {
	for _, p := range peers {
		ports := api.Ports{}
		for _, portName := range PeerPortNames() {
			ports[portName] = n.Context.ReservePort()
		}
		n.Context.SetPortsByPeerID(n.Prefix, p.ID(), ports)
		n.Peers = append(n.Peers, p)
	}
	n.Organizations = append(n.Organizations, o)
	n.Consortiums[0].Organizations = append(n.Consortiums[0].Organizations, o.Name)
}
func (n *Network) ConfigTxConfigPath() string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, "configtx.yaml")
}
func (n *Network) CryptoPath() string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, "crypto")
}
func (n *Network) CryptoConfigPath() string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, "crypto-config.yaml")
}
func (n *Network) OutputBlockPath(channelName string) string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, fmt.Sprintf("%s_block.pb", channelName))
}
func (n *Network) CreateChannelTxPath(channelName string) string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, fmt.Sprintf("%s_tx.pb", channelName))
}
func (n *Network) OrdererDir(o *topology.Orderer) string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, "orderers", o.ID())
}
func (n *Network) OrdererConfigPath(o *topology.Orderer) string {
	return filepath.Join(n.OrdererDir(o), "orderer.yaml")
}
func (n *Network) ReadOrdererConfig(o *topology.Orderer) *fabricconfig.Orderer {
	var orderer fabricconfig.Orderer
	ordererBytes, err := ioutil.ReadFile(n.OrdererConfigPath(o))
	Expect(err).NotTo(HaveOccurred())
	err = yaml.Unmarshal(ordererBytes, &orderer)
	Expect(err).NotTo(HaveOccurred())
	return &orderer
}
func (n *Network) WriteOrdererConfig(o *topology.Orderer, config *fabricconfig.Orderer) {
	ordererBytes, err := yaml.Marshal(config)
	Expect(err).NotTo(HaveOccurred())
	err = ioutil.WriteFile(n.OrdererConfigPath(o), ordererBytes, 0644)
	Expect(err).NotTo(HaveOccurred())
}
func (n *Network) ReadConfigTxConfig() *fabricconfig.ConfigTx {
	var configtx fabricconfig.ConfigTx
	configtxBytes, err := ioutil.ReadFile(n.ConfigTxConfigPath())
	Expect(err).NotTo(HaveOccurred())
	err = yaml.Unmarshal(configtxBytes, &configtx)
	Expect(err).NotTo(HaveOccurred())
	return &configtx
}
func (n *Network) WriteConfigTxConfig(config *fabricconfig.ConfigTx) {
	configtxBytes, err := yaml.Marshal(config)
	Expect(err).NotTo(HaveOccurred())
	err = ioutil.WriteFile(n.ConfigTxConfigPath(), configtxBytes, 0644)
	Expect(err).NotTo(HaveOccurred())
}
func (n *Network) PeerDir(p *topology.Peer) string {
	return filepath.Join(n.Context.RootDir(), n.Prefix, "peers", p.ID())
}
func (n *Network) PeerConfigPath(p *topology.Peer) string {
	return filepath.Join(n.PeerDir(p), "core.yaml")
}
func (n *Network) PeerLedgerDir(p *topology.Peer) string {
	return filepath.Join(n.PeerDir(p), "filesystem/ledgersData")
}
func (n *Network) ReadPeerConfig(p *topology.Peer) *fabricconfig.Core {
	var core fabricconfig.Core
	coreBytes, err := ioutil.ReadFile(n.PeerConfigPath(p))
	Expect(err).NotTo(HaveOccurred())
	err = yaml.Unmarshal(coreBytes, &core)
	Expect(err).NotTo(HaveOccurred())
	return &core
}
func (n *Network) WritePeerConfig(p *topology.Peer, config *fabricconfig.Core) {
	coreBytes, err := yaml.Marshal(config)
	Expect(err).NotTo(HaveOccurred())
	err = ioutil.WriteFile(n.PeerConfigPath(p), coreBytes, 0644)
	Expect(err).NotTo(HaveOccurred())
}
func (n *Network) peerUserCryptoDir(p *topology.Peer, user, cryptoMaterialType string) string {
	org := n.Organization(p.Organization)
	Expect(org).NotTo(BeNil())
	return n.userCryptoDir(org, "peerOrganizations", user, cryptoMaterialType)
}
func (n *Network) ordererUserCryptoDir(o *topology.Orderer, user, cryptoMaterialType string) string {
	org := n.Organization(o.Organization)
	Expect(org).NotTo(BeNil())
	return n.userCryptoDir(org, "ordererOrganizations", user, cryptoMaterialType)
}