core

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ManifestVersionUnset uint = 0
	ManifestVersion1     uint = 1
)
View Source
const (
	// ChartHistogramMaxBuckets max buckets that can be requested
	ChartHistogramMaxBuckets = 100
	// ChartHistogramMinBuckets min buckets that can be requested
	ChartHistogramMinBuckets = 1
)
View Source
const (
	// SystemTopicDefinitions is the FireFly event topic for events that are confirmations of definition of pre-defined datatypes
	SystemTopicDefinitions = "ff_definition"
	// SystemBatchPinTopic is the FireFly event topic for events from the FireFly batch pin listener
	SystemBatchPinTopic = "ff_batch_pin"
)
View Source
const (
	// SystemTagDefineDatatype is the tag for messages that broadcast data definitions
	SystemTagDefineDatatype = "ff_define_datatype"
	// DeprecatedSystemTagDefineOrganization is the tag for messages that broadcast organization definitions
	DeprecatedSystemTagDefineOrganization = "ff_define_organization"
	// DeprecatedSystemTagDefineNode is the tag for messages that broadcast node definitions
	DeprecatedSystemTagDefineNode = "ff_define_node"
	// SystemTagDefineGroup is the tag for messages that send the definition of a group, to all parties in that group
	SystemTagDefineGroup = "ff_define_group"
	// SystemTagDefinePool is the tag for messages that broadcast data definitions
	SystemTagDefinePool = "ff_define_pool"
	// SystemTagDefineFFI is the tag for messages that broadcast contract FFIs
	SystemTagDefineFFI = "ff_define_ffi"
	// SystemTagDefineContractAPI is the tag for messages that broadcast contract APIs
	SystemTagDefineContractAPI = "ff_define_contract_api"
	// SystemTagIdentityClaim is the tag for messages that broadcast an identity claim
	SystemTagIdentityClaim = "ff_identity_claim"
	//nolint:gosec
	// SystemTagIdentityVerification is the tag for messages that broadcast an identity verification
	SystemTagIdentityVerification = "ff_identity_verification"
	// SystemTagIdentityUpdate is the tag for messages that broadcast an identity update
	SystemTagIdentityUpdate = "ff_identity_update"
	// SystemTagGapFill is the tag for messages that provide a nonce gap fill for a message that failed to send
	SystemTagGapFill = "ff_gap_fill"
)
View Source
const (
	HTTPHeadersBlobHashSHA256 = "x-ff-blob-hash-sha256"
	HTTPHeadersBlobSize       = "x-ff-blob-size"
)
View Source
const (
	DIDPrefix              = "did:"
	FireFlyDIDPrefix       = "did:firefly:"
	FireFlyOrgDIDPrefix    = "did:firefly:org/"
	FireFlyNodeDIDPrefix   = "did:firefly:node/"
	FireFlyCustomDIDPrefix = "did:firefly:"
)
View Source
const (
	// DefaultTopic will be set as the topic of any messages set without a topic
	DefaultTopic = "default"
)
View Source
const (
	// DeployContract is the header for DeployContract request
	DeployContract = "DeployContract"
)
View Source
const (

	// LegacySystemNamespace is the system reserved namespace name (deprecated)
	LegacySystemNamespace = "ff_system"
)

Variables

View Source
var (
	// BatchTypeBroadcast is a batch that is broadcast via the shared data interface
	BatchTypeBroadcast = fftypes.FFEnumValue("batchtype", "broadcast")
	// BatchTypePrivate is a batch that is sent privately to a group
	BatchTypePrivate = fftypes.FFEnumValue("batchtype", "private")
)
View Source
var (
	// CallTypeInvoke is an invocation that submits a transaction for inclusion in the chain
	CallTypeInvoke = fftypes.FFEnumValue("contractcalltype", "invoke")
	// CallTypeQuery is a query that returns data from the chain
	CallTypeQuery = fftypes.FFEnumValue("contractcalltype", "query")
)
View Source
var (
	// ValidatorTypeJSON is the validator type for JSON Schema validation
	ValidatorTypeJSON = fftypes.FFEnumValue("validatortype", "json")
	// ValidatorTypeNone explicitly disables validation, even when a datatype is set. Allowing categorization of datatype without validation.
	ValidatorTypeNone = fftypes.FFEnumValue("validatortype", "none")
	// ValidatorTypeSystemDefinition is the validator type for system definitions
	ValidatorTypeSystemDefinition = fftypes.FFEnumValue("validatortype", "definition")
)
View Source
var (
	// EventTypeTransactionSubmitted occurs only on the node that initiates a tranaction, when the transaction is submitted
	EventTypeTransactionSubmitted = fftypes.FFEnumValue("eventtype", "transaction_submitted")
	// EventTypeMessageConfirmed is the most important event type in the system. This means a message and all of its data
	// is available for processing by an application. Most applications only need to listen to this event type
	EventTypeMessageConfirmed = fftypes.FFEnumValue("eventtype", "message_confirmed")
	// EventTypeMessageRejected occurs if a message is received and confirmed from a sequencing perspective, but is rejected as invalid (mismatch to schema, or duplicate system broadcast)
	EventTypeMessageRejected = fftypes.FFEnumValue("eventtype", "message_rejected")
	// EventTypeDatatypeConfirmed occurs when a new datatype is ready for use (on the namespace of the datatype)
	EventTypeDatatypeConfirmed = fftypes.FFEnumValue("eventtype", "datatype_confirmed")
	// EventTypeIdentityConfirmed occurs when a new identity has been confirmed, as as result of a signed claim broadcast, and any associated claim verification
	EventTypeIdentityConfirmed = fftypes.FFEnumValue("eventtype", "identity_confirmed")
	// EventTypeIdentityUpdated occurs when an existing identity is update by the owner of that identity
	EventTypeIdentityUpdated = fftypes.FFEnumValue("eventtype", "identity_updated")
	// EventTypePoolConfirmed occurs when a new token pool is ready for use
	EventTypePoolConfirmed = fftypes.FFEnumValue("eventtype", "token_pool_confirmed")
	// EventTypePoolOpFailed occurs when a token pool creation initiated by this node has failed (based on feedback from connector)
	EventTypePoolOpFailed = fftypes.FFEnumValue("eventtype", "token_pool_op_failed")
	// EventTypeTransferConfirmed occurs when a token transfer has been confirmed
	EventTypeTransferConfirmed = fftypes.FFEnumValue("eventtype", "token_transfer_confirmed")
	// EventTypeTransferOpFailed occurs when a token transfer submitted by this node has failed (based on feedback from connector)
	EventTypeTransferOpFailed = fftypes.FFEnumValue("eventtype", "token_transfer_op_failed")
	// EventTypeApprovalConfirmed occurs when a token approval has been confirmed
	EventTypeApprovalConfirmed = fftypes.FFEnumValue("eventtype", "token_approval_confirmed")
	// EventTypeApprovalOpFailed occurs when a token approval submitted by this node has failed (based on feedback from connector)
	EventTypeApprovalOpFailed = fftypes.FFEnumValue("eventtype", "token_approval_op_failed")
	// EventTypeContractInterfaceConfirmed occurs when a new contract interface has been confirmed
	EventTypeContractInterfaceConfirmed = fftypes.FFEnumValue("eventtype", "contract_interface_confirmed")
	// EventTypeContractAPIConfirmed occurs when a new contract API has been confirmed
	EventTypeContractAPIConfirmed = fftypes.FFEnumValue("eventtype", "contract_api_confirmed")
	// EventTypeBlockchainEventReceived occurs when a new event has been received from the blockchain
	EventTypeBlockchainEventReceived = fftypes.FFEnumValue("eventtype", "blockchain_event_received")
	// EventTypeBlockchainInvokeOpSucceeded occurs when a blockchain "invoke" request has succeeded
	EventTypeBlockchainInvokeOpSucceeded = fftypes.FFEnumValue("eventtype", "blockchain_invoke_op_succeeded")
	// EventTypeBlockchainInvokeOpFailed occurs when a blockchain "invoke" request has failed
	EventTypeBlockchainInvokeOpFailed = fftypes.FFEnumValue("eventtype", "blockchain_invoke_op_failed")
	// EventTypeBlockchainContractDeployOpSucceeded occurs when a contract deployment request has succeeded
	EventTypeBlockchainContractDeployOpSucceeded = fftypes.FFEnumValue("eventtype", "blockchain_contract_deploy_op_succeeded")
	// EventTypeBlockchainContractDeployOpFailed occurs when a contract deployment request has failed
	EventTypeBlockchainContractDeployOpFailed = fftypes.FFEnumValue("eventtype", "blockchain_contract_deploy_op_failed")
)
View Source
var (
	// IdentityTypeOrg is an organization
	IdentityTypeOrg = fftypes.FFEnumValue("identitytype", "org")
	// IdentityTypeNode is a node
	IdentityTypeNode = fftypes.FFEnumValue("identitytype", "node")
	// IdentityTypeCustom is a user defined identity within a namespace
	IdentityTypeCustom = fftypes.FFEnumValue("identitytype", "custom")
)
View Source
var (
	// MessageTypeDefinition is a message broadcasting a definition of a system type, pre-defined by firefly (namespaces, identities, data definitions, etc.)
	MessageTypeDefinition = fftypes.FFEnumValue("messagetype", "definition")
	// MessageTypeBroadcast is a broadcast message, meaning it is intended to be visible by all parties in the network
	MessageTypeBroadcast = fftypes.FFEnumValue("messagetype", "broadcast")
	// MessageTypePrivate is a private message, meaning it is only sent explicitly to individual parties in the network
	MessageTypePrivate = fftypes.FFEnumValue("messagetype", "private")
	// MessageTypeGroupInit is a special private message that contains the definition of the group
	MessageTypeGroupInit = fftypes.FFEnumValue("messagetype", "groupinit")
	// MessageTypeDeprecatedTransferBroadcast is deprecated - use MessageTypeBroadcast (and refer to TxParent.Type)
	MessageTypeDeprecatedTransferBroadcast = fftypes.FFEnumValue("messagetype", "transfer_broadcast")
	// MessageTypeDeprecatedTransferPrivate is deprecated - use MessageTypePrivate (and refer to TxParent.Type)
	MessageTypeDeprecatedTransferPrivate = fftypes.FFEnumValue("messagetype", "transfer_private")
	// MessageTypeDeprecatedApprovalBroadcast is deprecated - use MessageTypeBroadcast (and refer to TxParent.Type)
	MessageTypeDeprecatedApprovalBroadcast = fftypes.FFEnumValue("messagetype", "approval_broadcast")
	// MessageTypeDeprecatedApprovalPrivate is a deprecated - use MessageTypePrivate (and refer to TxParent.Type)
	MessageTypeDeprecatedApprovalPrivate = fftypes.FFEnumValue("messagetype", "approval_private")
)
View Source
var (
	// MessageStateStaged is a message created locally which is not ready to send
	MessageStateStaged = fftypes.FFEnumValue("messagestate", "staged")
	// MessageStateReady is a message created locally which is ready to send
	MessageStateReady = fftypes.FFEnumValue("messagestate", "ready")
	// MessageStateSent is a message created locally which has been sent in a batch
	MessageStateSent = fftypes.FFEnumValue("messagestate", "sent")
	// MessageStatePending is a message that has been received but is awaiting aggregation/confirmation
	MessageStatePending = fftypes.FFEnumValue("messagestate", "pending")
	// MessageStateConfirmed is a message that has completed all required confirmations (blockchain if pinned, token transfer if transfer coupled, etc)
	MessageStateConfirmed = fftypes.FFEnumValue("messagestate", "confirmed")
	// MessageStateRejected is a message that has completed confirmation, but has been rejected by FireFly
	MessageStateRejected = fftypes.FFEnumValue("messagestate", "rejected")
	// MessageStateCancelled is a message that was cancelled without being sent
	MessageStateCancelled = fftypes.FFEnumValue("messagestate", "cancelled")
)
View Source
var (
	// OffsetTypeBatch is an offset stored by the batch manager on the messages table
	OffsetTypeBatch = fftypes.FFEnumValue("offsettype", "batch")
	// OffsetTypeAggregator is an offset stored by the aggregator on the events table
	OffsetTypeAggregator = fftypes.FFEnumValue("offsettype", "aggregator")
	// OffsetTypeSubscription is an offeset stored by a dispatcher on the events table
	OffsetTypeSubscription = fftypes.FFEnumValue("offsettype", "subscription")
)
View Source
var (
	// OpTypeBlockchainPinBatch is a blockchain transaction to pin a batch
	OpTypeBlockchainPinBatch = fftypes.FFEnumValue("optype", "blockchain_pin_batch")
	// OpTypeBlockchainNetworkAction is an administrative action on a multiparty blockchain network
	OpTypeBlockchainNetworkAction = fftypes.FFEnumValue("optype", "blockchain_network_action")
	// OpTypeBlockchainContractDeploy is a smart contract deploy
	OpTypeBlockchainContractDeploy = fftypes.FFEnumValue("optype", "blockchain_deploy")
	// OpTypeBlockchainInvoke is a smart contract invoke
	OpTypeBlockchainInvoke = fftypes.FFEnumValue("optype", "blockchain_invoke")
	// OpTypeSharedStorageUploadBatch is a shared storage operation to upload broadcast data
	OpTypeSharedStorageUploadBatch = fftypes.FFEnumValue("optype", "sharedstorage_upload_batch")
	// OpTypeSharedStorageUploadBlob is a shared storage operation to upload blob data
	OpTypeSharedStorageUploadBlob = fftypes.FFEnumValue("optype", "sharedstorage_upload_blob")
	// OpTypeSharedStorageUploadValue is a shared storage operation to upload the value JSON from a data record directly
	OpTypeSharedStorageUploadValue = fftypes.FFEnumValue("optype", "sharedstorage_upload_value")
	// OpTypeSharedStorageDownloadBatch is a shared storage operation to download broadcast data
	OpTypeSharedStorageDownloadBatch = fftypes.FFEnumValue("optype", "sharedstorage_download_batch")
	// OpTypeSharedStorageDownloadBlob is a shared storage operation to download broadcast data
	OpTypeSharedStorageDownloadBlob = fftypes.FFEnumValue("optype", "sharedstorage_download_blob")
	// OpTypeDataExchangeSendBatch is a private send of a batch
	OpTypeDataExchangeSendBatch = fftypes.FFEnumValue("optype", "dataexchange_send_batch")
	// OpTypeDataExchangeSendBlob is a private send of a blob
	OpTypeDataExchangeSendBlob = fftypes.FFEnumValue("optype", "dataexchange_send_blob")
	// OpTypeTokenCreatePool is a token pool creation
	OpTypeTokenCreatePool = fftypes.FFEnumValue("optype", "token_create_pool")
	// OpTypeTokenActivatePool is a token pool activation
	OpTypeTokenActivatePool = fftypes.FFEnumValue("optype", "token_activate_pool")
	// OpTypeTokenTransfer is a token transfer
	OpTypeTokenTransfer = fftypes.FFEnumValue("optype", "token_transfer")
	// OpTypeTokenApproval is a token approval
	OpTypeTokenApproval = fftypes.FFEnumValue("optype", "token_approval")
)
View Source
var (
	TokenTypeFungible    = fftypes.FFEnumValue("tokentype", "fungible")
	TokenTypeNonFungible = fftypes.FFEnumValue("tokentype", "nonfungible")
)
View Source
var (
	TokenInterfaceFormatABI = fftypes.FFEnumValue("tokeninterfaceformat", "abi")
	TokenInterfaceFormatFFI = fftypes.FFEnumValue("tokeninterfaceformat", "ffi")
)
View Source
var (
	TokenTransferTypeMint     = fftypes.FFEnumValue("tokentransfertype", "mint")
	TokenTransferTypeBurn     = fftypes.FFEnumValue("tokentransfertype", "burn")
	TokenTransferTypeTransfer = fftypes.FFEnumValue("tokentransfertype", "transfer")
)
View Source
var (
	// TransactionTypeNone deprecated - replaced by TransactionTypeUnpinned
	TransactionTypeNone = fftypes.FFEnumValue("txtype", "none")
	// TransactionTypeUnpinned indicates the message will be sent without pinning any evidence to the blockchain. Not supported for broadcast. The FireFly transaction will be used to track the sends to all group members.
	TransactionTypeUnpinned = fftypes.FFEnumValue("txtype", "unpinned")
	// TransactionTypeBatchPin represents a pinning transaction, that verifies the originator of the data, and sequences the event deterministically between parties
	TransactionTypeBatchPin = fftypes.FFEnumValue("txtype", "batch_pin")
	// TransactionTypeNetworkAction represents an administrative action on a multiparty network
	TransactionTypeNetworkAction = fftypes.FFEnumValue("txtype", "network_action")
	// TransactionTypeTokenPool represents a token pool creation
	TransactionTypeTokenPool = fftypes.FFEnumValue("txtype", "token_pool")
	// TransactionTypeTokenTransfer represents a token transfer
	TransactionTypeTokenTransfer = fftypes.FFEnumValue("txtype", "token_transfer")
	// TransactionTypeContractDeploy is a smart contract deployment
	TransactionTypeContractDeploy = fftypes.FFEnumValue("txtype", "contract_deploy")
	// TransactionTypeContractInvoke is a smart contract invoke
	TransactionTypeContractInvoke = fftypes.FFEnumValue("txtype", "contract_invoke")
	// TransactionTypeContractInvokePin is a smart contract invoke with an accompanying pin
	TransactionTypeContractInvokePin = fftypes.FFEnumValue("txtype", "contract_invoke_pin")
	// TransactionTypeTokenTransfer represents a token approval
	TransactionTypeTokenApproval = fftypes.FFEnumValue("txtype", "token_approval")
	// TransactionTypeDataPublish represents a publish to shared storage
	TransactionTypeDataPublish = fftypes.FFEnumValue("txtype", "data_publish")
)
View Source
var (
	TransportPayloadTypeMessage = fftypes.FFEnumValue("transportpayload", "message")
	TransportPayloadTypeBatch   = fftypes.FFEnumValue("transportpayload", "batch")
)
View Source
var (
	// VerifierTypeEthAddress is an Ethereum (secp256k1) address string
	VerifierTypeEthAddress = fftypes.FFEnumValue("verifiertype", "ethereum_address")
	// VerifierTypeTezosAddress is a Tezos (ed25519) address string
	VerifierTypeTezosAddress = fftypes.FFEnumValue("verifiertype", "tezos_address")
	// VerifierTypeMSPIdentity is the MSP id (X509 distinguished name) of an issued signing certificate / keypair
	VerifierTypeMSPIdentity = fftypes.FFEnumValue("verifiertype", "fabric_msp_id")
	// VerifierTypeFFDXPeerID is the peer identifier that FireFly Data Exchange verifies (using plugin specific tech) when receiving data
	VerifierTypeFFDXPeerID = fftypes.FFEnumValue("verifiertype", "dx_peer_id")
)
View Source
var (
	// WSClientActionStart is a request to the server to start delivering messages to the client
	WSClientActionStart = fftypes.FFEnumValue("wstype", "start")
	// WSClientActionAck acknowledges an event that was delivered, allowing further messages to be sent
	WSClientActionAck = fftypes.FFEnumValue("wstype", "ack")

	// WSProtocolErrorEventType is a special event "type" field for server to send the client, if it performs a ProtocolError
	WSProtocolErrorEventType = fftypes.FFEnumValue("wstype", "protocol_error")

	// WSEventBatchType is the type set when the message contains an array of events
	WSEventBatchType = fftypes.FFEnumValue("wstype", "event_batch")
)
View Source
var (
	// NetworkActionTerminate request all network members to stop using the current contract and move to the next one configured
	NetworkActionTerminate = fftypes.FFEnumValue("networkactiontype", "terminate")
)
View Source
var (
	// WSChangeEventCommandTypeStart is the command to start listening
	WSChangeEventCommandTypeStart = fftypes.FFEnumValue("changeevent_cmd_type", "start")
)

