fsc

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 44 Imported by: 18

Documentation

Index

Constants

View Source
const (
	ListenPort api.PortName = "Listen" // Port at which the fsc node might listen for some service
	ViewPort   api.PortName = "View"   // Port at which the View Service Server respond
	P2PPort    api.PortName = "P2P"    // Port at which the P2P Communication Layer respond
	WebPort    api.PortName = "Web"    // Port at which the Web Server respond
)
View Source
const (
	TopologyName = "fsc"
)

Variables

This section is empty.

Functions

func GetPersistenceNames added in v0.4.1

func GetPersistenceNames(o *node2.Options, prefixes ...node2.PersistenceKey) map[node2.PersistenceKey]driver.PersistenceName

func GetPersistences added in v0.4.1

func GetPersistences(o *node2.Options, dir string) map[driver.PersistenceName]node2.PersistenceOpts

func PeerPortNames

func PeerPortNames() []api.PortName

PeerPortNames returns the list of ports that need to be reserved for a Peer.

func SqlitePath added in v0.4.1

func SqlitePath(storages string, prefix node2.PersistenceKey) string

func WithAlias

func WithAlias(alias string) node2.Option

func WithReplicationFactor added in v0.4.0

func WithReplicationFactor(factor int) node2.Option

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) Build

func (c *Builder) Build(path string) string

func (*Builder) FSCCLI

func (c *Builder) FSCCLI() string

type BuilderClient

type BuilderClient interface {
	Build(path string) string
}

type Logging

type Logging struct {
	Spec         string `yaml:"spec,omitempty"`
	Format       string `yaml:"format,omitempty"`
	OtelSanitize bool   `yaml:"otelSanitize,omitempty"`
}

type Monitoring added in v0.3.0

type Monitoring struct {
	TracingType          tracing.TracerType `yaml:"tracingType,omitempty"`
	TracingEndpoint      string             `yaml:"tracingEndpoint,omitempty"`
	TracingSamplingRatio float64            `yaml:"tracingSamplingRatio,omitempty"`
	MetricsType          string             `yaml:"metricsType,omitempty"`
	TLS                  bool               `yaml:"tls,omitempty"`
}

type P2PCommunicationType added in v0.4.0

type P2PCommunicationType = string

type Platform

type Platform struct {
	Context           api.Context
	NetworkID         string
	Builder           *Builder
	Topology          *Topology
	EventuallyTimeout time.Duration

	Organizations []*node2.Organization
	Peers         []*node2.Replica
	Resolvers     []*Resolver
	Routing       map[string][]string
	// contains filtered or unexported fields
}

func NewPlatform

func NewPlatform(Registry api.Context, t api.Topology, builderClient BuilderClient) *Platform

func (*Platform) AdminLocalMSPIdentityCert

func (p *Platform) AdminLocalMSPIdentityCert(peer *node2.Peer) string

func (*Platform) AdminLocalMSPPrivateKey

func (p *Platform) AdminLocalMSPPrivateKey(peer *node2.Peer) string

func (*Platform) BootstrapNode

func (p *Platform) BootstrapNode(me *node2.Peer) string

func (*Platform) BootstrapViewNodeGroupRunner

func (p *Platform) BootstrapViewNodeGroupRunner() ifrit.Runner

func (*Platform) CACertsBundlePath

func (p *Platform) CACertsBundlePath() string

func (*Platform) CheckTopology

func (p *Platform) CheckTopology()

func (*Platform) Cleanup

func (p *Platform) Cleanup()

func (*Platform) ClientAuthRequired

func (p *Platform) ClientAuthRequired() bool

func (*Platform) ConcatenateTLSCACertificates

func (p *Platform) ConcatenateTLSCACertificates()

func (*Platform) CryptoConfigPath

func (p *Platform) CryptoConfigPath() string

func (*Platform) CryptoPath

func (p *Platform) CryptoPath() string

func (*Platform) Cryptogen

func (p *Platform) Cryptogen(command common.Command) (*gexec.Session, error)

func (*Platform) FSCCLI

func (p *Platform) FSCCLI(command common.Command) (*gexec.Session, error)

