fabric

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigFile  string // ConfigFile is path of sdk configuration file
	ChannelID   string // ChannelID indicates Channel id
	ChaincodeID string // ChaincodeID indicates name of ChainCode installed on Channel
	UserName    string // UserName is name of user used to request fabric network
	OrgName     string // OrgName indicates the organization User belongs to, with which to request fabric network
}

Config configures fabric driver

type Fabric

type Fabric struct {
	Config        *Config
	Sdk           *fabsdk.FabricSDK // Sdk is Fabric SDK instance
	ChannelClient *channel.Client   // ChannelClient is client to request channel
	// contains filtered or unexported fields
}

func New

func New(conf *conf.FabricConf) (*Fabric, error)

New new Fabric

func (*Fabric) AddFileNs

func (f *Fabric) AddFileNs(opt *blockchain.AddNsOptions) error

AddFileNs adds file namespace

func (*Fabric) AddNode

func (f *Fabric) AddNode(opt *blockchain.AddNodeOptions) error

AddNode adds a storage node to fabric

func (*Fabric) ChallengeAnswer

func (f *Fabric) ChallengeAnswer(opt *blockchain.ChallengeAnswerOptions) ([]byte, error)

ChallengeAnswer sets a storage node's challenge answer onto blockchain

func (*Fabric) ChallengeRequest

func (f *Fabric) ChallengeRequest(opt *blockchain.ChallengeRequestOptions) error

ChallengeRequest sets a dataowner's challenge request on chain

func (*Fabric) ConfirmFileAuthApplication

func (f *Fabric) ConfirmFileAuthApplication(opt *blockchain.ConfirmFileAuthOptions) error

ConfirmFileAuthApplication dataOwner node confirms the applier's file authorization application

func (*Fabric) GetAuthApplicationByID

func (f *Fabric) GetAuthApplicationByID(authID string) (blockchain.FileAuthApplication, error)

GetAuthApplicationByID query authorization application detail by authID

func (*Fabric) GetChallengeByID

func (f *Fabric) GetChallengeByID(id string) (blockchain.Challenge, error)

GetChallengeByID gets a challenge by challengeID

func (*Fabric) GetChallengeNum

func (f *Fabric) GetChallengeNum(opt *blockchain.GetChallengeNumOptions) (uint64, error)

GetChallengeNum gets challenge number given filter condition filter condition may include storageNode, challenge status, time period

func (*Fabric) GetFileByID

func (f *Fabric) GetFileByID(id string) (blockchain.File, error)

GetFileByID gets file by id from fabric

func (*Fabric) GetFileByName

func (f *Fabric) GetFileByName(owner []byte, ns, name string) (blockchain.File, error)

GetFileByName gets file by name from fabric

func (*Fabric) GetHeartbeatNum

func (f *Fabric) GetHeartbeatNum(id []byte, timestamp int64) (int, error)

GetHeartbeatNum gets storage heartbeat number by time

func (*Fabric) GetNode

func (f *Fabric) GetNode(id []byte) (node blockchain.Node, err error)

GetNode gets storage node by id

func (*Fabric) GetNodeHealth

func (f *Fabric) GetNodeHealth(id []byte) (string, error)

GetNodeHealth gets storage node health status

func (*Fabric) GetNsByName

func (f *Fabric) GetNsByName(owner []byte, name string) (blockchain.Namespace, error)

GetNsByName gets namespace by nsName from fabric

func (*Fabric) GetSliceMigrateRecords

func (f *Fabric) GetSliceMigrateRecords(opt *blockchain.NodeSliceMigrateOptions) (string, error)

GetSliceMigrateRecords get storage node slice migration records

func (*Fabric) Heartbeat

func (f *Fabric) Heartbeat(opt *blockchain.NodeHeartBeatOptions) error

Heartbeat updates heartbeat of storage node

func (*Fabric) InvokeContract

