weaver

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: 36 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RelayServerImage  = "hyperledger-labs/weaver-relay-server:latest"
	FabricDriverImage = "hyperledger-labs/weaver-fabric-driver:latest"
)
View Source
const FabricExtensionTemplate = `` /* 415-byte string literal not displayed */
View Source
const RelayServerTOML = `` /* 706-byte string literal not displayed */
View Source
const (
	TopologyName = "weaver"
)

Variables

Functions

func NewPlatformFactory

func NewPlatformFactory() *platformFactory

Types

type Admin

type Admin struct {
	Name   string `json:"name"`
	Secret string `json:"secret"`
}

type Attr

type Attr struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Ecert bool   `json:"ecert"`
}

type Builder

type Builder interface {
	Build(path string) string
}

type Config

type Config struct {
	Admin Admin  `json:"admin"`
	Relay Relay  `json:"relay"`
	MspId string `json:"mspId"`
	CaUrl string `json:"caUrl"`
}

type Credentials

type Credentials struct {
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"privateKey"`
}

type Driver

type Driver struct {
	Name     string
	Hostname string
	Port     uint16 `yaml:"port,omitempty"`
}

type FabricNetwork

type FabricNetwork interface {
	DeployChaincode(chaincode *topology.ChannelChaincode)
	DefaultIdemixOrgMSPDir() string
	Topology() *topology.Topology
	PeerChaincodeAddress(peerName string) string
	PeerOrgs() []*fabric.Org
	OrgMSPID(orgName string) string
	PeersByOrg(fabricHost string, orgName string, includeAll bool) []*fabric.Peer
	UserByOrg(organization string, user string) *fabric.User
	UsersByOrg(organization string) []*fabric.User
	Orderers() []*fabric.Orderer
	Channels() []*fabric.Channel
	InvokeChaincode(cc *topology.ChannelChaincode, method string, args ...[]byte) []byte
	ConnectionProfile(name string, ca bool) *network.ConnectionProfile
}

type Identity

type Identity struct {
	Credentials Credentials `json:"credentials"`
	MspId       string      `json:"mspId"`
	Type        string      `json:"type"`
	Version     int         `json:"version"`
}

type InteropChaincode

type InteropChaincode struct {
	Label     string
	Channel   string
	Namespace string
	Path      string
}

type Network

type Network struct {
	Type string
	Name string
}

type Platform

type Platform struct {
	Context           api2.Context
	Topology          *Topology
	Builder           api2.Builder
	EventuallyTimeout time.Duration

	NetworkID string
}

func NewPlatform

func NewPlatform(ctx api2.Context, t api2.Topology, builder api2.Builder) *Platform

func (*Platform) Cleanup

func (p *Platform) Cleanup()

func (*Platform) Fabric

func (p *Platform) Fabric(relay *RelayServer) FabricNetwork

func (*Platform) FabricDriverConfigPath

func (p *Platform) FabricDriverConfigPath(relay *RelayServer) string

func (*Platform) FabricDriverConnectionProfilePath

func (p *Platform) FabricDriverConnectionProfilePath(relay *RelayServer) string

func (*Platform) FabricDriverDir

func (p *Platform) FabricDriverDir(relay *RelayServer) string

func (*Platform) FabricDriverWalletDir

func (p *Platform) FabricDriverWalletDir(relay *RelayServer) string

func (*Platform) FabricDriverWalletId

func (p *Platform) FabricDriverWalletId(relay *RelayServer, id string) string

func (*Platform) GenerateArtifacts

func (p *Platform) GenerateArtifacts()

func (*Platform) GenerateConfigTree

func (p *Platform) GenerateConfigTree()

func (*Platform) InteropChaincodeFile

func (p *Platform) InteropChaincodeFile() string

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) PostRun

func (p *Platform) PostRun(bool)

func (*Platform) PrepareInteropChaincode

func (p *Platform) PrepareInteropChaincode(relay *RelayServer) (*topology.ChannelChaincode, error)

func (*Platform) RelayDir

func (p *Platform) RelayDir() string

func (*Platform) RelayServerConfigPath

func (p *Platform) RelayServerConfigPath(relay *RelayServer) string

func (*Platform) RelayServerDir

func (p *Platform) RelayServerDir(relay *RelayServer) string

func (*Platform) RelayServerInteropAccessControl

func (p *Platform) RelayServerInteropAccessControl(destination *RelayServer, source *RelayServer) string

func (*Platform) RelayServerInteropDir

func (p *Platform) RelayServerInteropDir(relay *RelayServer) string

func (*Platform) RelayServerInteropMembership

func (p *Platform) RelayServerInteropMembership(relay *RelayServer) string

func (*Platform) RelayServerInteropVerificationPolicy

func (p *Platform) RelayServerInteropVerificationPolicy(relay *RelayServer) string

func (*Platform) RunRelayFabricDriver

func (p *Platform) RunRelayFabricDriver(
	networkName,
	relayHost, relayPort,
	driverHost, driverPort,
	interopChaincode,
	ccpPath, configPath, walletPath string)

func (*Platform) RunRelayServer

func (p *Platform) RunRelayServer(name string, serverConfigPath, port string)

func (*Platform) Type

func (p *Platform) Type() string

type Relay

type Relay struct {
	Name        string `json:"name"`
	Affiliation string `json:"affiliation"`
	Role        string `json:"role"`
	Attrs       []Attr `json:"attrs"`
}

type RelayServer

type RelayServer struct {
	FabricTopology     *topology.Topology `yaml:"-"`
	FabricTopologyName string
	Name               string
	Hostname           string
	Port               uint16 `yaml:"port,omitempty"`
	Organization       string
	Networks           []*Network
	Drivers            []*Driver
	InteropChaincode   InteropChaincode
}

func (*RelayServer) AddFabricNetwork

func (w *RelayServer) AddFabricNetwork(ft *topology.Topology) *RelayServer

type Topology

type Topology struct {
	TopologyName string `yaml:"name,omitempty"`
	TopologyType string `yaml:"type,omitempty"`
	Relays       []*RelayServer
}

func NewTopology

func NewTopology() *Topology

func (*Topology) AddRelayServer

func (t *Topology) AddRelayServer(ft *topology.Topology, org string) *RelayServer

func (*Topology) Name

func (t *Topology) Name() string

func (*Topology) Type

func (t *Topology) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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