Documentation
¶
Index ¶
- func ChainID() string
- func Environment() string
- func GetJSON(url string) ([]byte, error)
- func HighwayHostPort() string
- func HighwayRequestTimeout() time.Duration
- func HomeDir() string
- func IceFireHost() string
- func IsIceFireEnabled() bool
- func IsProduction() bool
- func JWTSigningKey() []byte
- func NodeAPIHost() string
- func NodeGrpcHost() string
- func NodeRpcHost() string
- func PostJSON(url string, body []byte) ([]byte, error)
- func PublicDomain() string
- func ValidatorAddress() string
- type BroadcastTxResponse
- type LocalContext
- func (c LocalContext) BroadcastTx(txMsg *txtypes.Tx) (*BroadcastTxResponse, error)
- func (c LocalContext) BroadcastTxAPI(tx *txtypes.Tx) (*BroadcastTxResponse, error)
- func (c LocalContext) EncodeTx(tx *txtypes.Tx) ([]byte, error)
- func (c LocalContext) SimulateTx(txRawBytes []byte) (*txtypes.SimulateResponse, error)
- func (c LocalContext) SimulateTxAPI(txRawBytes []byte) (*txtypes.SimulateResponse, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainID ¶ added in v0.7.1
func ChainID() string
ChainID returns the chain ID from the environment variable SONR_CHAIN_ID. (default: sonr-localnet-1)
func Environment ¶ added in v0.7.1
func Environment() string
Environment returns the environment from the environment variable SONR_ENVIRONMENT. (default: local)
func GetJSON ¶ added in v0.7.1
GetJSON makes a GET request to the given URL and returns the response body as bytes
func HighwayHostPort ¶ added in v0.7.1
func HighwayHostPort() string
HighwayHostPort returns the node highway host from the environment variable SONR_NODE_HIGHWAY_HOST. (default: :8080)
func HighwayRequestTimeout ¶ added in v0.7.1
HighwayRequestTimeout returns the node highway request timeout from the environment variable SONR_NODE_HIGHWAY_REQUEST_TIMEOUT. (default: 8sec)
func HomeDir ¶ added in v0.7.0
func HomeDir() string
The HomeDir function returns the home directory of the current user.
func IceFireHost ¶ added in v0.7.1
func IceFireHost() string
IceFireHost returns the IceFire host from the environment variable SONR_ICEFIRE_HOST. (default: 0.0.0.0:6001)
func IsIceFireEnabled ¶ added in v0.7.1
func IsIceFireEnabled() bool
IsIceFireEnabled returns true if the account icefire is enabled.
func IsProduction ¶ added in v0.7.1
func IsProduction() bool
IsProduction returns true if the environment is production.
func JWTSigningKey ¶ added in v0.7.1
func JWTSigningKey() []byte
JWTSigningKey returns the JWT signing key from the environment variable SONR_JWT_SIGNING_KEY. (default: sercrethatmaycontainch@r$32chars)
func NodeAPIHost ¶ added in v0.7.1
func NodeAPIHost() string
NodeAPIHost returns the node API host from the environment variable SONR_NODE_API_HOST. (default: 0.0.0.0:1317)
func NodeGrpcHost ¶ added in v0.7.1
func NodeGrpcHost() string
NodeGrpcHost returns the node gRPC host from the environment variable SONR_NODE_GRPC_HOST. (default: 0.0.0.0:9090)
func NodeRpcHost ¶ added in v0.7.1
func NodeRpcHost() string
NodeRpcHost returns the node RPC host from the environment variable SONR_NODE_RPC_HOST. (default: 0.0.0.0:26657)
func PostJSON ¶ added in v0.7.1
PostJSON makes a POST request to the given URL and returns the response body as bytes
func PublicDomain ¶ added in v0.7.1
func PublicDomain() string
PublicDomain returns the public domain from the environment variable SONR_PUBLIC_DOMAIN. (default: localhost)
func ValidatorAddress ¶ added in v0.6.20
func ValidatorAddress() string
ValidatorAddress returns the validator address from the environment variable SONR_VALIDATOR_ADDRESS. (default: 0x0000000000)
Types ¶
type BroadcastTxResponse ¶ added in v0.6.6
type BroadcastTxResponse = txtypes.BroadcastTxResponse
type LocalContext ¶ added in v0.6.6
type LocalContext struct { HomeDir string NodeHome string ConfigDirPath string ConfigTomlPath string }
LocalContext is a struct that holds the current context of the application.
func Context ¶
func Context(opts ...Option) LocalContext
Context returns the current context of the Sonr blockchain application.
func (LocalContext) BroadcastTx ¶ added in v0.6.6
func (c LocalContext) BroadcastTx(txMsg *txtypes.Tx) (*BroadcastTxResponse, error)
BroadcastTx broadcasts a transaction on the Sonr blockchain network
func (LocalContext) BroadcastTxAPI ¶ added in v0.7.1
func (c LocalContext) BroadcastTxAPI(tx *txtypes.Tx) (*BroadcastTxResponse, error)
BroadcastTx broadcasts a transaction on the Sonr blockchain network
func (LocalContext) EncodeTx ¶ added in v0.7.1
func (c LocalContext) EncodeTx(tx *txtypes.Tx) ([]byte, error)
The `EncodeTx` function is a method of the `LocalContext` struct. It takes a transaction (`tx`) as input and returns the encoded transaction bytes as output.
func (LocalContext) SimulateTx ¶ added in v0.6.6
func (c LocalContext) SimulateTx(txRawBytes []byte) (*txtypes.SimulateResponse, error)
SimulateTx simulates a transaction on the Sonr blockchain network
func (LocalContext) SimulateTxAPI ¶ added in v0.7.1
func (c LocalContext) SimulateTxAPI(txRawBytes []byte) (*txtypes.SimulateResponse, error)
SimulateTx simulates a transaction on the Sonr blockchain network
type Option ¶ added in v0.6.7
type Option func(LocalContext)
Option is a function that configures the local context