Functions

func CheckValidatorType

func CheckValidatorType(ctx context.Context, validator ValidatorType) error

func IsPinned added in v1.3.0

func IsPinned(t TransactionType) bool

func ParseNamespacedOpID

func ParseNamespacedOpID(ctx context.Context, nsIDStr string) (string, *fftypes.UUID, error)

func TokenBalanceIdentifier

func TokenBalanceIdentifier(pool *fftypes.UUID, tokenIndex, identity string) string

Types

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, authReq *fftypes.AuthReq) error
}

type Batch

type Batch struct {
	BatchHeader
	Hash    *fftypes.Bytes32 `ffstruct:"Batch" json:"hash"`
	Payload BatchPayload     `ffstruct:"Batch" json:"payload"`
}

Batch is the full payload object used in-flight.

func (*Batch) Confirmed

func (b *Batch) Confirmed() (*BatchPersisted, *BatchManifest)

Confirmed generates a newly confirmed persisted batch, including (re-)generating the manifest

type BatchHeader

type BatchHeader struct {
	ID        *fftypes.UUID    `ffstruct:"BatchHeader" json:"id"`
	Type      BatchType        `ffstruct:"BatchHeader" json:"type" ffenum:"batchtype"`
	Namespace string           `ffstruct:"BatchHeader" json:"namespace"`
	Node      *fftypes.UUID    `ffstruct:"BatchHeader" json:"node,omitempty"`
	Group     *fftypes.Bytes32 `ffstruct:"BatchHeader" json:"group,omitempty"`
	Created   *fftypes.FFTime  `ffstruct:"BatchHeader" json:"created"`
	SignerRef
}

BatchHeader is the common fields between the serialized batch, and the batch manifest

type BatchManifest

type BatchManifest struct {
	Version uint           `json:"version"`
	ID      *fftypes.UUID  `json:"id"`
	TX      TransactionRef `json:"tx"`
	SignerRef
	Messages []*MessageManifestEntry `json:"messages"`
	Data     DataRefs                `json:"data"`
}

BatchManifest is all we need to persist to be able to reconstitute an identical batch, and also all of the fields that are protected by the hash of the batch. It can be generated from a received batch to confirm you have received an identical batch to that sent.

func (*BatchManifest) String

func (bm *BatchManifest) String() string

type BatchPayload

type BatchPayload struct {
	TX       TransactionRef `ffstruct:"BatchPayload" json:"tx"`
	Messages []*Message     `ffstruct:"BatchPayload" json:"messages"`
	Data     DataArray      `ffstruct:"BatchPayload" json:"data"`
}

BatchPayload contains the full JSON of the messages and data, but importantly only the immutable parts of the messages/data. In v0.13 and earlier, we used the whole of this payload object to form the hash of the in-flight batch. Subsequent to that we only calculate the hash of the manifest, as that contains the hashes of all the messages and data (thus minimizing the overhead of calculating the hash). - See Message.BatchMessage() and Data.BatchData()

func (*BatchPayload) Hash

func (ma *BatchPayload) Hash() *fftypes.Bytes32

func (*BatchPayload) Manifest

func (ma *BatchPayload) Manifest(id *fftypes.UUID) *BatchManifest

type BatchPersisted

type BatchPersisted struct {
	BatchHeader
	Hash      *fftypes.Bytes32 `ffstruct:"Batch" json:"hash"`
	Manifest  *fftypes.JSONAny `ffstruct:"Batch" json:"manifest"`
	TX        TransactionRef   `ffstruct:"Batch" json:"tx"`
	Confirmed *fftypes.FFTime  `ffstruct:"Batch" json:"confirmed"`
}

BatchPersisted is the structure written to the database

func (*BatchPersisted) GenInflight

func (b *BatchPersisted) GenInflight(messages []*Message, data DataArray) *Batch

func (*BatchPersisted) GenManifest

func (b *BatchPersisted) GenManifest(messages []*Message, data DataArray) *BatchManifest

type BatchState

type BatchState struct {
	// PreFinalize callbacks may perform blocking actions (possibly to an external connector)
	// - Will execute after all batch messages have been processed
	// - Will execute outside database RunAsGroup
	// - If any PreFinalize callback errors out, batch will be aborted and retried
	PreFinalize []func(ctx context.Context) error

	// Finalize callbacks may perform final, non-idempotent database operations (such as inserting Events)
	// - Will execute after all batch messages have been processed and any PreFinalize callbacks have succeeded
	// - Will execute inside database RunAsGroup
	// - If any Finalize callback errors out, batch will be aborted and retried (small chance of duplicate execution here)
	Finalize []func(ctx context.Context) error

	// PendingConfirms are messages that are pending confirmation after already being processed in this batch
	PendingConfirms map[fftypes.UUID]*Message

	// ConfirmedDIDClaims are DID claims locked in within this batch
	ConfirmedDIDClaims []string
}

BatchState tracks the state between definition handlers that run in-line on the pin processing route in the aggregator as part of a batch of pins. They might have complex API calls and interdependencies that need to be managed via this state.

func (*BatchState) AddConfirmedDIDClaim

func (bs *BatchState) AddConfirmedDIDClaim(did string)

func (*BatchState) AddFinalize

func (bs *BatchState) AddFinalize(action func(ctx context.Context) error)

func (*BatchState) AddPendingConfirm

func (bs *BatchState) AddPendingConfirm(id *fftypes.UUID, message *Message)

func (*BatchState) AddPreFinalize

func (bs *BatchState) AddPreFinalize(action func(ctx context.Context) error)

func (*BatchState) RunFinalize

func (bs *BatchState) RunFinalize(ctx context.Context) error

func (*BatchState) RunPreFinalize

func (bs *BatchState) RunPreFinalize(ctx context.Context) error

type BatchType

type BatchType = fftypes.FFEnum

BatchType is the type of a batch

type Blob

type Blob struct {
	Sequence   int64            `json:"-"`
	Namespace  string           `json:"namespace"`
	Hash       *fftypes.Bytes32 `json:"hash"`
	PayloadRef string           `json:"payloadRef,omitempty"`
	Created    *fftypes.FFTime  `json:"created,omitempty"`
	Peer       string           `json:"peer,omitempty"`
	Size       int64            `json:"size"`
	DataID     *fftypes.UUID    `json:"data_id"`
}

type BlobRef

