repository

package
v0.0.0-...-339e6d3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitialReward         = 10     // Quantity of asset that will be given to new users
	RewardName            = "blue" // Asset's name for reward
	RewardHalvingInterval = 100    // Every time the number of addresses in our wallet reach this value, the reward will be halved
	HistoryLength         = 20     // The number of transactions shown for the address history
)
View Source
const (
	BucketName = "address"   // The name of the bucket for storing addresses
	FileName   = "e-coin.db" // The file name for the data file
)

Variables

This section is empty.

Functions

func CreditAddress

func CreditAddress(address string)

CreditAddress credits an address with the current reward quantity

func GetAddresses

func GetAddresses() (interface{}, error)

GetAddresses returns the list of addresses in our wallet

func GetBalances

func GetBalances(address string) (interface{}, error)

GetBalances returns the asset balance for the address

func GetHistory

func GetHistory(address string) (interface{}, error)

GetHistory returns the 'HistoryLength' last transactions for address

func GetUserAddressFromRequest

func GetUserAddressFromRequest(r *http.Request) (string, error)

func Grant

func Grant(address string)

Grant grants 'send' and 'receive' permissions to the address

func InitializeBlockchain

func InitializeBlockchain()

func InitializeDatabase

func InitializeDatabase()

func NewAddress

func NewAddress() (string, error)

NewAddress generates a new wallet address

func SendAsset

func SendAsset(from string, to string, name string, value float64) error

SendAsset sends a quantity of asset name to an address

Types

This section is empty.

Jump to

Keyboard shortcuts

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