Documentation ¶
Index ¶
- Variables
- func ApiGet(call string) (*http.Response, error)
- func ApiPost(call, vals string) (*http.Response, error)
- func Consensuscmd()
- func CurrencyUnits(c types.Currency) string
- func DecodeError(resp *http.Response) error
- func DefaultClient()
- func Die(args ...interface{})
- func EstimatedHeightAt(t time.Time) types.BlockHeight
- func Gatewayaddresscmd()
- func Gatewaycmd()
- func Gatewayconnectcmd(addr string)
- func Gatewaydisconnectcmd(addr string)
- func Gatewaylistcmd()
- func Get(call string) error
- func GetAPI(call string, obj interface{}) error
- func Non2xx(code int) bool
- func ParseCurrency(amount string) (string, error)
- func ParsePeriod(period string) (string, error)
- func PeriodUnits(blocks types.BlockHeight) string
- func Post(call, vals string) error
- func PostResp(call, vals string, obj interface{}) error
- func Stopcmd()
- func Updatecheckcmd()
- func Updatecmd()
- func Version()
- func Walletaddresscmd()
- func Walletaddressescmd()
- func Walletbalancecmd()
- func Walletblockstakestatcmd()
- func Walletinitcmd()
- func Walletloadseedcmd()
- func Walletlockcmd()
- func Walletseedscmd()
- func Walletsendblockstakescmd(amount, dest string)
- func Walletsendsiacoinscmd(amount, dest string)
- func Wallettransactionscmd()
- func Walletunlockcmd()
- func YesNo(b bool) string
Constants ¶
This section is empty.
Variables ¶
var (
// ClientName sets the client name for some of the command help messages
ClientName = "rivine"
)
Functions ¶
func ApiGet ¶
ApiGet wraps a GET request with a status code check, such that if the GET does not return 2xx, the error will be read and returned. The response body is not closed.
func ApiPost ¶
ApiPost wraps a POST request with a status code check, such that if the POST does not return 2xx, the error will be read and returned. The response body is not closed.
func Consensuscmd ¶
func Consensuscmd()
Consensuscmd is the handler for the command `siac consensus`. Prints the current state of consensus.
func CurrencyUnits ¶
CurrencyUnits converts a types.Currency to a string with human-readable units. The unit used will be the largest unit that results in a value greater than 1. The value is rounded to 4 significant digits.
func DecodeError ¶
DecodeError returns the api.Error from a API response. This method should only be called if the response's status code is non-2xx. The error returned may not be of type api.Error in the event of an error unmarshalling the JSON.
func DefaultClient ¶
func DefaultClient()
DefaultClient parses the arguments using cobra with the default rivine setup
func Die ¶
func Die(args ...interface{})
Die prints its arguments to stderr, then exits the program with the default error code.
func EstimatedHeightAt ¶
func EstimatedHeightAt(t time.Time) types.BlockHeight
EstimatedHeightAt returns the estimated block height for the given time. Block height is estimated by calculating the minutes since a known block in the past and dividing by 10 minutes (the block time).
func Gatewayaddresscmd ¶
func Gatewayaddresscmd()
Gatewayaddresscmd is the handler for the command `siac gateway address`. Prints the gateway's network address.
func Gatewaycmd ¶
func Gatewaycmd()
Gatewaycmd is the handler for the command `siac gateway`. Prints the gateway's network address and number of peers.
func Gatewayconnectcmd ¶
func Gatewayconnectcmd(addr string)
Gatewayconnectcmd is the handler for the command `siac gateway add [address]`. Adds a new peer to the peer list.
func Gatewaydisconnectcmd ¶
func Gatewaydisconnectcmd(addr string)
Gatewaydisconnectcmd is the handler for the command `siac gateway remove [address]`. Removes a peer from the peer list.
func Gatewaylistcmd ¶
func Gatewaylistcmd()
Gatewaylistcmd is the handler for the command `siac gateway list`. Prints a list of all peers.
func Get ¶
Get makes an API call and discards the response. An error is returned if the response status is not 2xx.
func GetAPI ¶
GetAPI makes a GET API call and decodes the response. An error is returned if the response status is not 2xx.
func ParseCurrency ¶
ParseCurrency converts a siacoin amount to base units.
func ParsePeriod ¶
ParsePeriod converts a number of weeks to a number of blocks.
func PeriodUnits ¶
func PeriodUnits(blocks types.BlockHeight) string
PeriodUnits turns a period in terms of blocks to a number of weeks.
func Post ¶
Post makes an API call and discards the response. An error is returned if the response status is not 2xx.
func PostResp ¶
PostResp makes a POST API call and decodes the response. An error is returned if the response status is not 2xx.
func Updatecheckcmd ¶
func Updatecheckcmd()
func Walletaddresscmd ¶
func Walletaddresscmd()
Walletaddresscmd fetches a new address from the wallet that will be able to receive coins.
func Walletaddressescmd ¶
func Walletaddressescmd()
Walletaddressescmd fetches the list of addresses that the wallet knows.
func Walletbalancecmd ¶
func Walletbalancecmd()
Walletbalancecmd retrieves and displays information about the wallet.
func Walletblockstakestatcmd ¶
func Walletblockstakestatcmd()
Walletblockstakestatcmd gives all statistical info of blockstake
func Walletloadseedcmd ¶
func Walletloadseedcmd()
Walletloadseedcmd adds a seed to the wallet's list of seeds
func Walletsendblockstakescmd ¶
func Walletsendblockstakescmd(amount, dest string)
Walletsendblockstakescmd sends siafunds to a destination address.
func Walletsendsiacoinscmd ¶
func Walletsendsiacoinscmd(amount, dest string)
Walletsendsiacoinscmd sends siacoins to a destination address.
func Wallettransactionscmd ¶
func Wallettransactionscmd()
Wallettransactionscmd lists all of the transactions related to the wallet, providing a net flow of siacoins and siafunds for each.
Types ¶
This section is empty.