type BlobRef struct {
	Hash   *fftypes.Bytes32 `ffstruct:"BlobRef" json:"hash"`
	Size   int64            `ffstruct:"BlobRef" json:"size"`
	Name   string           `ffstruct:"BlobRef" json:"name"`
	Path   string           `ffstruct:"BlobRef" json:"path,omitempty"`
	Public string           `ffstruct:"BlobRef" json:"public,omitempty"`
}

func (*BlobRef) BatchBlobRef

func (br *BlobRef) BatchBlobRef(batchType BatchType) *BlobRef

type BlockchainEvent

type BlockchainEvent struct {
	ID         *fftypes.UUID            `ffstruct:"BlockchainEvent" json:"id,omitempty"`
	Source     string                   `ffstruct:"BlockchainEvent" json:"source,omitempty"`
	Namespace  string                   `ffstruct:"BlockchainEvent" json:"namespace,omitempty"`
	Name       string                   `ffstruct:"BlockchainEvent" json:"name,omitempty"`
	Listener   *fftypes.UUID            `ffstruct:"BlockchainEvent" json:"listener,omitempty"`
	ProtocolID string                   `ffstruct:"BlockchainEvent" json:"protocolId,omitempty"`
	Output     fftypes.JSONObject       `ffstruct:"BlockchainEvent" json:"output,omitempty"`
	Info       fftypes.JSONObject       `ffstruct:"BlockchainEvent" json:"info,omitempty"`
	Timestamp  *fftypes.FFTime          `ffstruct:"BlockchainEvent" json:"timestamp,omitempty"`
	TX         BlockchainTransactionRef `ffstruct:"BlockchainEvent" json:"tx"`
}

type BlockchainEventFilter

type BlockchainEventFilter struct {
	Name     string `ffstruct:"SubscriptionBlockchainEventFilter" json:"name,omitempty"`
	Listener string `ffstruct:"SubscriptionBlockchainEventFilter" json:"listener,omitempty"`
}

type BlockchainTransactionRef

type BlockchainTransactionRef struct {
	Type         TransactionType `ffstruct:"Transaction" json:"type,omitempty"`
	ID           *fftypes.UUID   `ffstruct:"Transaction" json:"id,omitempty"`
	BlockchainID string          `ffstruct:"Transaction" json:"blockchainId,omitempty"`
}

BlockchainTransactionRef refers to a transaction and a transaction blockchain ID, in other types

type ChangeEvent

type ChangeEvent struct {
	// The resource collection where the changed resource exists
	Collection string `json:"collection"`
	// The type of event
	Type ChangeEventType `json:"type"`
	// Namespace is set if there is a namespace associated with the changed resource
	Namespace string `json:"namespace,omitempty"`
	// UUID is set if the resource is identified by ID
	ID *fftypes.UUID `json:"id,omitempty"`
	// Hash is set if the resource is identified primarily by hash (groups is currently the only example)
	Hash *fftypes.Bytes32 `json:"hash,omitempty"`
	// Sequence is set if there is a local ordered sequence associated with the changed resource
	Sequence *int64 `json:"sequence,omitempty"`
	// DroppedSince only for ChangeEventTypeDropped. When the first miss happened
	DroppedSince *fftypes.FFTime `json:"droppedSince,omitempty"`
	// DroppedCount only for ChangeEventTypeDropped. How many events dropped
	DroppedCount int64 `json:"droppedCount,omitempty"`
}

ChangeEvent is a change to the local FireFly core node.

type ChangeEventFilter

type ChangeEventFilter struct {
	Types      []ChangeEventType `json:"types,omitempty"`
	Namespaces []string          `json:"namespaces,omitempty"`
}

type ChangeEventType

type ChangeEventType string

ChangeEventType

const (
	ChangeEventTypeCreated ChangeEventType = "created"
	ChangeEventTypeUpdated ChangeEventType = "updated" // note bulk updates might not results in change events.
	ChangeEventTypeDeleted ChangeEventType = "deleted"
	ChangeEventTypeDropped ChangeEventType = "dropped" // See ChangeEventDropped structure, sent to client instead of ChangeEvent when dropping notifications
)

type ChartHistogram

type ChartHistogram struct {
	Count     string                `ffstruct:"ChartHistogram" json:"count"`
	Timestamp *fftypes.FFTime       `ffstruct:"ChartHistogram" json:"timestamp"`
	Types     []*ChartHistogramType `ffstruct:"ChartHistogram" json:"types"`
	IsCapped  bool                  `ffstruct:"ChartHistogram" json:"isCapped"`
}

ChartHistogram is a list of buckets with types

type ChartHistogramInterval

type ChartHistogramInterval struct {
	// StartTime start time of histogram interval
	StartTime *fftypes.FFTime `json:"startTime"`
	// EndTime end time of histogram interval
	EndTime *fftypes.FFTime `json:"endTime"`
}

ChartHistogramInterval specifies lower and upper timestamps for histogram bucket

type ChartHistogramType

type ChartHistogramType struct {
	Count string `ffstruct:"ChartHistogramType" json:"count"`
	Type  string `ffstruct:"ChartHistogramType" json:"type"`
}

ChartHistogramType is a type and count

type CombinedEventDataDelivery added in v1.3.0

type CombinedEventDataDelivery struct {
	Event *EventDelivery
	Data  DataArray
}

type ContractAPI

type ContractAPI struct {
	ID          *fftypes.UUID         `ffstruct:"ContractAPI" json:"id,omitempty" ffexcludeinput:"true"`
	Namespace   string                `ffstruct:"ContractAPI" json:"namespace,omitempty" ffexcludeinput:"true"`
	Interface   *fftypes.FFIReference `ffstruct:"ContractAPI" json:"interface"`
	Location    *fftypes.JSONAny      `ffstruct:"ContractAPI" json:"location,omitempty"`
	Name        string                `ffstruct:"ContractAPI" json:"name"`
	NetworkName string                `ffstruct:"ContractAPI" json:"networkName,omitempty"`
	Message     *fftypes.UUID         `ffstruct:"ContractAPI" json:"message,omitempty" ffexcludeinput:"true"`
	URLs        ContractURLs          `ffstruct:"ContractAPI" json:"urls" ffexcludeinput:"true"`
	Published   bool                  `ffstruct:"ContractAPI" json:"published" ffexcludeinput:"true"`
}

func (*ContractAPI) LocationAndLedgerEquals

func (c *ContractAPI) LocationAndLedgerEquals(a *ContractAPI) bool

func (*ContractAPI) SetBroadcastMessage

func (c *ContractAPI) SetBroadcastMessage(msgID *fftypes.UUID)

func (*ContractAPI) Topic

func (c *ContractAPI) Topic() string

func (*ContractAPI) Validate

func (c *ContractAPI) Validate(ctx context.Context) (err error)

type ContractCallRequest

type ContractCallRequest struct {
	Type           ContractCallType       `ffstruct:"ContractCallRequest" json:"type,omitempty" ffenum:"contractcalltype" ffexcludeinput:"true"`
	Interface      *fftypes.UUID          `ffstruct:"ContractCallRequest" json:"interface,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	Location       *fftypes.JSONAny       `ffstruct:"ContractCallRequest" json:"location,omitempty"`
	Key            string                 `ffstruct:"ContractCallRequest" json:"key,omitempty"`
	Method         *fftypes.FFIMethod     `ffstruct:"ContractCallRequest" json:"method,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	MethodPath     string                 `ffstruct:"ContractCallRequest" json:"methodPath,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	Input          map[string]interface{} `ffstruct:"ContractCallRequest" json:"input"`
	Errors         []*fftypes.FFIError    `ffstruct:"ContractCallRequest" json:"errors,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	Options        map[string]interface{} `ffstruct:"ContractCallRequest" json:"options"`
	Message        *MessageInOut          `ffstruct:"ContractCallRequest" json:"message,omitempty" ffexcludeinput:"postContractQuery,postContractAPIQuery"`
	IdempotencyKey IdempotencyKey         `ffstruct:"ContractCallRequest" json:"idempotencyKey,omitempty" ffexcludeoutput:"true"`
}

type ContractCallType

type ContractCallType = fftypes.FFEnum

type ContractDeployRequest added in v1.1.2

type ContractDeployRequest struct {
	Key            string                 `ffstruct:"ContractDeployRequest" json:"key,omitempty"`
	Input          []interface{}          `ffstruct:"ContractDeployRequest" json:"input"`
	Definition     *fftypes.JSONAny       `ffstruct:"ContractDeployRequest" json:"definition"`
	Contract       *fftypes.JSONAny       `ffstruct:"ContractDeployRequest" json:"contract"`
	Options        map[string]interface{} `ffstruct:"ContractDeployRequest" json:"options"`
	IdempotencyKey IdempotencyKey         `ffstruct:"ContractDeployRequest" json:"idempotencyKey,omitempty" ffexcludeoutput:"true"`
}

type ContractListener

type ContractListener struct {
	ID        *fftypes.UUID            `ffstruct:"ContractListener" json:"id,omitempty" ffexcludeinput:"true"`
	Interface *fftypes.FFIReference    `ffstruct:"ContractListener" json:"interface,omitempty" ffexcludeinput:"postContractAPIListeners"`
	Namespace string                   `ffstruct:"ContractListener" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name      string                   `ffstruct:"ContractListener" json:"name,omitempty"`
	BackendID string                   `ffstruct:"ContractListener" json:"backendId,omitempty" ffexcludeinput:"true"`
	Location  *fftypes.JSONAny         `ffstruct:"ContractListener" json:"location,omitempty"`
	Created   *fftypes.FFTime          `ffstruct:"ContractListener" json:"created,omitempty" ffexcludeinput:"true"`
	Event     *FFISerializedEvent      `ffstruct:"ContractListener" json:"event,omitempty" ffexcludeinput:"postContractAPIListeners"`
	Signature string                   `ffstruct:"ContractListener" json:"signature" ffexcludeinput:"true"`
	Topic     string                   `ffstruct:"ContractListener" json:"topic,omitempty"`
	Options   *ContractListenerOptions `ffstruct:"ContractListener" json:"options,omitempty"`
}

type ContractListenerInput

type ContractListenerInput struct {
	ContractListener
	EventPath string `ffstruct:"ContractListener" json:"eventPath,omitempty"`
}

type ContractListenerOptions

type ContractListenerOptions struct {
	FirstEvent string `ffstruct:"ContractListenerOptions" json:"firstEvent,omitempty"`
}

func (*ContractListenerOptions) Scan

func (o *ContractListenerOptions) Scan(src interface{}) error

Scan implements sql.Scanner

func (ContractListenerOptions) Value

type ContractListenerWithStatus

type ContractListenerWithStatus struct {
	ContractListener
	Status interface{} `ffstruct:"ContractListenerWithStatus" json:"status,omitempty" ffexcludeinput:"true"`
}

type ContractURLs

type ContractURLs struct {
	API     string `ffstruct:"ContractURLs" json:"api"`
	OpenAPI string `ffstruct:"ContractURLs" json:"openapi"`
	UI      string `ffstruct:"ContractURLs" json:"ui"`
}

type Data

type Data struct {
	ID        *fftypes.UUID    `ffstruct:"Data" json:"id,omitempty"`
	Validator ValidatorType    `ffstruct:"Data" json:"validator"`
	Namespace string           `ffstruct:"Data" json:"namespace,omitempty"`
	Hash      *fftypes.Bytes32 `ffstruct:"Data" json:"hash,omitempty"`
	Created   *fftypes.FFTime  `ffstruct:"Data" json:"created,omitempty"`
	Datatype  *DatatypeRef     `ffstruct:"Data" json:"datatype,omitempty"`
	Value     *fftypes.JSONAny `ffstruct:"Data" json:"value"`
	Public    string           `ffstruct:"Data" json:"public,omitempty"`
	Blob      *BlobRef         `ffstruct:"Data" json:"blob,omitempty"`

	ValueSize int64 `json:"-"` // Used internally for message size calculation, without full payload retrieval
}

func (*Data) BatchData

func (d *Data) BatchData(batchType BatchType) *Data

BatchData is the fields in a data record that are assured to be consistent on all parties. This is what is transferred and hashed in a batch payload between nodes.

func (*Data) CalcHash

func (d *Data) CalcHash(ctx context.Context) (*fftypes.Bytes32, error)

func (*Data) CalcPath added in v1.3.0

func (d *Data) CalcPath()

Path processes any non-empty "blob.name" to create a '/' prefixed/separated path, to the last segment of the path. - "" -> "" - "file.name" -> "/" - "/file.name" -> "/" - "path/to/file.name" -> "/path/to" - "/path/to/file.name" -> "/path/to" The path is stored for query.

func (*Data) EstimateSize

func (d *Data) EstimateSize() int64

func (*Data) Seal

func (d *Data) Seal(ctx context.Context, blob *Blob) (err error)

type DataAndBlob

type DataAndBlob struct {
	Data *Data
	Blob *Blob
}

type DataArray

type DataArray []*Data

func (DataArray) Refs

func (da DataArray) Refs() DataRefs

type DataRef

type DataRef struct {
	ID   *fftypes.UUID    `ffstruct:"DataRef" json:"id,omitempty"`
	Hash *fftypes.Bytes32 `ffstruct:"DataRef" json:"hash,omitempty" ffexcludeinput:"true"`

	ValueSize int64 `json:"-"` // used internally for message size calculation, without full payload retrieval
}

