Documentation
¶
Index ¶
- Constants
- func Connect(ctx context.Context, dbConfig *config.Database, ...) (self *gorm.DB, err error)
- func Migrate(ctx context.Context, config *config.Config) (err error)
- func NewConnection(ctx context.Context, config *config.Config, applicationName string) (self *gorm.DB, err error)
- func NewReadOnlyConnection(ctx context.Context, config *config.Config, applicationName string) (self *gorm.DB, err error)
- type AppSyncContractNotification
- type BundleItem
- type BundleItemNotification
- type BundleState
- type BundlingService
- type Contract
- type ContractNotification
- type ContractSource
- type DataItem
- type DataItemNotification
- type DiscordIdRolesPayload
- type Interaction
- type InteractionNotification
- type State
- type SyncedComponent
- type WalletDiscordIdPayload
- type WarpySyncerAssets
- type WarpySyncerTransaction
- type WarpyUserId
Constants ¶
View Source
const ( TableContract = "contracts" ContractTypePst = "pst" ContractTypeOther = "other" )
View Source
const (
TableBundleItem = "bundle_items"
)
View Source
const TableContractSource = "contracts_src"
View Source
const (
TableDataItem = "data_items"
)
View Source
const (
TableInteraction = "interactions"
)
View Source
const TableState = "sync_state"
View Source
const TableWarpySyncerAssets = "warpy_syncer_assets"
View Source
const TableWarpySyncerTransactions = "warpy_syncer_transactions"
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
Types ¶
type AppSyncContractNotification ¶
type AppSyncContractNotification struct {
ContractTxId string `json:"contractTxId"`
Creator string `json:"creator"`
Type string `json:"type"`
BlockHeight uint64 `json:"blockHeight"`
BlockTimestamp uint64 `json:"blockTimestamp"`
Source string `json:"source"`
SyncTimestamp int64 `json:"syncTimestamp"`
}
func (*AppSyncContractNotification) MarshalBinary ¶
func (self *AppSyncContractNotification) MarshalBinary() (data []byte, err error)
type BundleItem ¶
type BundleItem struct {
// Numerical id of the interaction
InteractionID int
// Alternative way of bundling. GW creates data items and stores them in this column
DataItem pgtype.Bytea
// Can be preloaded by gorm, but isn't by default.
Interaction Interaction
// Oryginal transaction needed to create the bundle
Transaction pgtype.JSONB
// Tags created by the sequencer
Tags pgtype.JSONB
// State of bundle
State BundleState
// Which bundling service was used to send this data item
Service pgtype.Text
// Block height upon which interaction was bundled. Used to trigger verification later
BlockHeight sql.NullInt64
// Response from bundlr.network
BundlrResponse pgtype.JSONB
// Time of the last update to this row
UpdatedAt time.Time
}
CREATE TABLE "bundle_items" ("interaction_id" bigserial NOT NULL,"state" bundle_state NOT NULL,"block_height" bigint,"updated_at" timestamptz,PRIMARY KEY ("interaction_id"),CONSTRAINT "fk_bundle_items_interaction" FOREIGN KEY ("interaction_id") REFERENCES "interactions"("id")) CREATE INDEX IF NOT EXISTS "idx_bundle_items_block_height" ON "bundle_items" USING btree("block_height" desc) WHERE state != 'ON_ARWEAVE'
func (BundleItem) TableName ¶
func (BundleItem) TableName() string
type BundleItemNotification ¶
type BundleItemNotification struct {
InteractionID int `json:"id"`
Transaction *pgtype.JSONB `json:"tx"`
Tags *pgtype.JSONB `json:"tg"`
DataItem *string `json:"di"`
}
JSON message sent through the notification channel
type BundleState ¶
type BundleState string
const ( BundleStatePending BundleState = "PENDING" BundleStateUploading BundleState = "UPLOADING" BundleStateUploaded BundleState = "UPLOADED" BundleStateChecking BundleState = "CHECKING" BundleStateOnArweave BundleState = "ON_ARWEAVE" BundleStateMalformed BundleState = "MALFORMED" BundleStateDuplicate BundleState = "DUPLICATE" )
func (*BundleState) Scan ¶
func (self *BundleState) Scan(value interface{}) error
type BundlingService ¶ added in v0.2.105
type BundlingService string
const ( BundlingServiceIrys BundlingService = "IRYS" BundlingServiceTurbo BundlingService = "TURBO" )
func (BundlingService) String ¶ added in v0.2.131
func (self BundlingService) String() string
type Contract ¶
type Contract struct {
ContractId string
SrcTxId pgtype.Varchar
InitState pgtype.JSONB
Owner pgtype.Varchar
Type pgtype.Varchar
Project pgtype.Varchar
PstTicker pgtype.Varchar
PstName pgtype.Varchar
BlockHeight uint64 // NOT NULL
ContentType pgtype.Varchar
BundlerContractTxId pgtype.Varchar
BundlerContractNode pgtype.Varchar
ContractTx pgtype.JSONB
BlockTimestamp uint64 // NOT NULL
Testnet pgtype.Varchar
DeploymentType pgtype.Varchar
Manifest pgtype.JSONB
SyncTimestamp pgtype.Int8
}
func NewContract ¶
func NewContract() *Contract
type ContractNotification ¶
type ContractNotification struct {
ContractTxId string `json:"contractTxId"`
Test bool `json:"test"`
Source string `json:"source"`
InitialState pgtype.JSONB `json:"initialState"`
Tags []arweave.Tag `json:"tags"`
SrcTxId string `json:"srcTxId"`
}
func (*ContractNotification) MarshalBinary ¶
func (self *ContractNotification) MarshalBinary() (data []byte, err error)
type ContractSource ¶
type ContractSource struct {
SrcTxId string
Src pgtype.Text
SrcContentType pgtype.Varchar
SrcBinary pgtype.Bytea
SrcWasmLang pgtype.Varchar
BundlerSrcTxId pgtype.Varchar
BundlerSrcNode pgtype.Varchar
SrcTx pgtype.JSONB
Owner pgtype.Varchar
Testnet pgtype.Text
BundlerResponse pgtype.Text
DeploymentType pgtype.Varchar
}
func NewContractSource ¶
func NewContractSource() *ContractSource
func (*ContractSource) IsJS ¶
func (self *ContractSource) IsJS() bool
func (ContractSource) TableName ¶
func (ContractSource) TableName() string
type DataItem ¶ added in v0.2.105
type DataItem struct {
// Id of the data item
DataItemID string `gorm:"primaryKey"`
// Data item, ready to be sent. This is a nested bundle or a plain data item
DataItem pgtype.Bytea
// State of bundle
State BundleState
// Which bundling service was used to send this data item
Service pgtype.Text
// Block height upon which interaction was bundled. Used to trigger verification later
BlockHeight pgtype.Int8
// Response from bundlr.network
Response pgtype.JSONB
// Time of the last update to this row
UpdatedAt time.Time
// Time of creation
CreatedAt time.Time
}
type DataItemNotification ¶ added in v0.2.105
type DataItemNotification struct {
DataItemId string `json:"id"`
}
JSON message sent through the notification channel
type DiscordIdRolesPayload ¶ added in v0.2.199
type Interaction ¶
type Interaction struct {
ID int `json:"id" gorm:"primaryKey"`
InteractionId arweave.Base64String
Interaction pgtype.JSONB `json:"interaction"`
BlockHeight int64
BlockId arweave.Base64String
ContractId string `json:"contractId"`
Function string
Input string
ConfirmationStatus string
InteractWrite pq.StringArray `gorm:"type:text[]"`
SortKey string
LastSortKey pgtype.Text
// Time when interaction was synced to te database
SyncTimestamp pgtype.Int8
// https://github.com/warp-contracts/gateway/blob/main/src/gateway/tasks/syncTransactions.ts#L175
Evolve sql.NullString
// https://github.com/warp-contracts/gateway/blob/ef7aad549045943f0127542cce36cd94a966bdc7/src/gateway/tasks/syncTransactions.ts#L187
Testnet sql.NullString
// Hardcoded arsyncer
Source string
// Wallet address, 44 characters
Owner string
// Not needed:
BundlerTxId string
// LastSortKey string
BlockTimestamp int64
}
func (*Interaction) GetInteraction ¶
func (self *Interaction) GetInteraction() *smartweave.Interaction
func (Interaction) TableName ¶ added in v0.2.79
func (Interaction) TableName() string
type InteractionNotification ¶
type InteractionNotification struct {
ContractTxId string `json:"contractTxId"`
Test bool `json:"test"`
Source string `json:"source"`
Interaction string `json:"interaction"`
SrcTxId string `json:"srcTxId"`
}
func (*InteractionNotification) MarshalBinary ¶
func (self *InteractionNotification) MarshalBinary() (data []byte, err error)
type State ¶
type State struct {
// Name of the synced component (interactions, contracts)
Name SyncedComponent `gorm:"primaryKey" json:"name"`
// Timestamp of the last fully processed transaction block
FinishedBlockTimestamp uint64 `json:"finished_block_timestamp"`
// Height of the last fully processed transaction block
FinishedBlockHeight uint64 `json:"finished_block_height"`
// Hash of the last fully processed transaction block
// Next block needs to have this hash set as its previous block hash
FinishedBlockHash arweave.Base64String `json:"finished_block_hash"`
}
type SyncedComponent ¶
type SyncedComponent string
const ( SyncedComponentInteractions SyncedComponent = "Interactions" SyncedComponentContracts SyncedComponent = "Contracts" SyncedComponentForwarder SyncedComponent = "Forwarder" SyncedComponentSequencer SyncedComponent = "Sequencer" SyncedComponentRelayer SyncedComponent = "Relayer" SyncedComponentWarpySyncerAvax SyncedComponent = "WarpySyncerAvax" SyncedComponentWarpySyncerArbitrum SyncedComponent = "WarpySyncerArbitrum" SyncedComponentWarpySyncerMode SyncedComponent = "WarpySyncerMode" SyncedComponentWarpySyncerManta SyncedComponent = "WarpySyncerManta" SyncedComponentWarpySyncerBsc SyncedComponent = "WarpySyncerBsc" SyncedComponentWarpySyncerSei SyncedComponent = "WarpySyncerSei" SyncedComponentWarpySyncerBase SyncedComponent = "WarpySyncerBase" )
type WalletDiscordIdPayload ¶ added in v0.2.199
type WarpySyncerAssets ¶ added in v0.2.173
type WarpySyncerTransaction ¶ added in v0.2.173
type WarpySyncerTransaction struct {
TxId string `gorm:"primaryKey" json:"tx_id"`
FromAddress string `json:"from_address"`
ToAddress string `json:"to_address"`
BlockHeight uint64 `json:"block_height"`
BlockTimestamp uint64 `json:"block_timestamp"`
SyncTimestamp uint64 `json:"sync_timestamp"`
MethodName string `json:"method_name"`
Chain string `json:"chain"`
Protocol string `json:"protocol"`
Input pgtype.JSONB `json:"input"`
}
type WarpyUserId ¶ added in v0.2.228
type WarpyUserId struct {
Key string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.