rivinec

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ClientName sets the client name for some of the command help messages
	ClientName = "rivine"
)

Functions

func ApiGet

func ApiGet(call string) (*http.Response, error)

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

func ApiPost(call, vals string) (*http.Response, error)

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

func CurrencyUnits(c types.Currency) string

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

func DecodeError(resp *http.Response) error

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

func Get(call string) error

Get makes an API call and discards the response. An error is returned if the response status is not 2xx.

func GetAPI

func GetAPI(call string, obj interface{}) error

GetAPI makes a GET API call and decodes the response. An error is returned if the response status is not 2xx.

func Non2xx

func Non2xx(code int) bool

Non2xx returns true for non-success HTTP status codes.

func ParseCurrency

func ParseCurrency(amount string) (string, error)

ParseCurrency converts a siacoin amount to base units.

func ParsePeriod

func ParsePeriod(period string) (string, error)

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

func Post(call, vals string) error

Post makes an API call and discards the response. An error is returned if the response status is not 2xx.

func PostResp

func PostResp(call, vals string, obj interface{}) error

PostResp makes a POST API call and decodes the response. An error is returned if the response status is not 2xx.

func Stopcmd

func Stopcmd()

Stopcmd is the handler for the command `siac stop`. Stops the daemon.

func Updatecheckcmd

func Updatecheckcmd()

func Updatecmd

func Updatecmd()

func Version

func Version()

Version prints the client version and exits

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 Walletinitcmd

func Walletinitcmd()

Walletinitcmd encrypts the wallet with the given password

func Walletloadseedcmd

func Walletloadseedcmd()

Walletloadseedcmd adds a seed to the wallet's list of seeds

func Walletlockcmd

func Walletlockcmd()

Walletlockcmd locks the wallet

func Walletseedscmd

func Walletseedscmd()

Walletseedcmd returns the current seed {

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.

func Walletunlockcmd

func Walletunlockcmd()

Walletunlockcmd unlocks a saved wallet

func YesNo

func YesNo(b bool) string

YesNo returns "Yes" if b is true, and "No" if b is false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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