func (*Platform) FSCNodeGroupRunner

func (p *Platform) FSCNodeGroupRunner() ifrit.Runner

func (*Platform) FSCNodeRunner

func (p *Platform) FSCNodeRunner(node *node2.Replica, env ...string) *runner2.Runner

func (*Platform) GenerateArtifacts

func (p *Platform) GenerateArtifacts()

func (*Platform) GenerateCmd

func (p *Platform) GenerateCmd(output io.Writer, node *node2.Replica) string

func (*Platform) GenerateConfigTree

func (p *Platform) GenerateConfigTree()

func (*Platform) GenerateCoreConfig

func (p *Platform) GenerateCoreConfig(peer *node2.Replica)

func (*Platform) GenerateCryptoConfig

func (p *Platform) GenerateCryptoConfig()

func (*Platform) GenerateResolverMap

func (p *Platform) GenerateResolverMap()

func (*Platform) GenerateRoutingConfig added in v0.4.0

func (p *Platform) GenerateRoutingConfig()

func (*Platform) GetAdminSigningIdentity

func (p *Platform) GetAdminSigningIdentity(peer *node2.Peer) (client3.SigningIdentity, error)

func (*Platform) GetReplicas added in v0.4.0

func (p *Platform) GetReplicas(peer *node2.Peer) []*node2.Replica

func (*Platform) GetSigningIdentity

func (p *Platform) GetSigningIdentity(peer *node2.Peer) (client3.SigningIdentity, error)

func (*Platform) InitClients

func (p *Platform) InitClients()

func (*Platform) Load

func (p *Platform) Load()

func (*Platform) LocalMSPIdentityCert

func (p *Platform) LocalMSPIdentityCert(peer *node2.Peer) string

func (*Platform) LocalMSPPrivateKey

func (p *Platform) LocalMSPPrivateKey(peer *node2.Peer) string

func (*Platform) Members

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

func (*Platform) Name

func (p *Platform) Name() string

func (*Platform) NodeClientConfigPath

func (p *Platform) NodeClientConfigPath(peer *node2.Replica) string

func (*Platform) NodeCmdDir

func (p *Platform) NodeCmdDir(peer *node2.Replica) string

func (*Platform) NodeCmdPackage

func (p *Platform) NodeCmdPackage(peer *node2.Replica) string

func (*Platform) NodeCmdPath

func (p *Platform) NodeCmdPath(peer *node2.Replica) string

func (*Platform) NodeConfigPath

func (p *Platform) NodeConfigPath(peer *node2.Replica) string

func (*Platform) NodeDir

func (p *Platform) NodeDir(peer *node2.Replica) string

func (*Platform) NodeLocalCertPath

func (p *Platform) NodeLocalCertPath(node *node2.Peer) string

func (*Platform) NodeLocalPrivateKeyPath

func (p *Platform) NodeLocalPrivateKeyPath(node *node2.Peer) string

func (*Platform) NodeLocalTLSDir

func (p *Platform) NodeLocalTLSDir(peer *node2.Peer) string

func (*Platform) NodePort

func (p *Platform) NodePort(node *node2.Replica, portName api.PortName) uint16

func (*Platform) NodeStorageDir added in v0.4.1

func (p *Platform) NodeStorageDir(uniqueName string, dirName string) string

func (*Platform) NodeStorages added in v0.4.1

func (p *Platform) NodeStorages(uniqueName string) string

func (*Platform) OperationAddress

func (p *Platform) OperationAddress(peer *node2.Replica) string

func (*Platform) Organization

func (p *Platform) Organization(orgName string) *node2.Organization

func (*Platform) P2PCommunicationType added in v0.4.0

func (p *Platform) P2PCommunicationType() P2PCommunicationType

func (*Platform) Peer

func (p *Platform) Peer(orgName, peerName string) *node2.Peer

func (*Platform) PeerAddress

func (p *Platform) PeerAddress(peer *node2.Replica, portName api.PortName) string

func (*Platform) PeerHost added in v0.4.0

func (p *Platform) PeerHost(peer *node2.Replica) string

