chaincode

package
v0.0.0-...-c9801ce Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataSmartContract

type MetadataSmartContract struct {
	contractapi.Contract
}

MetadataSmartContract provides functions for managing metadata records in the world state of a Fabric network.

func (*MetadataSmartContract) AddAggregator

func (s *MetadataSmartContract) AddAggregator(ctx contractapi.TransactionContextInterface, aggregatorId int, communicationKeysCyphersJSON string) error

AddAggregator issues a new aggregator record to the world state with the given details. The record is bound to the client's identity.

func (*MetadataSmartContract) AddAggregatorModelMetadata

func (s *MetadataSmartContract) AddAggregatorModelMetadata(
	ctx contractapi.TransactionContextInterface,
	aggregatorId int,
	epoch int,
	modelHashCid string,
	participantIdsJSON string,
) error

AddAggregatorModelMetadata issues a new aggregator's model aggregation metadata record to the world state with the given details. Can only be done by the owner of the aggregator or an admin.

func (*MetadataSmartContract) AddParticipant

func (s *MetadataSmartContract) AddParticipant(
	ctx contractapi.TransactionContextInterface,
	participantId int,
	encapsulatedKey string,
	homomorphicSharedKeyCypher string,
	communicationKeyCypher string,
) error

AddParticipant issues a participant record to the world state with the given details. The record is bound to the client's identity.

func (*MetadataSmartContract) AddParticipantModelMetadata

func (s *MetadataSmartContract) AddParticipantModelMetadata(
	ctx contractapi.TransactionContextInterface,
	participantId int,
	epoch int,
	modelHashCid string,
	homomorphicHash string,
) error

AddParticipantModelMetadata issues a new participant's model update metadata record to the world state with the given details. Can only be done by the owner of the participant or an admin.

func (*MetadataSmartContract) AggregatorExists

func (s *MetadataSmartContract) AggregatorExists(ctx contractapi.TransactionContextInterface, aggregatorId int) (bool, error)

AggregatorExists returns true when an aggregator record for the given aggregatorId exists in the world state

func (*MetadataSmartContract) AggregatorModelMetadataExists

func (s *MetadataSmartContract) AggregatorModelMetadataExists(ctx contractapi.TransactionContextInterface, aggregatorId int, epoch int) (bool, error)

AggregatorModelMetadataExists returns true when an aggregator model metadata record for the given epoch exists in the world state.

func (*MetadataSmartContract) DeleteAggregator

func (s *MetadataSmartContract) DeleteAggregator(ctx contractapi.TransactionContextInterface, aggregatorId int) error

DeleteAggregator deletes a given aggregator record from the world state. Can only be done by the owner of the aggregator or an admin.

func (*MetadataSmartContract) DeleteAggregatorModelMetadata

func (s *MetadataSmartContract) DeleteAggregatorModelMetadata(ctx contractapi.TransactionContextInterface, aggregatorId int, epoch int) error

DeleteAggregatorModelMetadata deletes a given aggregator model metadata record from the world state. Can only be done by the owner of the aggregator or an admin.

func (*MetadataSmartContract) DeleteAllAggregatorModelMetadata

func (s *MetadataSmartContract) DeleteAllAggregatorModelMetadata(ctx contractapi.TransactionContextInterface) error

DeleteAllAggregatorModelMetadata deletes all aggregator model metadata records from the world state. Can only be done by an admin.

func (*MetadataSmartContract) DeleteAllAggregators

DeleteAllAggregators deletes all aggregator records from the world state. Can only be done by an admin.

func (*MetadataSmartContract) DeleteAllParticipantModelMetadata

func (s *MetadataSmartContract) DeleteAllParticipantModelMetadata(ctx contractapi.TransactionContextInterface) error

DeleteAllParticipantModelMetadata deletes all participant model metadata records from the world state. Can only be done by an admin.

func (*MetadataSmartContract) DeleteAllParticipants

DeleteAllParticipants deletes all participant records from the world state. Can only be done by an admin.

func (*MetadataSmartContract) DeleteParticipant

func (s *MetadataSmartContract) DeleteParticipant(ctx contractapi.TransactionContextInterface, participantId int) error

DeleteParticipant deletes a given participant record from the world state. Can only be done by the owner of the participant or an admin.

func (*MetadataSmartContract) DeleteParticipantModelMetadata

func (s *MetadataSmartContract) DeleteParticipantModelMetadata(ctx contractapi.TransactionContextInterface, participantId int, epoch int) error

DeleteParticipantModelMetadata deletes a given participant model metadata record from the world state. Can only be done by the owner of the participant or an admin.

func (*MetadataSmartContract) GetAggregator

GetAggregator returns the aggregator record stored in the world state for the given aggregatorId.

func (*MetadataSmartContract) GetAggregatorModelMetadata

func (s *MetadataSmartContract) GetAggregatorModelMetadata(ctx contractapi.TransactionContextInterface, aggregatorId int, epoch int) (*shared.AggregatorModelMetadata, error)

