Select Git revision
ServerIO.ts
Forked from an inaccessible project.
datastructures.go 739 B
package types
// Message - MessageBody can be of any type but will be use here for Transaction, AckTransaction
type Message struct {
MessageType string `json:"messageType"`
MessageBody interface{} `json:"messageBody"`
}
// Transaction - represents a transaction in the blockchain
type Transaction struct {
Id string `json:"id"`
Sender string `json:"sender"`
Receiver string `json:"receiver"`
Amount string `json:"amount"`
}
// AckTransaction - represents an acknowledgement of a transaction @see vote function
type AckTransaction struct {
Id string `json:"id"`
AmountOfCorrectNode int `json:"amountOfCorrectNode"`
TotalNodes int `json:"totalNodes"`
}
type Database []Transaction