type DataRefOrValue

type DataRefOrValue struct {
	DataRef

	Validator ValidatorType    `ffstruct:"DataRefOrValue" json:"validator,omitempty"`
	Datatype  *DatatypeRef     `ffstruct:"DataRefOrValue" json:"datatype,omitempty"`
	Value     *fftypes.JSONAny `ffstruct:"DataRefOrValue" json:"value,omitempty"`
	Blob      *BlobRef         `ffstruct:"DataRefOrValue" json:"blob,omitempty" ffexcludeinput:"true"`
}

DataRefOrValue allows a value to be specified in-line in the data array of an input message, avoiding the need for a multiple API calls.

type DataRefs

type DataRefs []*DataRef

func (DataRefs) Hash

func (d DataRefs) Hash() *fftypes.Bytes32

type Datatype

type Datatype struct {
	ID        *fftypes.UUID    `ffstruct:"Datatype" json:"id,omitempty" ffexcludeinput:"true"`
	Message   *fftypes.UUID    `ffstruct:"Datatype" json:"message,omitempty" ffexcludeinput:"true"`
	Validator ValidatorType    `ffstruct:"Datatype" json:"validator" ffenum:"validatortype"`
	Namespace string           `ffstruct:"Datatype" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name      string           `ffstruct:"Datatype" json:"name,omitempty"`
	Version   string           `ffstruct:"Datatype" json:"version,omitempty"`
	Hash      *fftypes.Bytes32 `ffstruct:"Datatype" json:"hash,omitempty" ffexcludeinput:"true"`
	Created   *fftypes.FFTime  `ffstruct:"Datatype" json:"created,omitempty" ffexcludeinput:"true"`
	Value     *fftypes.JSONAny `ffstruct:"Datatype" json:"value,omitempty"`
}

Datatype is the structure defining a data definition, such as a JSON schema

func (*Datatype) SetBroadcastMessage

func (dt *Datatype) SetBroadcastMessage(msgID *fftypes.UUID)

func (*Datatype) Topic

func (dt *Datatype) Topic() string

func (*Datatype) Validate

func (dt *Datatype) Validate(ctx context.Context, existing bool) (err error)

type DatatypeRef

type DatatypeRef struct {
	Name    string `ffstruct:"DatatypeRef" json:"name,omitempty"`
	Version string `ffstruct:"DatatypeRef" json:"version,omitempty"`
}

func (*DatatypeRef) String

func (dr *DatatypeRef) String() string

type Definition

type Definition interface {
	// Topic returns the topic on which the object should be broadcast
	Topic() string
	// SetBroadcastMessage sets the message that broadcast the definition
	SetBroadcastMessage(msgID *fftypes.UUID)
}

Definition is implemented by all objects that can be broadcast as system definitions to the network

type DefinitionPublish added in v1.3.0

type DefinitionPublish struct {
	NetworkName string `ffstruct:"DefinitionPublish" json:"networkName,omitempty"`
}

type DeprecatedDXInfo

type DeprecatedDXInfo struct {
	Peer     string             `json:"peer,omitempty"`
	Endpoint fftypes.JSONObject `json:"endpoint,omitempty"`
}

type DeprecatedNode

type DeprecatedNode struct {
	ID          *fftypes.UUID    `json:"id"`
	Message     *fftypes.UUID    `json:"message,omitempty"`
	Owner       string           `json:"owner,omitempty"`
	Name        string           `json:"name,omitempty"`
	Description string           `json:"description,omitempty"`
	DX          DeprecatedDXInfo `json:"dx"`
	Created     *fftypes.FFTime  `json:"created,omitempty"`
	// contains filtered or unexported fields
}

DeprecatedNode is the data structure we used to use prior to FIR-9. Now we use the common Identity structure throughout

func (*DeprecatedNode) AddMigratedParent

func (node *DeprecatedNode) AddMigratedParent(parentID *fftypes.UUID) *IdentityClaim

func (*DeprecatedNode) Migrated

func (node *DeprecatedNode) Migrated() *IdentityClaim

Migrate creates and maintains a migrated IdentityClaim object, which is used when processing an old-style node broadcast received when joining an existing network

func (*DeprecatedNode) SetBroadcastMessage

func (node *DeprecatedNode) SetBroadcastMessage(msgID *fftypes.UUID)

func (*DeprecatedNode) Topic

func (node *DeprecatedNode) Topic() string

type DeprecatedOrganization

type DeprecatedOrganization struct {
	ID          *fftypes.UUID      `json:"id"`
	Message     *fftypes.UUID      `json:"message,omitempty"`
	Parent      string             `json:"parent,omitempty"`
	Identity    string             `json:"identity,omitempty"`
	Name        string             `json:"name,omitempty"`
	Description string             `json:"description,omitempty"`
	Profile     fftypes.JSONObject `json:"profile,omitempty"`
	Created     *fftypes.FFTime    `json:"created,omitempty"`
	// contains filtered or unexported fields
}

DeprecatedOrganization is the data structure we used to use prior to FIR-9. Now we use the common Identity structure throughout

func (*DeprecatedOrganization) Migrated

func (org *DeprecatedOrganization) Migrated() *IdentityClaim

Migrate creates and maintains a migrated IdentityClaim object, which is used when processing an old-style organization broadcast received when joining an existing network

func (*DeprecatedOrganization) SetBroadcastMessage

func (org *DeprecatedOrganization) SetBroadcastMessage(msgID *fftypes.UUID)

func (*DeprecatedOrganization) Topic

func (org *DeprecatedOrganization) Topic() string

type EmptyInput

type EmptyInput map[string]interface{}

EmptyInput represents an API with no input fields, but requiring a JSON content type on the request

type EnrichedEvent

type EnrichedEvent struct {
	Event
	BlockchainEvent   *BlockchainEvent `ffstruct:"EnrichedEvent" json:"blockchainEvent,omitempty"`
	ContractAPI       *ContractAPI     `ffstruct:"EnrichedEvent" json:"contractAPI,omitempty"`
	ContractInterface *fftypes.FFI     `ffstruct:"EnrichedEvent" json:"contractInterface,omitempty"`
	Datatype          *Datatype        `ffstruct:"EnrichedEvent" json:"datatype,omitempty"`
	Identity          *Identity        `ffstruct:"EnrichedEvent" json:"identity,omitempty"`
	Message           *Message         `ffstruct:"EnrichedEvent" json:"message,omitempty"`
	TokenApproval     *TokenApproval   `ffstruct:"EnrichedEvent" json:"tokenApproval,omitempty"`
	TokenPool         *TokenPool       `ffstruct:"EnrichedEvent" json:"tokenPool,omitempty"`
	TokenTransfer     *TokenTransfer   `ffstruct:"EnrichedEvent" json:"tokenTransfer,omitempty"`
	Transaction       *Transaction     `ffstruct:"EnrichedEvent" json:"transaction,omitempty"`
	Operation         *Operation       `ffstruct:"EnrichedEvent" json:"operation,omitempty"`
}

EnrichedEvent adds the referred object to an event

type Event

type Event struct {
	ID          *fftypes.UUID   `ffstruct:"Event" json:"id"`
	Sequence    int64           `ffstruct:"Event" json:"sequence"`
	Type        EventType       `ffstruct:"Event" json:"type" ffenum:"eventtype"`
	Namespace   string          `ffstruct:"Event" json:"namespace"`
	Reference   *fftypes.UUID   `ffstruct:"Event" json:"reference"`
	Correlator  *fftypes.UUID   `ffstruct:"Event" json:"correlator,omitempty"`
	Transaction *fftypes.UUID   `ffstruct:"Event" json:"tx,omitempty"`
	Topic       string          `ffstruct:"Event" json:"topic,omitempty"`
	Created     *fftypes.FFTime `ffstruct:"Event" json:"created"`
}

Event is an activity in the system, delivered reliably to applications, that indicates something has happened in the network

func NewEvent

func NewEvent(t EventType, ns string, ref *fftypes.UUID, tx *fftypes.UUID, topic string) *Event

func (*Event) LocalSequence

func (e *Event) LocalSequence() int64

type EventDelivery

type EventDelivery struct {
	EnrichedEvent
	Subscription SubscriptionRef `json:"subscription"`
}

EventDelivery adds the referred object to an event, as well as details of the subscription that caused the event to be dispatched to an application.

type EventDeliveryResponse

type EventDeliveryResponse struct {
	ID           *fftypes.UUID   `json:"id"`
	Rejected     bool            `json:"rejected,omitempty"`
	Info         string          `json:"info,omitempty"`
	Subscription SubscriptionRef `json:"subscription"`
	Reply        *MessageInOut   `json:"reply,omitempty"`
}

EventDeliveryResponse is the payload an application sends back, to confirm it has accepted (or rejected) the event and as such does not need to receive it again.

type EventType

type EventType = fftypes.FFEnum

EventType indicates what the event means, as well as what the Reference in the event refers to

type FFISerializedEvent

type FFISerializedEvent struct {
	fftypes.FFIEventDefinition
}

func (*FFISerializedEvent) Scan

func (fse *FFISerializedEvent) Scan(src interface{}) error

Scan implements sql.Scanner

func (FFISerializedEvent) Value

func (fse FFISerializedEvent) Value() (driver.Value, error)

type Group

type Group struct {
	GroupIdentity
	LocalNamespace string           `ffstruct:"Group" json:"localNamespace,omitempty"`
	Message        *fftypes.UUID    `ffstruct:"Group" json:"message,omitempty"`
	Hash           *fftypes.Bytes32 `ffstruct:"Group" json:"hash,omitempty"`
	Created        *fftypes.FFTime  `ffstruct:"Group" json:"created,omitempty"`
}

func (*Group) Seal

func (group *Group) Seal()

func (*Group) SetBroadcastMessage

func (group *Group) SetBroadcastMessage(msgID *fftypes.UUID)

func (*Group) Topic

func (group *Group) Topic() string

func (*Group) Validate

func (group *Group) Validate(ctx context.Context, existing bool) (err error)

type GroupIdentity

type GroupIdentity struct {
	Namespace string  `ffstruct:"Group" json:"namespace,omitempty"`
	Name      string  `ffstruct:"Group" json:"name"`
	Members   Members `ffstruct:"Group" json:"members"`
}

func (*GroupIdentity) Hash

func (man *GroupIdentity) Hash() *fftypes.Bytes32

type IDAndSequence

type IDAndSequence struct {
	ID       fftypes.UUID
	Sequence int64
}

IDAndSequence is a combination of a UUID and a stored sequence

type IdempotencyKey added in v1.1.2

type IdempotencyKey string

IdempotencyKey is accessed in Go as a string, but when persisted to storage it will be stored as a null to allow multiple entries in a unique index to exist with the same un-set idempotency key.

func (*IdempotencyKey) Scan added in v1.1.2

func (ik *IdempotencyKey) Scan(src interface{}) error

func (IdempotencyKey) Value added in v1.1.2

func (ik IdempotencyKey) Value() (driver.Value, error)

type Identity

type Identity struct {
	IdentityBase
	IdentityProfile
	Messages IdentityMessages `ffstruct:"Identity" json:"messages,omitempty" ffexcludeinput:"true"`
	Created  *fftypes.FFTime  `ffstruct:"Identity" json:"created,omitempty" ffexcludeinput:"true"`
	Updated  *fftypes.FFTime  `ffstruct:"Identity" json:"updated,omitempty"`
}

Identity is the persisted structure backing all identities, including orgs, nodes and custom identities

func (*Identity) Validate

func (identity *Identity) Validate(ctx context.Context) (err error)

type IdentityBase

type IdentityBase struct {
	ID        *fftypes.UUID `ffstruct:"Identity" json:"id" ffexcludeinput:"true"`
	DID       string        `ffstruct:"Identity" json:"did"`
	Type      IdentityType  `ffstruct:"Identity" json:"type" ffenum:"identitytype" ffexcludeinput:"true"`
	Parent    *fftypes.UUID `ffstruct:"Identity" json:"parent,omitempty"`
	Namespace string        `ffstruct:"Identity" json:"namespace"`
	Name      string        `ffstruct:"Identity" json:"name,omitempty"`
}

IdentityBase are the immutable fields of an identity that determine what the identity itself is

func (*IdentityBase) Equals

func (i *IdentityBase) Equals(ctx context.Context, i2 *IdentityBase) bool

func (*IdentityBase) GenerateDID

func (i *IdentityBase) GenerateDID(ctx context.Context) (string, error)

func (*IdentityBase) Topic

func (i *IdentityBase) Topic() string

func (*IdentityBase) Validate

func (i *IdentityBase) Validate(ctx context.Context) (err error)

type IdentityClaim

type IdentityClaim struct {
	Identity *Identity `ffstruct:"IdentityClaim" json:"identity"`
}

IdentityClaim is the data payload used in a message to broadcast an intent to publish a new identity. Most claims (except root orgs, where different requirements apply) require a separate IdentityVerification from the parent identity to be published (on the same topic) before the identity is considered valid and is stored as a confirmed identity.

func (*IdentityClaim) SetBroadcastMessage

func (ic *IdentityClaim) SetBroadcastMessage(msgID *fftypes.UUID)

func (*IdentityClaim) Topic

func (ic *IdentityClaim) Topic() string

type IdentityCreateDTO

type IdentityCreateDTO struct {
	Name   string       `ffstruct:"Identity" json:"name"`
	Type   IdentityType `ffstruct:"Identity" json:"type,omitempty"`
	Parent string       `ffstruct:"IdentityCreateDTO" json:"parent,omitempty"` // can be a DID for resolution, or the UUID directly
	Key    string       `ffstruct:"IdentityCreateDTO" json:"key,omitempty"`
	IdentityProfile
}

IdentityCreateDTO is the input structure to submit to register an identity. The blockchain key that will be used to establish the claim for the identity needs to be provided.

type IdentityMessages

type IdentityMessages struct {
	Claim        *fftypes.UUID `ffstruct:"IdentityMessages" json:"claim"`
	Verification *fftypes.UUID `ffstruct:"IdentityMessages" json:"verification"`
	Update       *fftypes.UUID `ffstruct:"IdentityMessages" json:"update"`
}

type IdentityProfile

type IdentityProfile struct {
	Description string             `ffstruct:"IdentityProfile" json:"description,omitempty"`
	Profile     fftypes.JSONObject `ffstruct:"IdentityProfile" json:"profile,omitempty"`
}

IdentityProfile are the field of a profile that can be updated over time

type IdentityType

type IdentityType = fftypes.FFEnum

IdentityType is the type of an identity

type IdentityUpdate

type IdentityUpdate struct {
	Identity IdentityBase    `ffstruct:"IdentityUpdate" json:"identity"`
	Updates  IdentityProfile `ffstruct:"IdentityUpdate" json:"updates,omitempty"`
}

IdentityUpdate is the data payload used in message to broadcast an update to an identity profile. The broadcast must be on the same identity as the currently established identity claim message for the identity, and it must contain the same identity data. The profile is replaced in its entirety.

func (*IdentityUpdate) SetBroadcastMessage

func (iu *IdentityUpdate) SetBroadcastMessage(msgID *fftypes.UUID)

func (*IdentityUpdate) Topic

func (iu *IdentityUpdate) Topic() string

type IdentityUpdateDTO

type IdentityUpdateDTO struct {
	IdentityProfile
}

IdentityUpdateDTO is the input structure to submit to update an identityprofile. The same key in the claim will be used for the update.

type IdentityVerification

type IdentityVerification struct {
	Claim    MessageRef   `ffstruct:"IdentityVerification" json:"claim"`
	Identity IdentityBase `ffstruct:"IdentityVerification" json:"identity"`
}

IdentityVerification is the data payload used in message to broadcast a verification of a child identity. Must refer to the UUID and Hash of the IdentityClaim message, and must contain the same base identity data.

func (*IdentityVerification) SetBroadcastMessage

func (iv *IdentityVerification) SetBroadcastMessage(msgID *fftypes.UUID)

func (*IdentityVerification) Topic

func (iv *IdentityVerification) Topic() string

type IdentityWithVerifiers

type IdentityWithVerifiers struct {
	Identity
	Verifiers []*VerifierRef `ffstruct:"IdentityWithVerifiers" json:"verifiers"`
}

IdentityWithVerifiers has an embedded array of verifiers

type InlineData

type InlineData []*DataRefOrValue

InlineData is an array of data references or values

type InputGroup

type InputGroup struct {
	Name    string        `ffstruct:"InputGroup" json:"name,omitempty"`
	Members []MemberInput `ffstruct:"InputGroup" json:"members"`
}

InputGroup declares a group in-line for automatic resolution, without having to define a group up-front

type ListenerStatusError

type ListenerStatusError struct {
	StatusError string `ffstruct:"ListenerStatusError" json:"error,omitempty"`
}

type LocallySequenced

type LocallySequenced interface {
	LocalSequence() int64
}

type Member

type Member struct {
	Identity string        `ffstruct:"Member" json:"identity,omitempty"`
	Node     *fftypes.UUID `ffstruct:"Member" json:"node,omitempty"`
}

func (*Member) Equals

func (m *Member) Equals(m2 *Member) bool

type MemberInput

type MemberInput struct {
	Identity string `ffstruct:"MemberInput" json:"identity,omitempty"`
	Node     string `ffstruct:"MemberInput" json:"node,omitempty"`
}

type Members

type Members []*Member

func (Members) Len

func (m Members) Len() int

func (Members) Less

func (m Members) Less(i, j int) bool

func (Members) Swap

func (m Members) Swap(i, j int)

type Message

type Message struct {
	Header         MessageHeader         `ffstruct:"Message" json:"header"`
	LocalNamespace string                `ffstruct:"Message" json:"localNamespace,omitempty" ffexcludeinput:"true"`
	Hash           *fftypes.Bytes32      `ffstruct:"Message" json:"hash,omitempty" ffexcludeinput:"true"`
	BatchID        *fftypes.UUID         `ffstruct:"Message" json:"batch,omitempty" ffexcludeinput:"true"`
	TransactionID  *fftypes.UUID         `ffstruct:"Message" json:"txid,omitempty" ffexcludeinput:"true"`
	State          MessageState          `ffstruct:"Message" json:"state,omitempty" ffenum:"messagestate" ffexcludeinput:"true"`
	Confirmed      *fftypes.FFTime       `ffstruct:"Message" json:"confirmed,omitempty" ffexcludeinput:"true"`
	RejectReason   string                `ffstruct:"Message" json:"rejectReason,omitempty" ffexcludeinput:"true"`
	Data           DataRefs              `ffstruct:"Message" json:"data" ffexcludeinput:"true"`
	Pins           fftypes.FFStringArray `ffstruct:"Message" json:"pins,omitempty" ffexcludeinput:"true"`
	IdempotencyKey IdempotencyKey        `ffstruct:"Message" json:"idempotencyKey,omitempty"`
	Sequence       int64                 `ffstruct:"Message" json:"-"` // Local database sequence used internally for batch assembly
}

Message is the envelope by which coordinated data exchange can happen between parties in the network Data is passed by reference in these messages, and a chain of hashes covering the data and the details of the message, provides a verification against tampering.

func (*Message) BatchMessage

func (m *Message) BatchMessage() *Message

BatchMessage is the fields in a message record that are assured to be consistent on all parties. This is what is transferred and hashed in a batch payload between nodes.

Fields such as the idempotencyKey do NOT transfer, as these are meant for local processing of messages before being sent.

Fields such as the state/confirmed do NOT transfer, as these are calculated individually by each member.

func (*Message) DupDataCheck

func (m *Message) DupDataCheck(ctx context.Context) (err error)

func (*Message) EstimateSize

func (m *Message) EstimateSize(includeDataRefs bool) int64

func (*Message) LocalSequence

func (m *Message) LocalSequence() int64

func (*Message) Seal

func (m *Message) Seal(ctx context.Context) (err error)

func (*Message) Verify

func (m *Message) Verify(ctx context.Context) error

func (*Message) VerifyFields

func (m *Message) VerifyFields(ctx context.Context) error

type MessageAction added in v1.3.0

type MessageAction int

MessageAction is an action to be taken on a message during processing

const (
	// ActionReject the message was successfully processed, but was malformed/invalid and should be marked as rejected
	ActionReject MessageAction = iota

	// ActionConfirm the message was valid and should be confirmed
	ActionConfirm

	// ActionRetry a recoverable error was encountered - batch should be halted and then re-processed from the start
	ActionRetry

	// ActionWait the message is still awaiting further pieces for aggregation and should be held in pending state
	ActionWait
)

func (MessageAction) String added in v1.3.0

func (dma MessageAction) String() string

type MessageFilter

type MessageFilter struct {
	Tag    string `ffstruct:"SubscriptionMessageFilter" json:"tag,omitempty"`
	Group  string `ffstruct:"SubscriptionMessageFilter" json:"group,omitempty"`
	Author string `ffstruct:"SubscriptionMessageFilter" json:"author,omitempty"`
}

type MessageHeader

type MessageHeader struct {
	ID     *fftypes.UUID   `ffstruct:"MessageHeader" json:"id,omitempty" ffexcludeinput:"true"`
	CID    *fftypes.UUID   `ffstruct:"MessageHeader" json:"cid,omitempty"`
	Type   MessageType     `ffstruct:"MessageHeader" json:"type" ffenum:"messagetype"`
	TxType TransactionType `ffstruct:"MessageHeader" json:"txtype,omitempty" ffenum:"txtype"`
	SignerRef
	Created   *fftypes.FFTime       `ffstruct:"MessageHeader" json:"created,omitempty" ffexcludeinput:"true"`
	Namespace string                `ffstruct:"MessageHeader" json:"namespace,omitempty" ffexcludeinput:"true"`
	Group     *fftypes.Bytes32      `ffstruct:"MessageHeader" json:"group,omitempty" ffexclude:"postNewMessageBroadcast"`
	Topics    fftypes.FFStringArray `ffstruct:"MessageHeader" json:"topics,omitempty"`
	Tag       string                `ffstruct:"MessageHeader" json:"tag,omitempty"`
	DataHash  *fftypes.Bytes32      `ffstruct:"MessageHeader" json:"datahash,omitempty" ffexcludeinput:"true"`
	TxParent  *TransactionRef       `ffstruct:"MessageHeader" json:"txparent,omitempty" ffexcludeinput:"true"`
}

MessageHeader contains all fields that contribute to the hash The order of the serialization mut not change, once released

func (*MessageHeader) Hash

func (h *MessageHeader) Hash() *fftypes.Bytes32

type MessageInOut

type MessageInOut struct {
	Message
	InlineData InlineData  `ffstruct:"MessageInOut" json:"data,omitempty"`
	Group      *InputGroup `ffstruct:"MessageInOut" json:"group,omitempty" ffexclude:"postNewMessageBroadcast"`
}

MessageInOut allows API users to submit values in-line in the payload submitted, which will be broken out and stored separately during the call.

func (*MessageInOut) SetInlineData

func (m *MessageInOut) SetInlineData(data []*Data)

type MessageManifestEntry

type MessageManifestEntry struct {
	MessageRef
	Topics int `json:"topics"` // We only need the count, to be able to match up the pins
}

type MessageRef

type MessageRef struct {
	ID   *fftypes.UUID    `ffstruct:"MessageRef" json:"id,omitempty"`
	Hash *fftypes.Bytes32 `ffstruct:"MessageRef" json:"hash,omitempty"`
}

MessageRef is a lightweight data structure that can be used to refer to a message

type MessageState

type MessageState = fftypes.FFEnum

MessageState is the current transmission/confirmation state of a message

type MessageType

type MessageType = fftypes.FFEnum

MessageType is the fundamental type of a message

type MultipartyContract

type MultipartyContract struct {
	Index      int                    `ffstruct:"MultipartyContract" json:"index"`
	Location   *fftypes.JSONAny       `ffstruct:"MultipartyContract" json:"location,omitempty"`
	FirstEvent string                 `ffstruct:"MultipartyContract" json:"firstEvent,omitempty"`
	Info       MultipartyContractInfo `ffstruct:"MultipartyContract" json:"info"`
}

MultipartyContract represents identifying details about a FireFly multiparty contract, as read from the config file

type MultipartyContractInfo

type MultipartyContractInfo struct {
	Subscription string `ffstruct:"MultipartyContract" json:"subscription,omitempty"`
	FinalEvent   string `ffstruct:"MultipartyContract" json:"finalEvent,omitempty"`
	Version      int    `ffstruct:"MultipartyContract" json:"version,omitempty"`
}

MultipartyContractInfo stores additional info about the FireFly multiparty contract that is computed during node operation

type MultipartyContracts

type MultipartyContracts struct {
	Active     *MultipartyContract   `ffstruct:"MultipartyContracts" json:"active"`
	Terminated []*MultipartyContract `ffstruct:"MultipartyContracts" json:"terminated,omitempty"`
}

MultipartyContracts represent the currently active and any terminated FireFly multiparty contract(s)

func (*MultipartyContracts) Scan

func (fc *MultipartyContracts) Scan(src interface{}) error

Scan implements sql.Scanner

func (MultipartyContracts) Value

func (fc MultipartyContracts) Value() (driver.Value, error)

Value implements sql.Valuer

type Named

type Named interface {
	Name() string
}

type Namespace

type Namespace struct {
	Name        string                 `ffstruct:"Namespace" json:"name"`
	NetworkName string                 `ffstruct:"Namespace" json:"networkName"`
	Description string                 `ffstruct:"Namespace" json:"description"`
	Created     *fftypes.FFTime        `ffstruct:"Namespace" json:"created" ffexcludeinput:"true"`
	Contracts   *MultipartyContracts   `ffstruct:"Namespace" json:"-"`
	TLSConfigs  map[string]*tls.Config `ffstruct:"Namespace" json:"-" ffexcludeinput:"true"`
}

Namespace is an isolated set of named resources, to allow multiple applications to co-exist in the same network, with the same named objects. Can be used for use case segregation, or multi-tenancy.

type NamespaceStatus

type NamespaceStatus struct {
	Namespace  *Namespace                `ffstruct:"NamespaceStatus" json:"namespace"`
	Node       *NamespaceStatusNode      `ffstruct:"NamespaceStatus" json:"node,omitempty"`
	Org        *NamespaceStatusOrg       `ffstruct:"NamespaceStatus" json:"org,omitempty"`
	Plugins    NamespaceStatusPlugins    `ffstruct:"NamespaceStatus" json:"plugins"`
	Multiparty NamespaceStatusMultiparty `ffstruct:"NamespaceStatus" json:"multiparty"`
}

NamespaceStatus is a set of information that represents the configuration and status of a given namespace

type NamespaceStatusMultiparty

type NamespaceStatusMultiparty struct {
	Enabled   bool                 `ffstruct:"NamespaceStatusMultiparty" json:"enabled"`
	Contracts *MultipartyContracts `ffstruct:"NamespaceStatusMultiparty" json:"contract,omitempty"`
}

NamespaceStatusMultiparty is information about multiparty mode and any associated multiparty contracts

type NamespaceStatusNode

type NamespaceStatusNode struct {
	Name       string        `ffstruct:"NamespaceStatusNode" json:"name"`
	Registered bool          `ffstruct:"NamespaceStatusNode" json:"registered"`
	ID         *fftypes.UUID `ffstruct:"NamespaceStatusNode" json:"id,omitempty"`
}

NamespaceStatusNode is the information about the local node, returned in the namespace status

type NamespaceStatusOrg

type NamespaceStatusOrg struct {
	Name       string         `ffstruct:"NamespaceStatusOrg" json:"name"`
	Registered bool           `ffstruct:"NamespaceStatusOrg" json:"registered"`
	DID        string         `ffstruct:"NamespaceStatusOrg" json:"did,omitempty"`
	ID         *fftypes.UUID  `ffstruct:"NamespaceStatusOrg" json:"id,omitempty"`
	Verifiers  []*VerifierRef `ffstruct:"NamespaceStatusOrg" json:"verifiers,omitempty"`
}

NamespaceStatusOrg is the information about the node owning org, returned in the namespace status

type NamespaceStatusPlugin

type NamespaceStatusPlugin struct {
	Name       string `ffstruct:"NamespaceStatusPlugin" json:"name,omitempty"`
	PluginType string `ffstruct:"NamespaceStatusPlugin" json:"pluginType"`
}

NamespaceStatusPlugin is information about a plugin

type NamespaceStatusPlugins

type NamespaceStatusPlugins struct {
	Blockchain    []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"blockchain"`
	Database      []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"database"`
	DataExchange  []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"dataExchange"`
	Events        []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"events"`
	Identity      []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"identity"`
	SharedStorage []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"sharedStorage"`
	Tokens        []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"tokens"`
}

NamespaceStatusPlugins is a map of plugins configured in the namespace

type NamespaceWithInitStatus added in v1.3.0

type NamespaceWithInitStatus struct {
	*Namespace
	Initializing        bool   `ffstruct:"NamespaceWithInitStatus" json:"initializing,omitempty"`
	InitializationError string `ffstruct:"NamespaceWithInitStatus" json:"initializationError,omitempty"`
}

type NetworkAction

type NetworkAction struct {
	Type NetworkActionType `ffstruct:"NetworkAction" json:"type" ffenum:"networkactiontype"`
}

type NetworkActionType

type NetworkActionType = fftypes.FFEnum

NetworkActionType is a type of action to perform

type NextPin

type NextPin struct {
	Namespace string           `ffstruct:"NextPin" json:"namespace"`
	Context   *fftypes.Bytes32 `ffstruct:"NextPin" json:"context"`
	Identity  string           `ffstruct:"NextPin" json:"identity"`
	Hash      *fftypes.Bytes32 `ffstruct:"NextPin" json:"hash"`
	Nonce     int64            `ffstruct:"NextPin" json:"nonce"`
	Sequence  int64            `ffstruct:"NextPin" json:"-"` // Local database sequence used internally for update efficiency
}

type Nonce

type Nonce struct {
	Hash  *fftypes.Bytes32 `json:"hash"`
	Nonce int64            `json:"nonce"`
}

