node

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 12 Imported by: 13

Documentation

Index

Constants

View Source
const CoreTemplate = `` /* 6153-byte string literal not displayed */
View Source
const DefaultCryptoTemplate = `` /* 686-byte string literal not displayed */
View Source
const DefaultTemplate = `` /* 800-byte string literal not displayed */
View Source
const RoutingTemplate = `` /* 128-byte string literal not displayed */

Variables

This section is empty.

Functions

func ReplicaUniqueName added in v0.4.0

func ReplicaUniqueName(nodeName string, r int) string

Types

type Alias

type Alias struct {
	Original string
	Alias    string
}

type CA

type CA struct {
	Hostname string `yaml:"hostname,omitempty"`
}

type Factory

type Factory interface {
	// NewView returns an instance of the View interface build using the passed argument.
	NewView(in []byte) (view.View, error)
}

Factory is used to create instances of the View interface

type FactoryEntry

type FactoryEntry struct {
	Id   string
	Type string
}

type Node

type Node struct {
	Synthesizer    `yaml:"Synthesizer,omitempty"`
	Name           string   `yaml:"name,omitempty"`
	Bootstrap      bool     `yaml:"bootstrap,omitempty"`
	ExecutablePath string   `yaml:"executablePath,omitempty"`
	Path           string   `yaml:"path,omitempty"`
	Options        *Options `yaml:"options,omitempty"`
}

func NewNode

func NewNode(name string) *Node

func NewNodeFromTemplate

func NewNodeFromTemplate(name string, template *Node) *Node

func (*Node) AddOptions

func (n *Node) AddOptions(opts ...Option) *Node

func (*Node) AddSDK

func (n *Node) AddSDK(sdk node.SDK) *Node

AddSDK adds a reference to the passed SDK. AddSDK expects to find a constructor named 'New' followed by the type name of the passed reference.

func (*Node) AddSDKWithBase added in v0.4.1

func (n *Node) AddSDKWithBase(base node.SDK, sdks ...node.SDK) *Node

func (*Node) Alias

func (n *Node) Alias(i string) string

func (*Node) ID

func (n *Node) ID() string

func (*Node) PlatformOpts

func (n *Node) PlatformOpts() *Options

func (*Node) RegisterResponder

func (n *Node) RegisterResponder(responder view.View, initiator view.View) *Node

RegisterResponder registers the passed responder to the passed initiator

func (*Node) RegisterViewFactory

func (n *Node) RegisterViewFactory(id string, factory Factory) *Node

func (*Node) ReplicaUniqueNames added in v0.4.0

func (n *Node) ReplicaUniqueNames() []string

func (*Node) SetBootstrap

func (n *Node) SetBootstrap() *Node

func (*Node) SetExecutable

func (n *Node) SetExecutable(ExecutablePath string) *Node

SetExecutable sets the executable path of this node

type Option

type Option func(*Options) error

type Options

type Options struct {
	Mapping map[string]interface{}
}

func (*Options) AddAlias

func (o *Options) AddAlias(alias string)

func (*Options) Aliases

func (o *Options) Aliases() []string

func (*Options) Get

func (o *Options) Get(k string) interface{}

func (*Options) GetAllPersistenceKeys added in v0.4.1

func (o *Options) GetAllPersistenceKeys() []PersistenceKey

func (*Options) GetPersistenceName added in v0.4.1

func (o *Options) GetPersistenceName(k PersistenceKey) (driver2.PersistenceName, bool)

func (*Options) GetPostgresPersistence added in v0.4.1

func (o *Options) GetPostgresPersistence(k driver2.PersistenceName) *SQLOpts

func (*Options) GetPostgresPersistences added in v0.4.1

func (o *Options) GetPostgresPersistences() map[driver2.PersistenceName]*SQLOpts

func (*Options) Parse

func (o *Options) Parse(opts ...Option) error

func (*Options) Put

func (o *Options) Put(k string, v interface{})

func (*Options) PutPersistenceKey added in v0.4.1

func (o *Options) PutPersistenceKey(k PersistenceKey)

func (*Options) PutPostgresPersistence added in v0.4.1

func (o *Options) PutPostgresPersistence(k driver2.PersistenceName, p SQLOpts)

func (*Options) PutPostgresPersistenceName added in v0.4.1

func (o *Options) PutPostgresPersistenceName(k PersistenceKey, p driver2.PersistenceName)

func (*Options) ReplicationFactor added in v0.4.0

func (o *Options) ReplicationFactor() int

type Organization

type Organization struct {
	ID            string   `yaml:"id,omitempty"`
	MSPID         string   `yaml:"msp_id,omitempty"`
	MSPType       string   `yaml:"msp_type,omitempty"`
	Name          string   `yaml:"name,omitempty"`
	Domain        string   `yaml:"domain,omitempty"`
	EnableNodeOUs bool     `yaml:"enable_node_organizational_units"`
	Users         int      `yaml:"users,omitempty"`
	CA            *CA      `yaml:"ca,omitempty"`
	UserNames     []string `yaml:"userNames,omitempty"`
}

Organization models information about an Organization. It includes the information needed to populate an MSP with cryptogen.

type Peer

type Peer struct {
	*Node
	Name            string          `yaml:"name,omitempty"`
	Organization    string          `yaml:"organization,omitempty"`
	Bootstrap       bool            `yaml:"bootstrap,omitempty"`
	ExecutablePath  string          `yaml:"executablepath,omitempty"`
	ExtraIdentities []*PeerIdentity `yaml:"extraidentities,omitempty"`
	Admins          []string        `yaml:"admins,omitempty"`
	Aliases         []string        `yaml:"aliases,omitempty"`
}

Peer defines an FSC node instance

type PeerIdentity

type PeerIdentity struct {
	ID           string
	EnrollmentID string
	MSPType      string
	MSPID        string
	Org          string
}

type PersistenceKey added in v0.4.1

type PersistenceKey string

type PersistenceOpts added in v0.4.0

type PersistenceOpts struct {
	Type driver.PersistenceType
	SQL  *SQLOpts
}

type Replica added in v0.4.0

type Replica struct {
	*Peer
	UniqueName string
}

func NewReplica added in v0.4.0

func NewReplica(peer *Peer, uniqueName string) *Replica

func (*Replica) ID added in v0.4.0

func (p *Replica) ID() string

ID provides a unique identifier for a peer instance.

type ResponderEntry

type ResponderEntry struct {
	Responder string
	Initiator string
}

type SDKElement added in v0.4.1

type SDKElement struct {
	Type  reflect.Type
	Alias string
}

type SDKEntry

type SDKEntry struct {
	Id   string
	Type string
}

type SQLOpts added in v0.4.0

type SQLOpts struct {
	DataSource string
}

type Synthesizer

type Synthesizer struct {
	Aliases    map[string]Alias `yaml:"Aliases,omitempty"`
	Imports    []string         `yaml:"Imports,omitempty"`
	Factories  []FactoryEntry   `yaml:"Factories,omitempty"`
	SDKs       []SDKEntry       `yaml:"SDKs,omitempty"`
	Responders []ResponderEntry `yaml:"Responders,omitempty"`
}

Directories

Path Synopsis
mocks

Jump to

Keyboard shortcuts

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