local

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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

func GetJSON(url string) ([]byte, error)

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

func HighwayRequestTimeout() time.Duration

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

func PostJSON(url string, body []byte) ([]byte, error)

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

Jump to

Keyboard shortcuts

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