Nonce is this local node's state record for the context of a group+topic+author combination. The Hash is the state of the hash before the nonce is added on to make it unique to the message.

type Offset

type Offset struct {
	Type    OffsetType `json:"type" ffenum:"offsettype"`
	Name    string     `json:"name"`
	Current int64      `json:"current,omitempty"`

	RowID int64 `json:"-"`
}

Offset is a simple stored data structure that records a sequence position within another collection

type OffsetType

type OffsetType = fftypes.FFEnum

type OpPhase added in v1.3.0

type OpPhase int
const (
	OpPhaseComplete OpPhase = iota
	OpPhasePending
	OpPhaseInitializing
)

type OpStatus

type OpStatus string

OpStatus is the current status of an operation

const (
	// OpStatusInitialized indicates the operation has been initialized, but successful confirmation of submission to the
	// relevant plugin has not yet been received
	OpStatusInitialized OpStatus = "Initialized"
	// OpStatusPending indicates the operation has been submitted, but is not yet confirmed as successful or failed
	OpStatusPending OpStatus = "Pending"
	// OpStatusSucceeded the infrastructure runtime has returned success for the operation
	OpStatusSucceeded OpStatus = "Succeeded"
	// OpStatusFailed happens when an error is reported by the infrastructure runtime
	OpStatusFailed OpStatus = "Failed"
)

type OpType

type OpType = fftypes.FFEnum

OpType describes mechanical steps in the process that have to be performed, might be asynchronous, and have results in the back-end systems that might need to be correlated with messages by operators.

type Operation

type Operation struct {
	ID          *fftypes.UUID      `ffstruct:"Operation" json:"id" ffexcludeinput:"true"`
	Namespace   string             `ffstruct:"Operation" json:"namespace" ffexcludeinput:"true"`
	Transaction *fftypes.UUID      `ffstruct:"Operation" json:"tx" ffexcludeinput:"true"`
	Type        OpType             `ffstruct:"Operation" json:"type" ffenum:"optype" ffexcludeinput:"true"`
	Status      OpStatus           `ffstruct:"Operation" json:"status"`
	Plugin      string             `ffstruct:"Operation" json:"plugin" ffexcludeinput:"true"`
	Input       fftypes.JSONObject `ffstruct:"Operation" json:"input,omitempty" ffexcludeinput:"true"`
	Output      fftypes.JSONObject `ffstruct:"Operation" json:"output,omitempty"`
	Error       string             `ffstruct:"Operation" json:"error,omitempty"`
	Created     *fftypes.FFTime    `ffstruct:"Operation" json:"created,omitempty" ffexcludeinput:"true"`
	Updated     *fftypes.FFTime    `ffstruct:"Operation" json:"updated,omitempty" ffexcludeinput:"true"`
	Retry       *fftypes.UUID      `ffstruct:"Operation" json:"retry,omitempty" ffexcludeinput:"true"`
}

Operation is a description of an action performed as part of a transaction submitted by this node

func NewOperation

func NewOperation(plugin Named, namespace string, tx *fftypes.UUID, opType OpType) *Operation

NewOperation creates a new operation in a transaction. It always starts in "Initialized" state and only moves to "Pending" when successful submission to the respective plugin has been confirmed.

func (*Operation) IsBlockchainOperation added in v1.1.3

func (op *Operation) IsBlockchainOperation() bool

func (*Operation) IsTokenOperation added in v1.1.3

func (op *Operation) IsTokenOperation() bool

type OperationCallbacks

type OperationCallbacks interface {
	OperationUpdate(update *OperationUpdate)
}

type OperationDetailError added in v1.2.0

type OperationDetailError struct {
	StatusError string `ffstruct:"OperationDetail" json:"error,omitempty"`
}

type OperationUpdate

type OperationUpdate struct {
	Plugin         string
	NamespacedOpID string
	Status         OpStatus
	BlockchainTXID string
	ErrorMessage   string
	Output         fftypes.JSONObject
	VerifyManifest bool
	DXManifest     string
	DXHash         string
	OnComplete     func()
}

OperationUpdate notifies FireFly of an update to an operation. Only success/failure and errorMessage (for errors) are modeled. Output can be used to add opaque protocol-specific JSON from the plugin (protocol transaction ID etc.) Note this is an optional hook information, and stored separately to the confirmation of the actual event that was being submitted/sequenced. Only the party submitting the transaction will see this data.

type OperationUpdateDTO

type OperationUpdateDTO struct {
	Status OpStatus           `ffstruct:"Operation" json:"status"`
	Output fftypes.JSONObject `ffstruct:"Operation" json:"output,omitempty"`
	Error  *string            `ffstruct:"Operation" json:"error,omitempty"`
}

OperationUpdateDTO is the subset of fields on an operation that are mutable, via the SPI

type OperationWithDetail added in v1.2.0

type OperationWithDetail struct {
	Operation
	Detail interface{} `ffstruct:"OperationWithDetail" json:"detail,omitempty" ffexcludeinput:"true"`
}

type Pin

type Pin struct {
	Sequence   int64            `ffstruct:"Pin" json:"sequence"`
	Namespace  string           `ffstruct:"Pin" json:"namespace"`
	Masked     bool             `ffstruct:"Pin" json:"masked,omitempty"`
	Hash       *fftypes.Bytes32 `ffstruct:"Pin" json:"hash,omitempty"`
	Batch      *fftypes.UUID    `ffstruct:"Pin" json:"batch,omitempty"`
	BatchHash  *fftypes.Bytes32 `ffstruct:"Pin" json:"batchHash,omitempty"`
	Index      int64            `ffstruct:"Pin" json:"index"`
	Dispatched bool             `ffstruct:"Pin" json:"dispatched,omitempty"`
	Signer     string           `ffstruct:"Pin" json:"signer,omitempty"`
	Created    *fftypes.FFTime  `ffstruct:"Pin" json:"created,omitempty"`
}

Pin represents a ledger-pinning event that has been detected from the blockchain, in the sequence that it was detected.

A batch contains many messages, and each of those messages can be on a different topic (or topics) All messages on the same topic must be processed in the order that the batch pinning events arrive from the blockchain.

As we need to correlate the on-chain events, with off-chain data that might arrive at a different time (or never), we "park" all pinned sequences first, then only complete them (and generate the associated events) once all the data has been assembled for all messages on that sequence, within that batch.

We might park the pin first (from the blockchain), or park the batch first (if it arrived first off-chain). There's a third part as well that can block a message, which is large blob data moving separately to the batch. If we get the private message, then the batch, before receiving the blob data - we have to upgrade a batch-park, to a pin-park. This is because the sequence must be in the order the pins arrive.

func (*Pin) LocalSequence

func (p *Pin) LocalSequence() int64

type PinRewind

type PinRewind struct {
	Sequence int64         `ffstruct:"PinRewind" json:"sequence"`
	Batch    *fftypes.UUID `ffstruct:"PinRewind" json:"batch"`
}

type PreparedOperation

type PreparedOperation struct {
	ID        *fftypes.UUID `json:"id"`
	Namespace string        `json:"namespace"`
	Plugin    string        `json:"plugin"`
	Type      OpType        `json:"type" ffenum:"optype"`
	Data      interface{}   `json:"data"`
}

PreparedOperation is an operation that has gathered all the raw data ready to send to a plugin It is never stored, but it should always be possible for the owning Manager to generate a PreparedOperation from an Operation. Data is defined by the Manager, but should be JSON-serializable to support inspection and debugging.

func (*PreparedOperation) NamespacedIDString

func (po *PreparedOperation) NamespacedIDString() string

type PublishInput added in v1.1.2

type PublishInput struct {
	IdempotencyKey IdempotencyKey `ffstruct:"PublishInput" json:"idempotencyKey,omitempty" ffexcludeoutput:"true"`
}

type SignerRef

type SignerRef struct {
	Author string `ffstruct:"SignerRef" json:"author,omitempty"`
	Key    string `ffstruct:"SignerRef" json:"key,omitempty"`
}

SignerRef is the nested structure representing the identity that signed a message. It might comprise a resolvable by FireFly identity DID, a blockchain signing key, or both.

type SubOptsFirstEvent

type SubOptsFirstEvent string

SubOptsFirstEvent picks the first event that should be dispatched on the subscription, and can be a string containing an exact sequence as well as one of the enum values

const (
	// SubOptsFirstEventOldest indicates all events should be dispatched to the subscription
	SubOptsFirstEventOldest SubOptsFirstEvent = "oldest"
	// SubOptsFirstEventNewest indicates only newly received events should be dispatched to the subscription
	SubOptsFirstEventNewest SubOptsFirstEvent = "newest"
)

type Subscription

type Subscription struct {
	SubscriptionRef

	Transport string              `ffstruct:"Subscription" json:"transport"`
	Filter    SubscriptionFilter  `ffstruct:"Subscription" json:"filter"`
	Options   SubscriptionOptions `ffstruct:"Subscription" json:"options"`
	Ephemeral bool                `ffstruct:"Subscription" json:"ephemeral,omitempty" ffexcludeinput:"true"`
	Created   *fftypes.FFTime     `ffstruct:"Subscription" json:"created" ffexcludeinput:"true"`
	Updated   *fftypes.FFTime     `ffstruct:"Subscription" json:"updated" ffexcludeinput:"true"`
}

Subscription is a binding between the stream of events within a namespace, and an event interface - such as an application listening on websockets