func (f *Fabric) InvokeContract(args [][]byte, mName string) ([]byte, error)

InvokeContract invokes the contract

func (*Fabric) ListChallengeRequests

func (f *Fabric) ListChallengeRequests(opt *blockchain.ListChallengeOptions) ([]blockchain.Challenge, error)

ListChallengeRequests lists challenge requests on chain filter condition may include fileOwner, storageNode, fileID, challenge status, time period and items number limit

func (*Fabric) ListExpiredFiles

func (f *Fabric) ListExpiredFiles(opt *blockchain.ListFileOptions) ([]blockchain.File, error)

ListExpiredFiles lists expired but valid files filter condition may include fileOwner, namespace, time period and items numb limit

func (*Fabric) ListFileAuthApplications

func (f *Fabric) ListFileAuthApplications(opt *blockchain.ListFileAuthOptions) (blockchain.FileAuthApplications, error)

ListFileAuthApplications query the list of authorization applications Support query by time range and fileID

func (*Fabric) ListFileNs

func (f *Fabric) ListFileNs(opt *blockchain.ListNsOptions) ([]blockchain.Namespace, error)

ListFileNs lists file namespaces by owner

func (*Fabric) ListFiles

func (f *Fabric) ListFiles(opt *blockchain.ListFileOptions) ([]blockchain.File, error)

ListFiles lists files from fabric filter condition may include fileOwner, namespace, time period and items numb limit

func (*Fabric) ListNodes

func (f *Fabric) ListNodes() (blockchain.Nodes, error)

ListNodes gets all storage nodes from fabric

func (*Fabric) ListNodesExpireSlice

func (f *Fabric) ListNodesExpireSlice(opt *blockchain.ListNodeSliceOptions) ([][2]string, error)

ListNodesExpireSlice lists expired slices from fabric returns a list of sliceID(first value of [2]string) and its StorageIndex(second value of [2]string)

func (*Fabric) NodeOffline

func (f *Fabric) NodeOffline(opt *blockchain.NodeOperateOptions) error

NodeOffline set node status on chain to offline

func (*Fabric) NodeOnline

func (f *Fabric) NodeOnline(opt *blockchain.NodeOperateOptions) error

NodeOnline set node status on chain to online

func (*Fabric) PublishFile

func (f *Fabric) PublishFile(opt *blockchain.PublishFileOptions) error

PublishFile publishes file onto fabric

func (*Fabric) PublishFileAuthApplication

func (f *Fabric) PublishFileAuthApplication(opt *blockchain.PublishFileAuthOptions) error

PublishFileAuthApplication used for appliers to publish file authorization application

func (*Fabric) QueryContract

func (f *Fabric) QueryContract(args [][]byte, mName string) ([]byte, error)

QueryContract queries the contract

func (*Fabric) RejectFileAuthApplication

func (f *Fabric) RejectFileAuthApplication(opt *blockchain.ConfirmFileAuthOptions) error

RejectFileAuthApplication dataOwner node rejects the applier's file authorization application and gives the reason for the rejection

func (*Fabric) SliceMigrateRecord

func (f *Fabric) SliceMigrateRecord(opt *blockchain.SliceMigrateOptions) error

SliceMigrateRecord is used by node to slice migration record

func (*Fabric) UpdateFileExpireTime

func (f *Fabric) UpdateFileExpireTime(opt *blockchain.UpdateExptimeOptions) (blockchain.File, error)

UpdateFileExpireTime updates file expiration time

func (*Fabric) UpdateFilePublicSliceMeta

func (f *Fabric) UpdateFilePublicSliceMeta(opt *blockchain.UpdateFilePSMOptions) error

UpdateFilePublicSliceMeta is used to update file public slice metas

func (*Fabric) UpdateNsReplica

func (f *Fabric) UpdateNsReplica(opt *blockchain.UpdateNsReplicaOptions) error

UpdateNsReplica updates file namespace replica

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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