fabric

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 26 Imported by: 18

Documentation

Index

Constants

View Source
const (
	ClientRole = "client"
	PeerRole   = "peer"
)
View Source
const CCEnvDefaultImage = "hyperledger/fabric-ccenv:latest"
View Source
const (
	TopologyName = "fabric"
)

Variables

View Source
var (
	ImplicitMetaReaders              = &topology.Policy{Name: "Readers", Type: "ImplicitMeta", Rule: "ANY Readers"}
	ImplicitMetaWriters              = &topology.Policy{Name: "Writers", Type: "ImplicitMeta", Rule: "ANY Writers"}
	ImplicitMetaAdmins               = &topology.Policy{Name: "Admins", Type: "ImplicitMeta", Rule: "ANY Admins"}
	ImplicitMetaLifecycleEndorsement = &topology.Policy{Name: "LifecycleEndorsement", Type: "ImplicitMeta", Rule: "MAJORITY Endorsement"}
	ImplicitMetaEndorsement          = &topology.Policy{Name: "Endorsement", Type: "ImplicitMeta", Rule: "ANY Endorsement"}
)
View Source
var RequiredImages = []string{CCEnvDefaultImage}

Functions

func NewDefaultTopology

func NewDefaultTopology() *topology.Topology

NewDefaultTopology is a configuration with two organizations and one peer per org.

func NewPlatformFactory

func NewPlatformFactory() *platformFactory

func NewTopology

func NewTopology() *topology.Topology

NewTopology returns a new topology whose name is empty

func NewTopologyWithName

func NewTopologyWithName(name string) *topology.Topology

NewTopologyWithName is a configuration with two organizations and one peer per org

func Options

func Options(o *node.Options) *opts.Options

func WithAnonymousIdentity

func WithAnonymousIdentity() node.Option

WithAnonymousIdentity adds support for anonymous identity

func WithClientRole

func WithClientRole() node.Option

func WithDefaultIdentityByHSM

func WithDefaultIdentityByHSM() node.Option

WithDefaultIdentityByHSM to make the default identity to be HSM identity

func WithDefaultIdentityWithLabel

func WithDefaultIdentityWithLabel(label string) node.Option

WithDefaultIdentityWithLabel sets the label of the default identity

func WithDefaultNetwork

func WithDefaultNetwork(Network string) node.Option

func WithIdemixIdentity

func WithIdemixIdentity(label string) node.Option

func WithNetworkOrganization

func WithNetworkOrganization(Network, Organization string) node.Option

func WithOrganization

func WithOrganization(Organization string) node.Option

func WithOrionVaultPersistence

func WithOrionVaultPersistence(network, db, creator string) node.Option

WithOrionVaultPersistence is a configuration with orion vault persistence

func WithPeerRole

func WithPeerRole() node.Option

func WithX509Identity

func WithX509Identity(label string) node.Option

func WithX509IdentityByHSM

func WithX509IdentityByHSM(label string) node.Option

Types

type BuilderClient

type BuilderClient interface {
	Build(path string) string
}

type Chaincode

type Chaincode struct {
	Name      string
	OrgMSPIDs []string
}

type Channel

type Channel struct {
	Name       string
	Chaincodes []*Chaincode
}

type Identity

type Identity struct {
	ID    string
	Type  string
	Path  string
	MSPID string
}

type Orderer

type Orderer struct {
	Name             string
	FullName         string
	ListeningAddress string
	TLSCACerts       []string
}

type Org

type Org struct {
	Name                  string
	MSPID                 string
	CACertsBundlePath     string
	PeerCACertificatePath string
}

type Peer

type Peer struct {
	Name             string
	FullName         string
	ListeningAddress string
	TLSCACerts       []string
	Cert             string
	Identities       []*Identity
}

type Platform

type Platform struct {
	Network *network.Network
}

func Network

func Network(ctx *context.Context, id string) *Platform

Network returns the fabric network from the passed context bound to the passed id. It returns nil, if nothing is found

func NewPlatform

func NewPlatform(context api.Context, t api.Topology, components BuilderClient) *Platform

func (*Platform) Channels

func (p *Platform) Channels() []*fabric.Channel

func (*Platform) Cleanup

func (p *Platform) Cleanup()

func (*Platform) ConnectionProfile

func (p *Platform) ConnectionProfile(name string, ca bool) *network.ConnectionProfile

ConnectionProfile returns Fabric connection profile

func (*Platform) DefaultIdemixOrgMSPDir

func (p *Platform) DefaultIdemixOrgMSPDir() string

func (*Platform) DeleteVault

func (p *Platform) DeleteVault(id string)

func (*Platform) DeployChaincode

func (p *Platform) DeployChaincode(chaincode *topology.ChannelChaincode)

func (*Platform) GenerateArtifacts

func (p *Platform) GenerateArtifacts()

func (*Platform) GenerateConfigTree

func (p *Platform) GenerateConfigTree()

func (*Platform) InvokeChaincode

func (p *Platform) InvokeChaincode(cc *topology.ChannelChaincode, method string, args ...[]byte) []byte

func (*Platform) Load

func (p *Platform) Load()

func (*Platform) Members

func (p *Platform) Members() []grouper.Member

func (*Platform) Name

func (p *Platform) Name() string

func (*Platform) Orderers

func (p *Platform) Orderers() []*fabric.Orderer

func (*Platform) OrgMSPID

func (p *Platform) OrgMSPID(orgName string) string

func (*Platform) PeerChaincodeAddress

func (p *Platform) PeerChaincodeAddress(peerName string) string

func (*Platform) PeerOrgs

func (p *Platform) PeerOrgs() []*fabric.Org

func (*Platform) PeersByID

func (p *Platform) PeersByID(id string) *Peer

func (*Platform) PeersByOrg

func (p *Platform) PeersByOrg(fabricHost string, orgName string, includeAll bool) []*fabric.Peer

func (*Platform) PostRun

func (p *Platform) PostRun(load bool)

func (*Platform) Topology

func (p *Platform) Topology() *topology.Topology

func (*Platform) Type

func (p *Platform) Type() string

func (*Platform) UpdateChaincode

func (p *Platform) UpdateChaincode(chaincodeId string, version string, path string, packageFile string)

UpdateChaincode deploys the new version of the chaincode passed by chaincodeId

func (*Platform) UserByOrg

func (p *Platform) UserByOrg(orgName string, user string) *fabric.User

func (*Platform) UsersByOrg

func (p *Platform) UsersByOrg(orgName string) []*fabric.User

type User

type User struct {
	Name string
	Cert string
	Key  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL