Documentation ¶
Index ¶
- Constants
- Variables
- func CheckValidatorType(ctx context.Context, validator ValidatorType) error
- func ParseNamespacedOpID(ctx context.Context, nsIDStr string) (string, *fftypes.UUID, error)
- func TokenBalanceIdentifier(pool *fftypes.UUID, tokenIndex, identity string) string
- type Authorizer
- type Batch
- type BatchHeader
- type BatchManifest
- type BatchPayload
- type BatchPersisted
- type BatchState
- func (bs *BatchState) AddConfirmedDIDClaim(did string)
- func (bs *BatchState) AddFinalize(action func(ctx context.Context) error)
- func (bs *BatchState) AddPendingConfirm(id *fftypes.UUID, message *Message)
- func (bs *BatchState) AddPreFinalize(action func(ctx context.Context) error)
- func (bs *BatchState) RunFinalize(ctx context.Context) error
- func (bs *BatchState) RunPreFinalize(ctx context.Context) error
- type BatchType
- type Blob
- type BlobRef
- type BlockchainEvent
- type BlockchainEventFilter
- type BlockchainTransactionRef
- type ChangeEvent
- type ChangeEventFilter
- type ChangeEventType
- type ChartHistogram
- type ChartHistogramInterval
- type ChartHistogramType
- type ContractAPI
- type ContractCallRequest
- type ContractCallType
- type ContractListener
- type ContractListenerInput
- type ContractListenerOptions
- type ContractListenerWithStatus
- type ContractURLs
- type Data
- type DataAndBlob
- type DataArray
- type DataRef
- type DataRefOrValue
- type DataRefs
- type Datatype
- type DatatypeRef
- type Definition
- type DeprecatedDXInfo
- type DeprecatedNode
- type DeprecatedOrganization
- type EmptyInput
- type EnrichedEvent
- type Event
- type EventDelivery
- type EventDeliveryResponse
- type EventType
- type FFISerializedEvent
- type FFStringArray
- func (sa FFStringArray) AddToSortedSet(newValues ...string) (res FFStringArray, changed bool)
- func (sa *FFStringArray) Scan(src interface{}) error
- func (sa FFStringArray) String() string
- func (sa FFStringArray) Validate(ctx context.Context, fieldName string, isName bool, maxItems int) error
- func (sa FFStringArray) Value() (driver.Value, error)
- type Group
- type GroupIdentity
- type IDAndSequence
- type Identity
- type IdentityBase
- type IdentityClaim
- type IdentityCreateDTO
- type IdentityMessages
- type IdentityProfile
- type IdentityType
- type IdentityUpdate
- type IdentityUpdateDTO
- type IdentityVerification
- type IdentityWithVerifiers
- type InlineData
- type InputGroup
- type ListenerStatusError
- type LocallySequenced
- type Member
- type MemberInput
- type Members
- type Message
- func (m *Message) BatchMessage() *Message
- func (m *Message) DupDataCheck(ctx context.Context) (err error)
- func (m *Message) EstimateSize(includeDataRefs bool) int64
- func (m *Message) LocalSequence() int64
- func (m *Message) Seal(ctx context.Context) (err error)
- func (m *Message) Verify(ctx context.Context) error
- func (m *Message) VerifyFields(ctx context.Context) error
- type MessageFilter
- type MessageHeader
- type MessageInOut
- type MessageManifestEntry
- type MessageRef
- type MessageState
- type MessageType
- type MultipartyContract
- type MultipartyContractInfo
- type MultipartyContracts
- type Named
- type Namespace
- type NamespaceStatus
- type NamespaceStatusMultiparty
- type NamespaceStatusNode
- type NamespaceStatusOrg
- type NamespaceStatusPlugin
- type NamespaceStatusPlugins
- type NetworkAction
- type NetworkActionType
- type NextPin
- type Nonce
- type Offset
- type OffsetType
- type OpStatus
- type OpType
- type Operation
- type OperationCallbacks
- type OperationUpdate
- type OperationUpdateDTO
- type Pin
- type PinRewind
- type PreparedOperation
- type SignerRef
- type SubOptsFirstEvent
- type Subscription
- type SubscriptionCoreOptions
- type SubscriptionFilter
- type SubscriptionOptions
- func (so SubscriptionOptions) MarshalJSON() ([]byte, error)
- func (so *SubscriptionOptions) Scan(src interface{}) error
- func (so *SubscriptionOptions) TransportOptions() fftypes.JSONObject
- func (so *SubscriptionOptions) UnmarshalJSON(b []byte) error
- func (so SubscriptionOptions) Value() (driver.Value, error)
- type SubscriptionRef
- type SubscriptionStatus
- type SubscriptionWithStatus
- type TokenAccount
- type TokenAccountPool
- type TokenApproval
- type TokenApprovalInput
- type TokenBalance
- type TokenConnector
- type TokenPool
- type TokenPoolAnnouncement
- type TokenPoolState
- type TokenTransfer
- type TokenTransferInput
- type TokenTransferType
- type TokenType
- type Transaction
- type TransactionFilter
- type TransactionRef
- type TransactionStatus
- type TransactionStatusDetails
- type TransactionStatusType
- type TransactionType
- type TransportPayloadType
- type TransportWrapper
- type ValidatorType
- type Verifier
- type VerifierRef
- type VerifierType
- type WSAck
- type WSActionBase
- type WSChangeEventCommand
- type WSChangeEventCommandType
- type WSClientPayloadType
- type WSConnectionStatus
- type WSError
- type WSStart
- type WSSubscriptionStatus
- type WebSocketStatus
- type WebhookInputOptions
- type WebhookSubOptions
Constants ¶
const ( ManifestVersionUnset uint = 0 ManifestVersion1 uint = 1 )
const ( // ChartHistogramMaxBuckets max buckets that can be requested ChartHistogramMaxBuckets = 100 // ChartHistogramMinBuckets min buckets that can be requested ChartHistogramMinBuckets = 1 )
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" )
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" // 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" )
const ( HTTPHeadersBlobHashSHA256 = "x-ff-blob-hash-sha256" HTTPHeadersBlobSize = "x-ff-blob-size" )
const ( DIDPrefix = "did:" FireFlyDIDPrefix = "did:firefly:" FireFlyOrgDIDPrefix = "did:firefly:org/" FireFlyNodeDIDPrefix = "did:firefly:node/" FireFlyCustomDIDPrefix = "did:firefly:" )
const (
// DefaultTopic will be set as the topic of any messages set without a topic
DefaultTopic = "default"
)
const FFStringArrayStandardMax = 1024
FFStringArrayStandardMax is the standard length we set as a VARCHAR max in tables for a string array
const FFStringNameItemsMax = 15
Because each FFName has a max length of 64, 15 names (plus comma delimeters) is a safe max to pack into a string column of length 1024
const (
// LegacySystemNamespace is the system reserved namespace name (deprecated)
LegacySystemNamespace = "ff_system"
)
Variables ¶
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") )
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") )
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") )
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") )
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") )
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") // MessageTypeTransferBroadcast is a broadcast message to accompany/annotate a token transfer MessageTypeTransferBroadcast = fftypes.FFEnumValue("messagetype", "transfer_broadcast") // MessageTypeTransferPrivate is a private message to accompany/annotate a token transfer MessageTypeTransferPrivate = fftypes.FFEnumValue("messagetype", "transfer_private") )
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") )
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") )
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") // OpTypeBlockchainInvoke is a smart contract invoke OpTypeBlockchainInvoke = fftypes.FFEnumValue("optype", "blockchain_invoke") OpTypeSharedStorageUploadBatch = fftypes.FFEnumValue("optype", "sharedstorage_upload_batch") OpTypeSharedStorageUploadBlob = fftypes.FFEnumValue("optype", "sharedstorage_upload_blob") OpTypeSharedStorageUploadValue = fftypes.FFEnumValue("optype", "sharedstorage_upload_value") OpTypeSharedStorageDownloadBatch = fftypes.FFEnumValue("optype", "sharedstorage_download_batch") 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") )
var ( TokenTypeFungible = fftypes.FFEnumValue("tokentype", "fungible") TokenTypeNonFungible = fftypes.FFEnumValue("tokentype", "nonfungible") )
var ( // TokenPoolStateUnknown is a token pool that may not yet be activated // (should not be used in the code - only set via database migration for previously-created pools) TokenPoolStateUnknown = fftypes.FFEnumValue("tokenpoolstate", "unknown") // TokenPoolStatePending is a token pool that has been announced but not yet confirmed TokenPoolStatePending = fftypes.FFEnumValue("tokenpoolstate", "pending") // TokenPoolStateConfirmed is a token pool that has been confirmed on chain TokenPoolStateConfirmed = fftypes.FFEnumValue("tokenpoolstate", "confirmed") )
var ( TokenTransferTypeMint = fftypes.FFEnumValue("tokentransfertype", "mint") TokenTransferTypeBurn = fftypes.FFEnumValue("tokentransfertype", "burn") TokenTransferTypeTransfer = fftypes.FFEnumValue("tokentransfertype", "transfer") )
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") // TransactionTypeContractInvoke is a smart contract invoke TransactionTypeContractInvoke = fftypes.FFEnumValue("txtype", "contract_invoke") // TransactionTypeTokenTransfer represents a token approval TransactionTypeTokenApproval = fftypes.FFEnumValue("txtype", "token_approval") // TransactionTypeDataPublish represents a publish to shared storage TransactionTypeDataPublish = fftypes.FFEnumValue("txtype", "data_publish") )
var ( TransportPayloadTypeMessage = fftypes.FFEnumValue("transportpayload", "message") TransportPayloadTypeBatch = fftypes.FFEnumValue("transportpayload", "batch") )
var ( // VerifierTypeEthAddress is an Ethereum (secp256k1) address string VerifierTypeEthAddress = fftypes.FFEnumValue("verifiertype", "ethereum_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") )
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") )
var ( // NetworkActionTerminate request all network members to stop using the current contract and move to the next one configured NetworkActionTerminate = fftypes.FFEnumValue("networkactiontype", "terminate") )
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 ParseNamespacedOpID ¶
Types ¶
type Authorizer ¶
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 BlobRef ¶
type BlobRef struct { Hash *fftypes.Bytes32 `ffstruct:"BlobRef" json:"hash"` Size int64 `ffstruct:"BlobRef" json:"size"` Name string `ffstruct:"BlobRef" json:"name"` Public string `ffstruct:"BlobRef" json:"public,omitempty"` }
func (*BlobRef) BatchBlobRef ¶
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 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 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"` Message *fftypes.UUID `ffstruct:"ContractAPI" json:"message,omitempty" ffexcludeinput:"true"` URLs ContractURLs `ffstruct:"ContractAPI" json:"urls" 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
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"` Options map[string]interface{} `ffstruct:"ContractCallRequest" json:"options"` }
type ContractCallType ¶
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
type ContractListenerWithStatus ¶
type ContractListenerWithStatus struct { ContractListener Status interface{} `ffstruct:"ContractListenerWithStatus" json:"status,omitempty" ffexcludeinput:"true"` }
type ContractURLs ¶
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 ¶
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) EstimateSize ¶
type DataAndBlob ¶
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 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 ¶
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 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 (*Event) LocalSequence ¶
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 ¶
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
type FFStringArray ¶
type FFStringArray []string
FFStringArray is an array of strings, each conforming to the requirements of a FireFly name
func NewFFStringArray ¶
func NewFFStringArray(initialContent ...string) FFStringArray
func (FFStringArray) AddToSortedSet ¶
func (sa FFStringArray) AddToSortedSet(newValues ...string) (res FFStringArray, changed bool)
AddToSortedSet determines if the new string is already in the set of strings (case insensitive), and if not it adds it to the list (lower case) and returns a new slice of alphabetically sorted strings reference and true. If no change is made, the original reference is returned and false.
func (*FFStringArray) Scan ¶
func (sa *FFStringArray) Scan(src interface{}) error
func (FFStringArray) String ¶
func (sa FFStringArray) String() string
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) SetBroadcastMessage ¶
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 ¶
IDAndSequence is a combination of a UUID and a stored sequence
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
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
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 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 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 MemberInput ¶
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"` State MessageState `ffstruct:"Message" json:"state,omitempty" ffenum:"messagestate" ffexcludeinput:"true"` Confirmed *fftypes.FFTime `ffstruct:"Message" json:"confirmed,omitempty" ffexcludeinput:"true"` Data DataRefs `ffstruct:"Message" json:"data" ffexcludeinput:"true"` Pins FFStringArray `ffstruct:"Message" json:"pins,omitempty" ffexcludeinput:"true"` 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 ¶
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.
func (*Message) EstimateSize ¶
func (*Message) LocalSequence ¶
type MessageFilter ¶
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 FFStringArray `ffstruct:"MessageHeader" json:"topics,omitempty"` Tag string `ffstruct:"MessageHeader" json:"tag,omitempty"` DataHash *fftypes.Bytes32 `ffstruct:"MessageHeader" json:"datahash,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"` 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 ¶
MessageState is the current transmission/confirmation state of a message
type MessageType ¶
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
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:"-"` }
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"` Tokens []*NamespaceStatusPlugin `ffstruct:"NamespaceStatusPlugins" json:"tokens"` }
NamespaceStatusPlugins is a map of plugins configured in the namespace
type NetworkAction ¶
type NetworkAction struct {
Type NetworkActionType `ffstruct:"NetworkAction" json:"type" ffenum:"networkactiontype"`
}
type NetworkActionType ¶
NetworkActionType is a type of action to perform
type 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 OpStatus ¶
type OpStatus string
OpStatus is the current status of an operation
const ( // 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 ¶
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
type OperationCallbacks ¶
type OperationCallbacks interface {
OperationUpdate(update *OperationUpdate)
}
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 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 ¶
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 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"` }
SubscriptionCoreOptions are the core options that apply across all transports
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
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
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 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"` 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 Pool string `ffstruct:"TokenApprovalInput" json:"pool,omitempty"` }
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 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"` 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"` State TokenPoolState `ffstruct:"TokenPool" json:"state,omitempty" ffenum:"tokenpoolstate" 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"` }
type TokenPoolAnnouncement ¶
type TokenPoolAnnouncement struct {
Pool *TokenPool `json:"pool"`
}
func (*TokenPoolAnnouncement) SetBroadcastMessage ¶
func (t *TokenPoolAnnouncement) SetBroadcastMessage(msgID *fftypes.UUID)
func (*TokenPoolAnnouncement) Topic ¶
func (t *TokenPoolAnnouncement) Topic() string
type TokenPoolState ¶
TokenPoolState is the current confirmation state of a token pool
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"` }
type TokenTransferType ¶
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"` BlockchainIDs 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 TransportPayloadType ¶
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 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
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 ¶
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 WSClientPayloadType ¶
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 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 WebSocketStatus ¶
type WebSocketStatus struct { Enabled bool `ffstruct:"WebSocketStatus" json:"enabled"` Connections []*WSConnectionStatus `ffstruct:"WebSocketStatus" json:"connections"` }
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 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"` Input WebhookInputOptions `ffstruct:"WebhookSubOptions" json:"input,omitempty"` }
Source Files ¶
- authorizer.go
- batch.go
- batch_state.go
- blob.go
- blockchainevent.go
- change_event.go
- charthistogram.go
- constants.go
- contract_listener.go
- contracts.go
- data.go
- datatype.go
- definition.go
- emptyinput.go
- event.go
- group.go
- headers.go
- id_and_sequence.go
- identity.go
- locally_sequenced.go
- message.go
- namespace.go
- namespace_status.go
- nextpin.go
- node.go
- nonce.go
- offset.go
- operation.go
- organization.go
- pin.go
- stringarray.go
- subscription.go
- tokenapproval.go
- tokenbalance.go
- tokenconnector.go
- tokenpool.go
- tokentransfer.go
- transaction.go
- transport_wrapper.go
- verifier.go
- webhooks.go
- websocket_actions.go
- websocket_status.go