Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CoinBlock ¶
type CoinBlock struct { gorm.Model // PubKey is the public key of the peer PubKey string `gorm:"index"` // TotalCoins is the number of coins the peer has after the txn TotalCoins float64 // TXN is the amount added/reduced from the old `TotalCoins` TXN float64 // Hash is the blake2 hash of the last node's msgpack in base64 LastHash string }
CoinBlock the the coin blockchain stored onto a psql DB for now
type CoinPack ¶
type CoinPack struct { PubKey string `msgpack:"public_key"` TotalCoins float64 `msgpack:"total_coins"` TXN float64 `msgpack:"txn"` LastHash string `msgpack:"hash"` }
CoinPack is used to pack a record into msgpack
type DHT ¶
type DHT struct { gorm.Model // PubKey is the base64 Curve25519 public key of the peer PubKey string `gorm:"uniqueIndex"` // NickName is the peer's short name used to make reaching it easier NickName string `gorm:"uniqueIndex"` }
DHT is the DB model for the hash table
type RegisterBody ¶
RegisterBody is used to deserialize the HTTP register endpoint's body
type ResolveReponse ¶
type ResolveReponse struct {
PubKey string `json:"pub_key"`
}
ResolveReponse is the model for the response of a resolve request
Click to show internal directories.
Click to hide internal directories.