func (*Platform) PeerOrgs

func (p *Platform) PeerOrgs() []*node2.Organization

func (*Platform) PeerPort

func (p *Platform) PeerPort(peer *node2.Replica, portName api.PortName) uint16

func (*Platform) PeersInOrg

func (p *Platform) PeersInOrg(orgName string) []*node2.Peer

func (*Platform) PostRun

func (p *Platform) PostRun(bool)

func (*Platform) PreRun added in v0.4.1

func (p *Platform) PreRun()

func (*Platform) RoutingConfigPath added in v0.4.0

func (p *Platform) RoutingConfigPath() string

func (*Platform) StartSession

func (p *Platform) StartSession(cmd *exec.Cmd, name string) (*gexec.Session, error)

func (*Platform) Type

func (p *Platform) Type() string

type Resolver

type Resolver struct {
	Name      string
	Domain    string
	Identity  ResolverIdentity
	Addresses map[api.PortName]string
	Aliases   []string
	Port      int
}

type ResolverIdentity

type ResolverIdentity struct {
	ID   string
	Path string
}

type Templates added in v0.3.0

type Templates struct {
	Node   string `yaml:"node,omitempty"`
	Core   string `yaml:"core,omitempty"`
	Crypto string `yaml:"crypto,omitempty"`
}

Templates can be used to provide custom templates to GenerateConfigTree.

func (*Templates) CoreTemplate added in v0.3.0

func (t *Templates) CoreTemplate() string

func (*Templates) CryptoTemplate added in v0.3.0

func (t *Templates) CryptoTemplate() string

func (*Templates) NodeTemplate added in v0.3.0

func (t *Templates) NodeTemplate() string

type Topology

type Topology struct {
	TopologyName         string               `yaml:"name,omitempty"`
	TopologyType         string               `yaml:"type,omitempty"`
	Nodes                []*node.Node         `yaml:"peers,omitempty"`
	GRPCLogging          bool                 `yaml:"grpcLogging,omitempty"`
	Logging              *Logging             `yaml:"logging,omitempty"`
	LogToFile            bool                 `yaml:"logToFile,omitempty"`
	Templates            Templates            `yaml:"templates,omitempty"`
	Monitoring           Monitoring           `yaml:"monitoring,omitempty"`
	P2PCommunicationType P2PCommunicationType `yaml:"p2p_communication_type,omitempty"`
	// WebEnabled is used to activate the FSC web server
	WebEnabled bool `yaml:"web_enabled,omitempty"`
}

func NewTopology

func NewTopology() *Topology

NewTopology returns an empty FSC network topology.

func (*Topology) AddNodeByName

func (t *Topology) AddNodeByName(name string) *node.Node

AddNodeByName adds an empty new node with the passed name

func (*Topology) AddNodeFromTemplate

func (t *Topology) AddNodeFromTemplate(name string, template *node.Node) *node.Node

AddNodeFromTemplate adds a new node with the passed name and template

func (*Topology) AddSDK added in v0.2.0

func (t *Topology) AddSDK(sdk node2.SDK)

func (*Topology) DisablePrometheusTLS added in v0.3.0

func (t *Topology) DisablePrometheusTLS()

func (*Topology) EnableLogToFile

func (t *Topology) EnableLogToFile()

func (*Topology) EnablePrometheusMetrics

func (t *Topology) EnablePrometheusMetrics()

func (*Topology) EnableTracing added in v0.4.0

func (t *Topology) EnableTracing(typ tracing.TracerType)

func (*Topology) EnableTracingWithRatio added in v0.4.0

func (t *Topology) EnableTracingWithRatio(typ tracing.TracerType, ratio float64)

func (*Topology) ListNodes

func (t *Topology) ListNodes(ids ...string) []*node.Node

func (*Topology) Name

func (t *Topology) Name() string

func (*Topology) NewTemplate

func (t *Topology) NewTemplate(name string) *node.Node

func (*Topology) SetBootstrapNode

func (t *Topology) SetBootstrapNode(n *node.Node)

func (*Topology) SetLogging

func (t *Topology) SetLogging(spec, format 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