Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coin ¶
type Coin uint64
Coin is the type for safe interaction with the values of the number of coins.
func NewCoin ¶
NewCoin creates a type of coins, as an argument expects to get a cipher representation of the sum. For example 100 000 000 is 1 coin, 10 000 000 is 0.1 coin.
type Hash ¶
type Hash []byte
Hash a type for storing hashes.
func (*Hash) MarshalJSON ¶
MarshalJSON required for serialization and correction of standard byte processing in GO.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON required for deserialization and correction of standard byte processing in GO.
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
KeyPair this is a pair of keys: private and public.
func NewKeyPair ¶
NewKeyPair creates and returns a pointer to a key pair (public, private).
type PublicKey ¶
type PublicKey Hash
PublicKey this is a public key.
func NewPublicKeyByHex ¶
NewPublicKeyByHex creates a public key for the string representation.
type Tx ¶
type Tx struct { Id Hash `json:"id"` SenderPublicKey Hash `json:"senderPublicKey"` SenderId Hash `json:"senderId"` RecipientId Hash `json:"recipientId"` Amount Coin `json:"amount"` Fee Coin `json:"fee"` Signature Hash `json:"signature"` Timestamp int64 `json:"timestamp"` Nonce uint32 `json:"nonce"` Height uint32 `json:"height"` Chain Hash `json:"chain"` PreviousTx Hash `json:"previousTx"` }
Tx determines the structure of the transaction.
func (*Tx) Mine
deprecated
func (t *Tx) Mine()
Mine generates a nonce field and automatically fills in the nonce and id fields. To make a transaction, you will need to spend a little bit of processing power, But it will be so fast that it will be almost unnoticeable, because quite low complexity is used. Look constant `complexity`.
Deprecated: Use GenerateId.