GetAggregatorModelMetadata returns the aggregator's model aggregation metadata record stored in the world state for the given epoch.

func (*MetadataSmartContract) GetAllAggregatorModelMetadata

GetAllAggregatorModelMetadata returns all aggregator model metadata records found in the world state.

func (*MetadataSmartContract) GetAllAggregatorModelMetadataByAggregator

func (s *MetadataSmartContract) GetAllAggregatorModelMetadataByAggregator(ctx contractapi.TransactionContextInterface, aggregatorId int) ([]*shared.AggregatorModelMetadata, error)

GetAllAggregatorModelMetadataByAggregator returns all aggregator model metadata records found in the world state.

func (*MetadataSmartContract) GetAllAggregators

GetAllAggregators returns all aggregator records found in the world state.

func (*MetadataSmartContract) GetAllLogs

GetAllLogs returns the history for all objects in the world state. Can only be done by the admin.

func (*MetadataSmartContract) GetAllParticipantModelMetadata

GetAllParticipantModelMetadata returns all participant model metadata records found in the world state.

func (*MetadataSmartContract) GetAllParticipantModelMetadataByEpoch

func (s *MetadataSmartContract) GetAllParticipantModelMetadataByEpoch(ctx contractapi.TransactionContextInterface, epoch int) ([]*shared.ParticipantModelMetadata, error)

GetAllParticipantModelMetadataByEpoch returns all participant model metadata records found in the world state for the given epoch.

func (*MetadataSmartContract) GetAllParticipantModelMetadataByParticipant

func (s *MetadataSmartContract) GetAllParticipantModelMetadataByParticipant(ctx contractapi.TransactionContextInterface, participantId int) ([]*shared.ParticipantModelMetadata, error)

GetAllParticipantModelMetadataByParticipant returns all participant model metadata records found in the world state created by the participant.

func (*MetadataSmartContract) GetAllParticipants

GetAllParticipants returns all participant records found in the world state.

func (*MetadataSmartContract) GetParticipant

func (s *MetadataSmartContract) GetParticipant(ctx contractapi.TransactionContextInterface, participantId int) (*shared.Participant, error)

GetParticipant returns the participant record stored in the world state for the given id.

func (*MetadataSmartContract) GetParticipantModelMetadata

func (s *MetadataSmartContract) GetParticipantModelMetadata(ctx contractapi.TransactionContextInterface, participantId int, epoch int) (*shared.ParticipantModelMetadata, error)

GetParticipantModelMetadata returns the participant's model update metadata record stored in the world state for the given participantId and epoch.

func (*MetadataSmartContract) ParticipantExists

func (s *MetadataSmartContract) ParticipantExists(ctx contractapi.TransactionContextInterface, participantId int) (bool, error)

ParticipantExists returns true when a participant record for the given id exists in the world state.

func (*MetadataSmartContract) ParticipantModelMetadataExists

func (s *MetadataSmartContract) ParticipantModelMetadataExists(ctx contractapi.TransactionContextInterface, participantId int, epoch int) (bool, error)

ParticipantModelMetadataExists returns true when a participant model metadata record for the given participantId and epoch exists in the world state.

func (*MetadataSmartContract) UpdateAggregator

func (s *MetadataSmartContract) UpdateAggregator(ctx contractapi.TransactionContextInterface, aggregatorId int, communicationKeysCyphersJSON string) error

UpdateAggregator updates an existing aggregator record in the world state with provided parameters. Can only be done by the owner of the aggregator or an admin.

func (*MetadataSmartContract) UpdateAggregatorModelMetadata

func (s *MetadataSmartContract) UpdateAggregatorModelMetadata(
	ctx contractapi.TransactionContextInterface,
	aggregatorId int,
	epoch int,
	modelHashCid string,
	participantIdsJSON string,
) error

UpdateAggregatorModelMetadata updates an existing aggregator model metadata record in the world state with provided parameters. Can only be done by the owner of the aggregator or an admin.

func (*MetadataSmartContract) UpdateParticipant

func (s *MetadataSmartContract) UpdateParticipant(
	ctx contractapi.TransactionContextInterface,
	participantId int,
	encapsulatedKey string,
	homomorphicSharedKeyCypher string,
	communicationKeyCypher string,
) error

UpdateParticipant updates a participant record in the world state with provided parameters. Can only be done by the owner of the participant or an admin.

func (*MetadataSmartContract) UpdateParticipantModelMetadata

func (s *MetadataSmartContract) UpdateParticipantModelMetadata(
	ctx contractapi.TransactionContextInterface,
	participantId int,
	epoch int,
	modelHashCid string,
	homomorphicHash string,
) error

UpdateParticipantModelMetadata updates an existing participant model metadata record in the world state with provided parameters. Can only be done by the owner of the participant or an admin.

Jump to

Keyboard shortcuts

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