Documentation ¶
Index ¶
- Constants
- func CreditAddress(address string)
- func GetAddresses() (interface{}, error)
- func GetBalances(address string) (interface{}, error)
- func GetHistory(address string) (interface{}, error)
- func GetUserAddressFromRequest(r *http.Request) (string, error)
- func Grant(address string)
- func InitializeBlockchain()
- func InitializeDatabase()
- func NewAddress() (string, error)
- func SendAsset(from string, to string, name string, value float64) error
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 ¶
GetBalances returns the asset balance for the address
func GetHistory ¶
GetHistory returns the 'HistoryLength' last transactions for address
func Grant ¶
func Grant(address string)
Grant grants 'send' and 'receive' permissions to the address
func InitializeBlockchain ¶
func InitializeBlockchain()
func InitializeDatabase ¶
func InitializeDatabase()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.