node

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: 8 Imported by: 10

Documentation

Index

Constants

View Source
const CoreTemplate = `` /* 5291-byte string literal not displayed */
View Source
const DefaultCryptoTemplate = `` /* 619-byte string literal not displayed */
View Source
const DefaultTemplate = `` /* 786-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

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 api.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) 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) 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) Parse

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

func (*Options) Put

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

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

func (*Peer) ID

func (p *Peer) ID() string

ID provides a unique identifier for a peer instance.

type PeerIdentity

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

type ResponderEntry

type ResponderEntry struct {
	Responder string
	Initiator string
}

type SDKEntry

type SDKEntry struct {
	Id   string
	Type 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"`
}

Jump to

Keyboard shortcuts

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