dbmodels

package
v0.1.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	ID      uint64 `gorm:"primary_key"`
	Address string
}

Address is the gorm model for the 'addresses' table

type Block

type Block struct {
	ID                   uint64 `gorm:"primary_key"`
	BlockHash            string
	AcceptingBlockID     *uint64
	AcceptingBlock       *Block
	Version              int32
	HashMerkleRoot       string
	AcceptedIDMerkleRoot string
	UTXOCommitment       string
	Timestamp            time.Time
	Bits                 uint32
	Nonce                uint64
	BlueScore            uint64
	IsChainBlock         bool
	Mass                 uint64
	ParentBlocks         []Block `gorm:"many2many:parent_blocks;"`
}

Block is the gorm model for the 'blocks' table

type ParentBlock

type ParentBlock struct {
	BlockID       uint64
	Block         Block
	ParentBlockID uint64
	ParentBlock   Block
}

ParentBlock is the gorm model for the 'parent_blocks' table

type RawBlock

type RawBlock struct {
	BlockID   uint64
	Block     Block
	BlockData []byte
}

RawBlock is the gorm model for the 'raw_blocks' table

type Subnetwork

type Subnetwork struct {
	ID           uint64 `gorm:"primary_key"`
	SubnetworkID string
	GasLimit     *uint64
}

Subnetwork is the gorm model for the 'subnetworks' table

type Transaction

type Transaction struct {
	ID                 uint64 `gorm:"primary_key"`
	AcceptingBlockID   *uint64
	AcceptingBlock     *Block
	TransactionHash    string
	TransactionID      string
	LockTime           uint64
	SubnetworkID       uint64
	Subnetwork         Subnetwork
	Gas                uint64
	PayloadHash        string
	Payload            []byte
	Mass               uint64
	Version            int32
	Blocks             []Block `gorm:"many2many:transactions_to_blocks;"`
	TransactionOutputs []TransactionOutput
	TransactionInputs  []TransactionInput
}

Transaction is the gorm model for the 'transactions' table

type TransactionBlock

type TransactionBlock struct {
	TransactionID uint64
	Transaction   Transaction
	BlockID       uint64
	Block         Block
	Index         uint32
}

TransactionBlock is the gorm model for the 'transactions_to_blocks' table

func (TransactionBlock) TableName

func (TransactionBlock) TableName() string

TableName returns the table name associated to the TransactionBlock gorm model

type TransactionInput

type TransactionInput struct {
	ID                          uint64 `gorm:"primary_key"`
	TransactionID               uint64
	Transaction                 Transaction
	PreviousTransactionOutputID uint64
	PreviousTransactionOutput   TransactionOutput
	Index                       uint32
	SignatureScript             []byte
	Sequence                    uint64
}

TransactionInput is the gorm model for the 'transaction_inputs' table

type TransactionOutput

type TransactionOutput struct {
	ID            uint64 `gorm:"primary_key"`
	TransactionID uint64
	Transaction   Transaction
	Index         uint32
	Value         uint64
	ScriptPubKey  []byte
	IsSpent       bool
	AddressID     *uint64
	Address       *Address
}

TransactionOutput is the gorm model for the 'transaction_outputs' table

Jump to

Keyboard shortcuts

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