model

package
v0.0.0-...-0f7f059 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoConfigureResponse

type AutoConfigureResponse struct {
	Success bool `json:"success"`
	Network struct {
		Nethash  string `json:"nethash,omitempty"`
		Token    string `json:"token,omitempty"`
		Symbol   string `json:"symbol,omitempty"`
		Explorer string `json:"explorer,omitempty"`
		Version  int    `json:"version,omitempty"`
	} `json:"network"`
}

AutoConfigureResponse to clients - so they can setup communcation accordingly

type Block

type Block struct {
	ID                   string        `json:"id" storm:"id"`
	Version              int           `json:"version"`
	Height               int           `json:"height" storm:"index"`
	Timestamp            int           `json:"timestamp"`
	PreviousBlock        string        `json:"previousBlock"`
	NumberOfTransactions int           `json:"numberOfTransactions"`
	TotalAmount          int           `json:"totalAmount"`
	TotalFee             int           `json:"totalFee"`
	Reward               int           `json:"reward"`
	PayloadLength        int           `json:"payloadLength"`
	PayloadHash          string        `json:"payloadHash"`
	GeneratorPublicKey   string        `json:"generatorPublicKey"`
	BlockSignature       string        `json:"blockSignature"`
	Transactions         []Transaction `json:"transactions"`
	PkIndex              uint64        `json:"-" storm:"index,increment"`
}

Block structure to store block data

type BlockCommonResponse

type BlockCommonResponse struct {
	Success bool `json:"success"`
	Common  struct {
		Height        int    `json:"height"`
		ID            string `json:"id"`
		PreviousBlock string `json:"previousBlock"`
		Timestamp     int    `json:"timestamp"`
	} `json:"common"`
	LastBlockHeight int `json:"lastBlockHeight"`
}

BlockCommonResponse response to peer/blocks/common?ids...

type BlockHeightResponse

type BlockHeightResponse struct {
	Success bool   `json:"success"`
	Height  int    `json:"height"`
	ID      string `json:"id"`
}

BlockHeightResponse structure to receive blocks from a random peer - from GET request

type BlockReceiveStruct

type BlockReceiveStruct struct {
	Block Block `json:"block"`
}

BlockReceiveStruct from POST request - handling received blocks from the active network

type BlockResponse

type BlockResponse struct {
	Success bool           `json:"success"`
	Blocks  []BlockTmpSync `json:"blocks"`
	Count   int            `json:"count,omitempty"`
}

BlockResponse structure to receive blocks from a random peer - from GET request

type BlockTmpSync

type BlockTmpSync struct {
	ID                   string        `json:"id"`
	Version              int           `json:"version"`
	Height               int           `json:"height"`
	Timestamp            int           `json:"timestamp"`
	PreviousBlock        string        `json:"previousBlock"`
	NumberOfTransactions int           `json:"numberOfTransactions"`
	TotalAmount          string        `json:"totalAmount"`
	TotalFee             string        `json:"totalFee"`
	Reward               string        `json:"reward"`
	PayloadLength        int           `json:"payloadLength"`
	PayloadHash          string        `json:"payloadHash"`
	GeneratorPublicKey   string        `json:"generatorPublicKey"`
	BlockSignature       string        `json:"blockSignature"`
	Transactions         []Transaction `json:"transactions"`
	PkIndex              uint64        `json:"-"`
}

BlockTmpSync structure to store block data used for large syncing /peer/blocks/?lastblockheight different types TMP FIX until main node update

type PeerStatus

type PeerStatus struct {
	Success        bool  `json:"success"`
	Height         int   `json:"height"`
	ForgingAllowed bool  `json:"forgingAllowed"`
	CurrentSlot    int   `json:"currentSlot"`
	Header         Block `json:"header"`
}

PeerStatus response sending structure. It show the current status of the peer

type PostBlockResponse

type PostBlockResponse struct {
	Success bool   `json:"success"`
	BlockID string `json:"blockID,omitempty"`
}

PostBlockResponse structure to receive result from PostBlock

type PostTransactionResponse

type PostTransactionResponse struct {
	Success        bool     `json:"success"`
	Message        string   `json:"message"`
	Error          string   `json:"error"`
	TransactionIDs []string `json:"transactionIds"`
}

PostTransactionResponse structure for call /peer/list

type Transaction

type Transaction struct {
	ID                    string                 `json:"id" storm:"id"`
	Timestamp             int32                  `json:"timestamp" storm:"index"`
	RecipientID           string                 `json:"recipientId"`
	Amount                int64                  `json:"amount" storm:"index"`
	Asset                 map[string]interface{} `json:"asset"`
	Fee                   int64                  `json:"fee"`
	Type                  TransactionType        `json:"type"`
	VendorField           string                 `json:"vendorField,omitempty"`
	Signature             string                 `json:"signature"`
	SignSignature         string                 `json:"signSignature,omitempty"`
	Signatures            []string               `json:"signatures,omitempty"`
	SenderPublicKey       string                 `json:"senderPublicKey"`
	SecondSenderPublicKey string                 `json:"secondSenderPublicKey,omitempty"`
	RequesterPublicKey    string                 `json:"requesterPublicKey,omitempty"`
	Blockid               string                 `json:"blockid" storm:"index"`
	Height                int                    `json:"height" storm:"index"`
	SenderID              string                 `json:"senderId"`
	Confirmations         int                    `json:"confirmations"`
	PkIndex               uint64                 `json:"-" storm:"index,increment"`
}

Transaction struct - represents structure of ARK.io blockchain transaction It is used to post transaction to mainnet and to receive results from arkapi Empty fields are emmited by default

type TransactionGetResponse

type TransactionGetResponse struct {
	Success      bool          `json:"success"`
	Transactions []Transaction `json:"transactions"`
	Count        string        `json:"count"`
}

TransactionGetResponse to send resposes

type TransactionPayload

type TransactionPayload struct {
	Transactions []Transaction `json:"transactions"`
}

TransactionPayload - list of tx to send to network METHOD POST receive tx payload from network Parse transaction from Array- e.g. block or post transaction

type TransactionType

type TransactionType byte

TransactionType to make it more readable - enum

Jump to

Keyboard shortcuts

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