dst

package
v0.0.0-...-f093799 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceResponse

type BalanceResponse struct {
	Status    string  `json:"status"`
	Reason    string  `json:"reason,omitempty"`
	Timestamp string  `json:"timestamp"`
	Balance   float64 `json:"balance,omitempty"`
}

type Block

type Block struct {
	Index        uint32        `json:"index"`
	Transactions []Transaction `json:"transactions"`
	Validator    string        `json:"validator"`
	Hash         string        `json:"hash"`
	PreviousHash string        `json:"previous_hash"`
	Capacity     uint32        `json:"capacity"`
}

type BlockUnHashed

type BlockUnHashed struct {
	Index        uint32
	Transactions []Transaction
	Validator    string
	PreviousHash string
	Capacity     uint32
}

type NeighboorInformationMessage

type NeighboorInformationMessage struct {
	Info       *NeighboorNode
	Peers      map[uint32]*NeighboorNode
	Blockchain []Block
}

type NeighboorNode

type NeighboorNode struct {
	Id        uint32  `json:"id"`
	BootStrap bool    `json:"bootstrap"`
	PublicKey string  `json:"public_key"`
	Balance   float64 `json:"balance"`
	Stake     float64 `json:"stake"`
}

type Neighboors

type Neighboors struct {
	DSNodes map[uint32]*NeighboorNode `json:"node"`
	Mu      sync.Mutex                `json:"-"`
}

type Node

type Node struct {
	// Ip net.IP maybe no need for ip
	// Port      uint32 maybe no need for port
	Id         uint32     `json:"id"`
	BootStrap  bool       `json:"bootstrap"`
	Nonce      uint32     `json:"nonce"`
	Stake      float64    `json:"stake"`
	PublicKey  string     `json:"public_key"`
	Balance    float64    `json:"balance"`
	Validator  string     `json:"validator"`
	BlockChain []Block    `json:"blockchain"`
	Mu         sync.Mutex `json:"-"`
}

type Transaction

type Transaction struct {
	SenderAddress     string  `json:"sender_address"`
	RecipientAddress  string  `json:"recipient_address"`
	TypeOfTransaction string  `json:"type_of_transaction"`
	Amount            float64 `json:"amount,omitempty"`
	Message           string  `json:"message,omitempty"`
	Fee               float64 `json:"fee"`
	Nonce             uint32  `json:"nonce"`
	TransactionId     string  `json:"transaction_id"`
	Signature         []byte  `json:"signature"`
}

type TransactionRequest

type TransactionRequest struct {
	RecipientAddressID uint32  `json:"recipient_address_id"`
	TypeOfTransaction  string  `json:"type_of_transaction"`
	Amount             float64 `json:"amount,omitempty"`
	Message            string  `json:"message,omitempty"`
}

type TransactionResponse

type TransactionResponse struct {
	Timestamp string `json:"timestamp"`
	Status    string `json:"status"`
	Reason    string `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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