token

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: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTokenGenPath = "github.com/hyperledger-labs/fabric-token-sdk/cmd/tokengen"
)
View Source
const Extension = `
token:
  enabled: true
  ttxdb:
    persistence:
      type: badger
      opts:
        path: {{ NodeKVSPath }}
`
View Source
const (
	TopologyName = "token"
)

Variables

View Source
var (
	Drivers = []string{"dlog", "fabtoken"}
)

Functions

func NewPlatformFactory

func NewPlatformFactory() *platformFactory

func WithAuditorIdentity

func WithAuditorIdentity() fsc.Option

func WithAuditorIdentityWithHSM

func WithAuditorIdentityWithHSM() fsc.Option

func WithCertifierIdentity

func WithCertifierIdentity() fsc.Option

func WithDefaultIssuerIdentity

func WithDefaultIssuerIdentity() fsc.Option

func WithDefaultIssuerIdentityWithHSM

func WithDefaultIssuerIdentityWithHSM() fsc.Option

func WithDefaultOwnerIdentity

func WithDefaultOwnerIdentity() fsc.Option

func WithIssuerIdentity

func WithIssuerIdentity(label string) fsc.Option

func WithIssuerIdentityWithHSM

func WithIssuerIdentityWithHSM(label string) fsc.Option

func WithOwnerIdentity

func WithOwnerIdentity(label string) fsc.Option

func WithRemoteOwnerIdentity added in v0.3.0

func WithRemoteOwnerIdentity(label string) fsc.Option

Types

type BackedTopology

type BackedTopology interface {
	Name() string
}

type NetworkHandler

type NetworkHandler interface {
	GenerateArtifacts(tms *topology2.TMS)
	GenerateExtension(tms *topology2.TMS, node *sfcnode.Node) string
	PostRun(load bool, tms *topology2.TMS)
	GenIssuerCryptoMaterial(tms *topology2.TMS, nodeID string, walletID string) string
	GenOwnerCryptoMaterial(tms *topology2.TMS, nodeID string, walletID string, useCAIfAvailable bool) string
	UpdateChaincodePublicParams(tms *topology2.TMS, ppRaw []byte)
	Cleanup()
}

type PF added in v0.2.0

type PF interface {
	GetTopology() *Topology
	GenIssuerCryptoMaterial(tmsNetwork string, fscNode string, walletID string) string
	GenOwnerCryptoMaterial(tmsNetwork string, fscNode string, walletID string, useCAIfAvailable bool) string
}

func GetPlatform

func GetPlatform(ctx *context.Context, id string) PF

GetPlatform returns the token platform from the passed context bound to the passed id. It returns nil, if nothing is found

type Platform

type Platform struct {
	Context                api2.Context
	Topology               *Topology
	Builder                api2.Builder
	EventuallyTimeout      time.Duration
	PublicParamsGenerators map[string]generators.PublicParamsGenerator
	NetworkHandlers        map[string]NetworkHandler

	TokenGenPath string
	ColorIndex   int
}

func NewPlatform

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

func (*Platform) AddNetworkHandler

func (p *Platform) AddNetworkHandler(label string, nh NetworkHandler)

func (*Platform) Cleanup

func (p *Platform) Cleanup()

func (*Platform) FSCNodeKVSDir

func (p *Platform) FSCNodeKVSDir(peer *sfcnode.Node) string

func (*Platform) GenIssuerCryptoMaterial

func (p *Platform) GenIssuerCryptoMaterial(tmsNetwork string, fscNode string, walletID string) string

func (*Platform) GenOwnerCryptoMaterial added in v0.2.0

func (p *Platform) GenOwnerCryptoMaterial(tmsNetwork string, fscNode string, walletID string, useCAIfAvailable bool) string

func (*Platform) GenerateArtifacts

func (p *Platform) GenerateArtifacts()

func (*Platform) GenerateConfigTree

func (p *Platform) GenerateConfigTree()

func (*Platform) GenerateExtension

func (p *Platform) GenerateExtension(node *sfcnode.Node)

func (*Platform) GetBuilder

func (p *Platform) GetBuilder() api2.Builder

func (*Platform) GetContext

func (p *Platform) GetContext() api2.Context

func (*Platform) GetPublicParamsGenerators

func (p *Platform) GetPublicParamsGenerators(driver string) generators.PublicParamsGenerator

func (*Platform) GetTopology added in v0.2.0

func (p *Platform) GetTopology() *Topology

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(load bool)

func (*Platform) PublicParameters

func (p *Platform) PublicParameters(tms *topology2.TMS) []byte

func (*Platform) PublicParametersDir

func (p *Platform) PublicParametersDir() string

func (*Platform) PublicParametersFile

func (p *Platform) PublicParametersFile(tms *topology2.TMS) string

func (*Platform) SetPublicParamsGenerator

func (p *Platform) SetPublicParamsGenerator(name string, gen generators.PublicParamsGenerator)

func (*Platform) StartSession

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

func (*Platform) TokenDir

func (p *Platform) TokenDir() string

func (*Platform) TokenGen

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

func (*Platform) Type

func (p *Platform) Type() string

func (*Platform) UpdatePublicParams added in v0.2.0

func (p *Platform) UpdatePublicParams(tms *topology2.TMS, publicParams []byte)

type Topology

type Topology struct {
	TopologyName string `yaml:"name,omitempty"`
	TopologyType string `yaml:"type,omitempty"`

	TMSs []*topology.TMS
}

func NewTopology

func NewTopology() *Topology

func (*Topology) AddTMS

func (t *Topology) AddTMS(fscNodes []*node.Node, backend BackedTopology, channel string, driver string) *topology.TMS

func (*Topology) DefaultChannel

func (t *Topology) DefaultChannel() string

func (*Topology) GetTMSs

func (t *Topology) GetTMSs() []*topology.TMS

func (*Topology) Name

func (t *Topology) Name() string

func (*Topology) SetSDK

func (t *Topology) SetSDK(fscTopology *fsc.Topology, sdk api.SDK)

func (*Topology) Type

func (t *Topology) Type() string

Directories

Path Synopsis
dlog/mock
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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