View Source Radixir.Config (radixir v0.0.3)

Configuration helpers.

Link to this section Summary

Functions

Fetches the username / password at specified index.

Fetches core api url.

Fetches gateway api url.

Fetches the network being used.

Fetches passwords.

Fetches system api url.

Specifies whether or not the testnet is being used.

Fetches usernames.

Link to this section Types

Specs

error_message() :: String.t()

Specs

password() :: String.t()

Specs

url() :: String.t()

Specs

username() :: String.t()

Link to this section Functions

Specs

auth(non_neg_integer()) ::
  {:ok, username(), password()} | {:error, error_message()}

Fetches the username / password at specified index.

Example

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then auth(0) would return {:ok, "admin", "funny cats very Jack 21!"}

Specs

core_api_url() :: url() | nil

Fetches core api url.

Specs

gateway_api_url() :: url() | nil

Fetches gateway api url.

Specs

network() :: String.t()

Fetches the network being used.

Note

The two possibilities are stokenet or mainnet.

Specs

passwords() :: {:ok, [password()]} | {:error, error_message()}

Fetches passwords.

Note

See .envrc.example for required format of passwords string.

Specs

system_api_url() :: url() | nil

Fetches system api url.

Specs

testnet?() :: boolean()

Specifies whether or not the testnet is being used.

Specs

usernames() :: {:ok, [username()]} | {:error, error_message()}

Fetches usernames.

Note

See .envrc.example for required format of usernames string.