type SubscriptionCoreOptions

type SubscriptionCoreOptions struct {
	FirstEvent   *SubOptsFirstEvent `ffstruct:"SubscriptionCoreOptions" json:"firstEvent,omitempty"`
	ReadAhead    *uint16            `ffstruct:"SubscriptionCoreOptions" json:"readAhead,omitempty"`
	WithData     *bool              `ffstruct:"SubscriptionCoreOptions" json:"withData,omitempty"`
	Batch        *bool              `ffstruct:"SubscriptionCoreOptions" json:"batch,omitempty"`
	BatchTimeout *string            `ffstruct:"SubscriptionCoreOptions" json:"batchTimeout,omitempty"`
}

SubscriptionCoreOptions are the core options that apply across all transports REMEMBER TO ADD OPTIONS HERE TO MarshalJSON()

type SubscriptionFilter

type SubscriptionFilter struct {
	Events           string                `ffstruct:"SubscriptionFilter" json:"events,omitempty"`
	Message          MessageFilter         `ffstruct:"SubscriptionFilter" json:"message,omitempty"`
	Transaction      TransactionFilter     `ffstruct:"SubscriptionFilter" json:"transaction,omitempty"`
	BlockchainEvent  BlockchainEventFilter `ffstruct:"SubscriptionFilter" json:"blockchainevent,omitempty"`
	Topic            string                `ffstruct:"SubscriptionFilter" json:"topic,omitempty"`
	DeprecatedTopics string                `ffstruct:"SubscriptionFilter" json:"topics,omitempty"`
	DeprecatedTag    string                `ffstruct:"SubscriptionFilter" json:"tag,omitempty"`
	DeprecatedGroup  string                `ffstruct:"SubscriptionFilter" json:"group,omitempty"`
	DeprecatedAuthor string                `ffstruct:"SubscriptionFilter" json:"author,omitempty"`
}

SubscriptionFilter contains regular expressions to match against events. All must match for an event to be dispatched to a subscription

func NewSubscriptionFilterFromQuery

func NewSubscriptionFilterFromQuery(query url.Values) SubscriptionFilter

func (*SubscriptionFilter) Scan

func (sf *SubscriptionFilter) Scan(src interface{}) error

func (SubscriptionFilter) Value

func (sf SubscriptionFilter) Value() (driver.Value, error)

type SubscriptionOptions

type SubscriptionOptions struct {
	SubscriptionCoreOptions
	WebhookSubOptions
	// contains filtered or unexported fields
}

SubscriptionOptions customize the behavior of subscriptions

func (SubscriptionOptions) MarshalJSON

func (so SubscriptionOptions) MarshalJSON() ([]byte, error)

func (*SubscriptionOptions) Scan

func (so *SubscriptionOptions) Scan(src interface{}) error

Scan implements sql.Scanner

func (*SubscriptionOptions) TransportOptions

func (so *SubscriptionOptions) TransportOptions() fftypes.JSONObject

func (*SubscriptionOptions) UnmarshalJSON

func (so *SubscriptionOptions) UnmarshalJSON(b []byte) error

func (SubscriptionOptions) Value

func (so SubscriptionOptions) Value() (driver.Value, error)

Value implements sql.Valuer

type SubscriptionRef

type SubscriptionRef struct {
	ID        *fftypes.UUID `ffstruct:"Subscription" json:"id,omitempty" ffexcludeinput:"true"`
	Namespace string        `ffstruct:"Subscription" json:"namespace"`
	Name      string        `ffstruct:"Subscription" json:"name"`
}

SubscriptionRef are the fields that can be used to refer to a subscription

type SubscriptionStatus

type SubscriptionStatus struct {
	CurrentOffset int64 `ffstruct:"SubscriptionStatus" json:"currentOffset,omitempty" ffexcludeinout:"true"`
}

type SubscriptionWithStatus

type SubscriptionWithStatus struct {
	Subscription
	Status SubscriptionStatus `ffstruct:"SubscriptionWithStatus" json:"status,omitempty" ffexcludeinput:"true"`
}

type TokenAccount

type TokenAccount struct {
	Key string `ffstruct:"TokenBalance" json:"key,omitempty"`
}

Currently these types are just filtered views of TokenBalance. If more fields/aggregation become needed, they might merit a new table in the database.

type TokenAccountPool

type TokenAccountPool struct {
	Pool *fftypes.UUID `ffstruct:"TokenBalance" json:"pool,omitempty"`
}

type TokenApproval

type TokenApproval struct {
	LocalID         *fftypes.UUID      `ffstruct:"TokenApproval" json:"localId,omitempty" ffexcludeinput:"true"`
	Pool            *fftypes.UUID      `ffstruct:"TokenApproval" json:"pool,omitempty"`
	Connector       string             `ffstruct:"TokenApproval" json:"connector,omitempty" ffexcludeinput:"true"`
	Key             string             `ffstruct:"TokenApproval" json:"key,omitempty"`
	Operator        string             `ffstruct:"TokenApproval" json:"operator,omitempty"`
	Approved        bool               `ffstruct:"TokenApproval" json:"approved"`
	Info            fftypes.JSONObject `ffstruct:"TokenApproval" json:"info,omitempty" ffexcludeinput:"true"`
	Namespace       string             `ffstruct:"TokenApproval" json:"namespace,omitempty" ffexcludeinput:"true"`
	ProtocolID      string             `ffstruct:"TokenApproval" json:"protocolId,omitempty" ffexcludeinput:"true"`
	Subject         string             `ffstruct:"TokenApproval" json:"subject,omitempty" ffexcludeinput:"true"`
	Active          bool               `ffstruct:"TokenApproval" json:"active,omitempty" ffexcludeinput:"true"`
	Message         *fftypes.UUID      `ffstruct:"TokenApproval" json:"message,omitempty"`
	MessageHash     *fftypes.Bytes32   `ffstruct:"TokenApproval" json:"messageHash,omitempty" ffexcludeinput:"true"`
	Created         *fftypes.FFTime    `ffstruct:"TokenApproval" json:"created,omitempty" ffexcludeinput:"true"`
	TX              TransactionRef     `ffstruct:"TokenApproval" json:"tx" ffexcludeinput:"true"`
	BlockchainEvent *fftypes.UUID      `ffstruct:"TokenApproval" json:"blockchainEvent,omitempty" ffexcludeinput:"true"`
	Config          fftypes.JSONObject `ffstruct:"TokenApproval" json:"config,omitempty" ffexcludeoutput:"true"` // for REST calls only (not stored)
}

type TokenApprovalInput

type TokenApprovalInput struct {
	TokenApproval
	Message        *MessageInOut  `ffstruct:"TokenApprovalInput" json:"message,omitempty"`
	Pool           string         `ffstruct:"TokenApprovalInput" json:"pool,omitempty" ffexcludeoutput:"true"`
	IdempotencyKey IdempotencyKey `ffstruct:"TokenApprovalInput" json:"idempotencyKey,omitempty" ffexcludeoutput:"true"`
}

type TokenBalance

type TokenBalance struct {
	Pool       *fftypes.UUID    `ffstruct:"TokenBalance" json:"pool,omitempty"`
	TokenIndex string           `ffstruct:"TokenBalance" json:"tokenIndex,omitempty"`
	URI        string           `ffstruct:"TokenBalance" json:"uri,omitempty"`
	Connector  string           `ffstruct:"TokenBalance" json:"connector,omitempty"`
	Namespace  string           `ffstruct:"TokenBalance" json:"namespace,omitempty"`
	Key        string           `ffstruct:"TokenBalance" json:"key,omitempty"`
	Balance    fftypes.FFBigInt `ffstruct:"TokenBalance" json:"balance"`
	Updated    *fftypes.FFTime  `ffstruct:"TokenBalance" json:"updated,omitempty"`
}

func (*TokenBalance) Identifier

func (t *TokenBalance) Identifier() string

type TokenConnector

type TokenConnector struct {
	Name string `ffstruct:"TokenConnector" json:"name,omitempty"`
}

type TokenInterfaceFormat added in v1.1.3

type TokenInterfaceFormat = fftypes.FFEnum

type TokenPool

type TokenPool struct {
	ID              *fftypes.UUID         `ffstruct:"TokenPool" json:"id,omitempty" ffexcludeinput:"true"`
	Type            TokenType             `ffstruct:"TokenPool" json:"type" ffenum:"tokentype"`
	Namespace       string                `ffstruct:"TokenPool" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name            string                `ffstruct:"TokenPool" json:"name,omitempty"`
	NetworkName     string                `ffstruct:"TokenPool" json:"networkName,omitempty"`
	Standard        string                `ffstruct:"TokenPool" json:"standard,omitempty" ffexcludeinput:"true"`
	Locator         string                `ffstruct:"TokenPool" json:"locator,omitempty" ffexcludeinput:"true"`
	Key             string                `ffstruct:"TokenPool" json:"key,omitempty"`
	Symbol          string                `ffstruct:"TokenPool" json:"symbol,omitempty"`
	Decimals        int                   `ffstruct:"TokenPool" json:"decimals,omitempty" ffexcludeinput:"true"`
	Connector       string                `ffstruct:"TokenPool" json:"connector,omitempty"`
	Message         *fftypes.UUID         `ffstruct:"TokenPool" json:"message,omitempty" ffexcludeinput:"true"`
	Active          bool                  `ffstruct:"TokenPool" json:"active" ffexcludeinput:"true"`
	Created         *fftypes.FFTime       `ffstruct:"TokenPool" json:"created,omitempty" ffexcludeinput:"true"`
	Config          fftypes.JSONObject    `ffstruct:"TokenPool" json:"config,omitempty" ffexcludeoutput:"true"` // for REST calls only (not stored)
	Info            fftypes.JSONObject    `ffstruct:"TokenPool" json:"info,omitempty" ffexcludeinput:"true"`
	TX              TransactionRef        `ffstruct:"TokenPool" json:"tx,omitempty" ffexcludeinput:"true"`
	Interface       *fftypes.FFIReference `ffstruct:"TokenPool" json:"interface,omitempty"`
	InterfaceFormat TokenInterfaceFormat  `ffstruct:"TokenPool" json:"interfaceFormat,omitempty" ffenum:"tokeninterfaceformat" ffexcludeinput:"true"`
	Methods         *fftypes.JSONAny      `ffstruct:"TokenPool" json:"methods,omitempty" ffexcludeinput:"true"`
	Published       bool                  `ffstruct:"TokenPool" json:"published" ffexcludeinput:"true"`
	PluginData      string                `ffstruct:"TokenPool" json:"-" ffexcludeinput:"true"` // reserved for internal plugin use (not returned on API)
}

func (*TokenPool) Validate

func (t *TokenPool) Validate(ctx context.Context) (err error)

type TokenPoolDefinition added in v1.3.0

type TokenPoolDefinition struct {
	Pool *TokenPool `json:"pool"`
}

func (*TokenPoolDefinition) SetBroadcastMessage added in v1.3.0

func (t *TokenPoolDefinition) SetBroadcastMessage(msgID *fftypes.UUID)

func (*TokenPoolDefinition) Topic added in v1.3.0

func (t *TokenPoolDefinition) Topic() string

type TokenPoolInput added in v1.1.2

type TokenPoolInput struct {
	TokenPool
	IdempotencyKey IdempotencyKey `ffstruct:"TokenPoolInput" json:"idempotencyKey,omitempty" ffexcludeoutput:"true"`
}

type TokenTransfer

type TokenTransfer struct {
	Type            TokenTransferType  `ffstruct:"TokenTransfer" json:"type" ffenum:"tokentransfertype" ffexcludeinput:"true"`
	LocalID         *fftypes.UUID      `ffstruct:"TokenTransfer" json:"localId,omitempty" ffexcludeinput:"true"`
	Pool            *fftypes.UUID      `ffstruct:"TokenTransfer" json:"pool,omitempty"`
	TokenIndex      string             `ffstruct:"TokenTransfer" json:"tokenIndex,omitempty"`
	URI             string             `ffstruct:"TokenTransfer" json:"uri,omitempty"`
	Connector       string             `ffstruct:"TokenTransfer" json:"connector,omitempty" ffexcludeinput:"true"`
	Namespace       string             `ffstruct:"TokenTransfer" json:"namespace,omitempty" ffexcludeinput:"true"`
	Key             string             `ffstruct:"TokenTransfer" json:"key,omitempty"`
	From            string             `ffstruct:"TokenTransfer" json:"from,omitempty" ffexcludeinput:"postTokenMint"`
	To              string             `ffstruct:"TokenTransfer" json:"to,omitempty" ffexcludeinput:"postTokenBurn"`
	Amount          fftypes.FFBigInt   `ffstruct:"TokenTransfer" json:"amount"`
	ProtocolID      string             `ffstruct:"TokenTransfer" json:"protocolId,omitempty" ffexcludeinput:"true"`
	Message         *fftypes.UUID      `ffstruct:"TokenTransfer" json:"message,omitempty"`
	MessageHash     *fftypes.Bytes32   `ffstruct:"TokenTransfer" json:"messageHash,omitempty" ffexcludeinput:"true"`
	Created         *fftypes.FFTime    `ffstruct:"TokenTransfer" json:"created,omitempty" ffexcludeinput:"true"`
	TX              TransactionRef     `ffstruct:"TokenTransfer" json:"tx" ffexcludeinput:"true"`
	BlockchainEvent *fftypes.UUID      `ffstruct:"TokenTransfer" json:"blockchainEvent,omitempty" ffexcludeinput:"true"`
	Config          fftypes.JSONObject `ffstruct:"TokenTransfer" json:"config,omitempty" ffexcludeoutput:"true"` // for REST calls only (not stored)
}

type TokenTransferInput

type TokenTransferInput struct {
	TokenTransfer
	Message        *MessageInOut  `ffstruct:"TokenTransferInput" json:"message,omitempty"`
	Pool           string         `ffstruct:"TokenTransferInput" json:"pool,omitempty"`
	IdempotencyKey IdempotencyKey `ffstruct:"TokenTransferInput" json:"idempotencyKey,omitempty" ffexcludeoutput:"true"`
}

type TokenTransferType

type TokenTransferType = fftypes.FFEnum

type TokenType

type TokenType = fftypes.FFEnum

type Transaction

type Transaction struct {
	ID             *fftypes.UUID         `ffstruct:"Transaction" json:"id,omitempty"`
	Namespace      string                `ffstruct:"Transaction" json:"namespace,omitempty"`
	Type           TransactionType       `ffstruct:"Transaction" json:"type" ffenum:"txtype"`
	Created        *fftypes.FFTime       `ffstruct:"Transaction" json:"created"`
	IdempotencyKey IdempotencyKey        `ffstruct:"Transaction" json:"idempotencyKey,omitempty"`
	BlockchainIDs  fftypes.FFStringArray `ffstruct:"Transaction" json:"blockchainIds,omitempty"`
}

Transaction is a unit of work sent or received by this node It serves as a container for one or more Operations, BlockchainEvents, and other related objects

func (*Transaction) Size

func (tx *Transaction) Size() int64

type TransactionFilter

type TransactionFilter struct {
	Type string `ffstruct:"SubscriptionTransactionFilter" json:"type,omitempty"`
}

type TransactionRef

type TransactionRef struct {
	Type TransactionType `ffstruct:"Transaction" json:"type"`
	ID   *fftypes.UUID   `ffstruct:"Transaction" json:"id,omitempty"`
}

TransactionRef refers to a transaction, in other types

type TransactionStatus

type TransactionStatus struct {
	Status  OpStatus                    `ffstruct:"TransactionStatus" json:"status"`
	Details []*TransactionStatusDetails `ffstruct:"TransactionStatus" json:"details"`
}

type TransactionStatusDetails

type TransactionStatusDetails struct {
	Type      TransactionStatusType `ffstruct:"TransactionStatusDetails" json:"type"`
	SubType   string                `ffstruct:"TransactionStatusDetails" json:"subtype,omitempty"`
	Status    OpStatus              `ffstruct:"TransactionStatusDetails" json:"status"`
	Timestamp *fftypes.FFTime       `ffstruct:"TransactionStatusDetails" json:"timestamp,omitempty"`
	ID        *fftypes.UUID         `ffstruct:"TransactionStatusDetails" json:"id,omitempty"`
	Error     string                `ffstruct:"TransactionStatusDetails" json:"error,omitempty"`
	Info      fftypes.JSONObject    `ffstruct:"TransactionStatusDetails" json:"info,omitempty"`
}

type TransactionStatusType

type TransactionStatusType string
var (
	TransactionStatusTypeOperation       TransactionStatusType = "Operation"
	TransactionStatusTypeBlockchainEvent TransactionStatusType = "BlockchainEvent"
	TransactionStatusTypeBatch           TransactionStatusType = "Batch"
	TransactionStatusTypeTokenPool       TransactionStatusType = "TokenPool"
	TransactionStatusTypeTokenTransfer   TransactionStatusType = "TokenTransfer"
	TransactionStatusTypeTokenApproval   TransactionStatusType = "TokenApproval"
)

type TransactionType

type TransactionType = fftypes.FFEnum

type TransportPayloadType

type TransportPayloadType = fftypes.FFEnum

type TransportWrapper

type TransportWrapper struct {
	Group *Group `json:"group,omitempty"`
	Batch *Batch `json:"batch,omitempty"`
}

TransportWrapper wraps paylaods over data exchange transfers, for easy deserialization at target

type ValidatorType

type ValidatorType = fftypes.FFEnum

type Verifier

type Verifier struct {
	Hash      *fftypes.Bytes32 `ffstruct:"Verifier" json:"hash"` // Used to ensure the same ID is generated on each node, but not critical for verification. In v0.13 migration was set to the ID of the parent.
	Identity  *fftypes.UUID    `ffstruct:"Verifier" json:"identity,omitempty"`
	Namespace string           `ffstruct:"Verifier" json:"namespace,omitempty"`
	VerifierRef
	Created *fftypes.FFTime `ffstruct:"Verifier" json:"created,omitempty"`
}

Verifier is an identity verification system that has been established for this identity, such as a blockchain signing key identifier

func (*Verifier) Seal

func (v *Verifier) Seal() *Verifier

Seal updates the hash to be deterministically generated from the namespace+type+value, such that it will be the same on every node, and unique.

type VerifierRef

type VerifierRef struct {
	Type  VerifierType `ffstruct:"Verifier" json:"type" ffenum:"verifiertype"`
	Value string       `ffstruct:"Verifier" json:"value"`
}

VerifierRef is just the type + value (public key identifier etc.) from the verifier

type VerifierType

type VerifierType = fftypes.FFEnum

VerifierType is the type of an identity verifier. Where possible we use established DID verifier type strings

type WSAck

type WSAck struct {
	WSActionBase

	ID           *fftypes.UUID    `ffstruct:"WSAck" json:"id,omitempty"`
	Subscription *SubscriptionRef `ffstruct:"WSAck" json:"subscription,omitempty"`
}

WSAck acknowledges a received event (not applicable in AutoAck mode)

type WSActionBase

type WSActionBase struct {
	Type WSClientPayloadType `ffstruct:"WSActionBase" json:"type,omitempty" ffenum:"wstype"`
}

WSActionBase is the base fields of all client actions sent on the websocket

type WSChangeEventCommand

type WSChangeEventCommand struct {
	Type        WSChangeEventCommandType `json:"type" ffenum:"changeevent_cmd_type"`
	Collections []string                 `json:"collections"`
	Filter      ChangeEventFilter        `json:"filter"`
}

WSChangeEventCommand is the WebSocket command to send to start listening for change events. Replaces any previous start requests.

type WSChangeEventCommandType

type WSChangeEventCommandType = fftypes.FFEnum

type WSClientPayloadType

type WSClientPayloadType = fftypes.FFEnum

WSClientPayloadType actions go from client->server

type WSConnectionStatus

type WSConnectionStatus struct {
	ID            string                  `ffstruct:"WSConnectionStatus" json:"id"`
	RemoteAddress string                  `ffstruct:"WSConnectionStatus" json:"remoteAddress"`
	UserAgent     string                  `ffstruct:"WSConnectionStatus" json:"userAgent"`
	Subscriptions []*WSSubscriptionStatus `ffstruct:"WSConnectionStatus" json:"subscriptions"`
}

type WSError

type WSError struct {
	Type  WSClientPayloadType `ffstruct:"WSAck" json:"type" ffenum:"wstype"`
	Error string              `ffstruct:"WSAck" json:"error"`
}

WSError is sent to the client by the server in the case of a protocol error

type WSEventBatch added in v1.3.0

type WSEventBatch struct {
	Type         WSClientPayloadType `ffstruct:"WSEventBatch" json:"type" ffenum:"wstype"`
	ID           *fftypes.UUID       `ffstruct:"WSEventBatch" json:"id"`
	Subscription SubscriptionRef     `ffstruct:"WSEventBatch" json:"subscription"`
	Events       []*EventDelivery    `ffstruct:"WSEventBatch" json:"events"`
}

WSEventBatch is used when batched delivery is enabled over the websocket, allowing an array of events to be ack'd as a whole (rather than ack'ing individually)

type WSStart

type WSStart struct {
	WSActionBase

	AutoAck   *bool               `ffstruct:"WSStart" json:"autoack"`
	Namespace string              `ffstruct:"WSStart" json:"namespace"`
	Name      string              `ffstruct:"WSStart" json:"name"`
	Ephemeral bool                `ffstruct:"WSStart" json:"ephemeral"`
	Filter    SubscriptionFilter  `ffstruct:"WSStart" json:"filter"`
	Options   SubscriptionOptions `ffstruct:"WSStart" json:"options"`
}

WSStart starts a subscription on this socket - either an existing one, or creating an ephemeral one

type WSSubscriptionStatus

type WSSubscriptionStatus struct {
	StartTime *fftypes.FFTime    `ffstruct:"WSSubscriptionStatus" json:"startTime"`
	Ephemeral bool               `ffstruct:"WSSubscriptionStatus" json:"ephemeral"`
	Namespace string             `ffstruct:"WSSubscriptionStatus" json:"namespace"`
	Name      string             `ffstruct:"WSSubscriptionStatus" json:"name,omitempty"`
	Filter    SubscriptionFilter `ffstruct:"WSSubscriptionStatus" json:"filter"`
}

type WebSocketStatus

type WebSocketStatus struct {
	Enabled     bool                  `ffstruct:"WebSocketStatus" json:"enabled"`
	Connections []*WSConnectionStatus `ffstruct:"WebSocketStatus" json:"connections"`
}

type WebhookHTTPOptions added in v1.3.0

type WebhookHTTPOptions struct {
	HTTPProxyURL              *string `ffstruct:"WebhookHTTPOptions" json:"proxyURL,omitempty"`
	HTTPTLSHandshakeTimeout   string  `ffstruct:"WebhookHTTPOptions" json:"tlsHandshakeTimeout,omitempty"`
	HTTPRequestTimeout        string  `ffstruct:"WebhookHTTPOptions" json:"requestTimeout,omitempty"`
	HTTPMaxIdleConns          int     `ffstruct:"WebhookHTTPOptions" json:"maxIdleConns,omitempty"`
	HTTPIdleConnTimeout       string  `ffstruct:"WebhookHTTPOptions" json:"idleTimeout,omitempty"`
	HTTPConnectionTimeout     string  `ffstruct:"WebhookHTTPOptions" json:"connectionTimeout,omitempty"`
	HTTPExpectContinueTimeout string  `ffstruct:"WebhookHTTPOptions" json:"expectContinueTimeout,omitempty"`
}

type WebhookInputOptions

type WebhookInputOptions struct {
	Query   string `ffstruct:"WebhookInputOptions" json:"query,omitempty"`
	Headers string `ffstruct:"WebhookInputOptions" json:"headers,omitempty"`
	Body    string `ffstruct:"WebhookInputOptions" json:"body,omitempty"`
	Path    string `ffstruct:"WebhookInputOptions" json:"path,omitempty"`
	ReplyTX string `ffstruct:"WebhookInputOptions" json:"replytx,omitempty"`
}

type WebhookRetryOptions added in v1.3.0

type WebhookRetryOptions struct {
	Enabled      bool   `ffstruct:"WebhookRetryOptions" json:"enabled,omitempty"`
	Count        int    `ffstruct:"WebhookRetryOptions" json:"count,omitempty"`
	InitialDelay string `ffstruct:"WebhookRetryOptions" json:"initialDelay,omitempty"`
	MaximumDelay string `ffstruct:"WebhookRetryOptions" json:"maxDelay,omitempty"`
}

type WebhookSubOptions

type WebhookSubOptions struct {
	Fastack       bool                `ffstruct:"WebhookSubOptions" json:"fastack,omitempty"`
	URL           string              `ffstruct:"WebhookSubOptions" json:"url,omitempty"`
	Method        string              `ffstruct:"WebhookSubOptions" json:"method,omitempty"`
	JSON          bool                `ffstruct:"WebhookSubOptions" json:"json,omitempty"`
	Reply         bool                `ffstruct:"WebhookSubOptions" json:"reply,omitempty"`
	ReplyTag      string              `ffstruct:"WebhookSubOptions" json:"replytag,omitempty"`
	ReplyTX       string              `ffstruct:"WebhookSubOptions" json:"replytx,omitempty"`
	Headers       map[string]string   `ffstruct:"WebhookSubOptions" json:"headers,omitempty"`
	Query         map[string]string   `ffstruct:"WebhookSubOptions" json:"query,omitempty"`
	TLSConfigName string              `ffstruct:"WebhookSubOptions" json:"tlsConfigName,omitempty"`
	TLSConfig     *tls.Config         `ffstruct:"WebhookSubOptions" json:"-" ffexcludeinput:"true"`
	Input         WebhookInputOptions `ffstruct:"WebhookSubOptions" json:"input,omitempty"`
	Retry         WebhookRetryOptions `ffstruct:"WebhookSubOptions" json:"retry,omitempty"`
	HTTPOptions   WebhookHTTPOptions  `ffstruct:"WebhookSubOptions" json:"httpOptions,omitempty"`
	RestyClient   *resty.Client       `ffstruct:"WebhookSubOptions" json:"-" ffexcludeinput:"true"`
}

Jump to

Keyboard shortcuts

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