View Source Icon.Config (ICON 2.0 SDK v0.2.3)

This module defines different configuration variables for the ICON 2.0 SDK.

Link to this section Summary

Functions

Berlin node: this is a test network node that offers the latest features and may be unstable. Resets happen frequently without notice.

Berlin node: this is a test network node that offers the latest features and may be unstable. Resets happen frequently without notice.

Lisbon node: this is a test network node with long term support which environment is the closest to mainnet.

Lisbon node: this is a test network node with long term support which environment is the closest to mainnet.

Mainnet node: this is a node connected to the ICON 2.0 network and it'll be used as the default options when creating an Icon.RPC.Identity.

Mainnet node: this is a node connected to the ICON 2.0 network and it'll be used as the default options when creating an Icon.RPC.Identity.

Preloads all variables in a namespace if supplied.

Puts the value to Icon.Config.berlin_node/0. Optionally, receives the namespace.

Puts the value to Icon.Config.lisbon_node/0. Optionally, receives the namespace.

Puts the value to Icon.Config.mainnet_node/0. Optionally, receives the namespace.

Puts the value to Icon.Config.sejong_node/0. Optionally, receives the namespace.

Reloads the value for Icon.Config.berlin_node/0. Optionally, receives the namespace for the variable.

Reloads the value for Icon.Config.lisbon_node/0. Optionally, receives the namespace for the variable.

Reloads the value for Icon.Config.mainnet_node/0. Optionally, receives the namespace for the variable.

Reloads the value for Icon.Config.sejong_node/0. Optionally, receives the namespace for the variable.

Sejong node: this is a test network node for applications without audit.

Sejong node: this is a test network node for applications without audit.

Creates a template for OS environment variables given a filename. Additionally, it can receive a list of options

Validates that all required variables are present. Returns :ok if they are, raises if they're not.

Validates that all required variables are present. Returns :ok if they are, {:error, errors} if they are not. errors will be a list of all errors encountered while getting required variables.

Link to this section Functions

Link to this function

berlin_node!(namespace \\ nil)

View Source
@spec berlin_node!(Skogsra.Env.namespace()) :: binary() | no_return()

Berlin node: this is a test network node that offers the latest features and may be unstable. Resets happen frequently without notice.

iex> Icon.Config.berlin_node!()
"https://berlin.net.solidwallet.io"

Bang version of Icon.Config.berlin_node/0 (fails on error). Optionally, receives the namespace for the variable.

Link to this function

berlin_node(namespace \\ nil)

View Source
@spec berlin_node(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}

Berlin node: this is a test network node that offers the latest features and may be unstable. Resets happen frequently without notice.

iex> Icon.Config.berlin_node!()
"https://berlin.net.solidwallet.io"

Calling Icon.Config.berlin_node() will ensure the following:

Link to this function

lisbon_node!(namespace \\ nil)

View Source
@spec lisbon_node!(Skogsra.Env.namespace()) :: binary() | no_return()

Lisbon node: this is a test network node with long term support which environment is the closest to mainnet.

iex> Icon.Config.lisbon_node!()
"https://lisbon.net.solidwallet.io"

Bang version of Icon.Config.lisbon_node/0 (fails on error). Optionally, receives the namespace for the variable.

Link to this function

lisbon_node(namespace \\ nil)

View Source
@spec lisbon_node(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}

Lisbon node: this is a test network node with long term support which environment is the closest to mainnet.

iex> Icon.Config.lisbon_node!()
"https://lisbon.net.solidwallet.io"

Calling Icon.Config.lisbon_node() will ensure the following:

Link to this function

mainnet_node!(namespace \\ nil)

View Source
@spec mainnet_node!(Skogsra.Env.namespace()) :: binary() | no_return()

Mainnet node: this is a node connected to the ICON 2.0 network and it'll be used as the default options when creating an Icon.RPC.Identity.

iex> Icon.Config.mainnet_node!()
"https://ctz.solidwallet.io"

Bang version of Icon.Config.mainnet_node/0 (fails on error). Optionally, receives the namespace for the variable.

Link to this function

mainnet_node(namespace \\ nil)

View Source
@spec mainnet_node(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}

Mainnet node: this is a node connected to the ICON 2.0 network and it'll be used as the default options when creating an Icon.RPC.Identity.

iex> Icon.Config.mainnet_node!()
"https://ctz.solidwallet.io"

Calling Icon.Config.mainnet_node() will ensure the following:

  • Binding order: [:system, :config]
  • OS environment variable: "MAINNET_NODE"
  • Type: :binary
  • Default: "https://ctz.solidwallet.io"
  • Required: true
  • Cached: true
Link to this function

preload(namespace \\ nil)

View Source
@spec preload(Skogsra.Env.namespace()) :: :ok

Preloads all variables in a namespace if supplied.

Link to this function

put_berlin_node(value, namespace \\ nil)

View Source
@spec put_berlin_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}

Puts the value to Icon.Config.berlin_node/0. Optionally, receives the namespace.

Link to this function

put_lisbon_node(value, namespace \\ nil)

View Source
@spec put_lisbon_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}

Puts the value to Icon.Config.lisbon_node/0. Optionally, receives the namespace.

Link to this function

put_mainnet_node(value, namespace \\ nil)

View Source
@spec put_mainnet_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}

Puts the value to Icon.Config.mainnet_node/0. Optionally, receives the namespace.

Link to this function

put_sejong_node(value, namespace \\ nil)

View Source
@spec put_sejong_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}

Puts the value to Icon.Config.sejong_node/0. Optionally, receives the namespace.

Link to this function

reload_berlin_node(namespace \\ nil)

View Source
@spec reload_berlin_node(Skogsra.Env.namespace()) ::
  {:ok, binary()} | {:error, binary()}

Reloads the value for Icon.Config.berlin_node/0. Optionally, receives the namespace for the variable.

Link to this function

reload_lisbon_node(namespace \\ nil)

View Source
@spec reload_lisbon_node(Skogsra.Env.namespace()) ::
  {:ok, binary()} | {:error, binary()}

Reloads the value for Icon.Config.lisbon_node/0. Optionally, receives the namespace for the variable.

Link to this function

reload_mainnet_node(namespace \\ nil)

View Source
@spec reload_mainnet_node(Skogsra.Env.namespace()) ::
  {:ok, binary()} | {:error, binary()}

Reloads the value for Icon.Config.mainnet_node/0. Optionally, receives the namespace for the variable.

Link to this function

reload_sejong_node(namespace \\ nil)

View Source
@spec reload_sejong_node(Skogsra.Env.namespace()) ::
  {:ok, binary()} | {:error, binary()}

Reloads the value for Icon.Config.sejong_node/0. Optionally, receives the namespace for the variable.

Link to this function

sejong_node!(namespace \\ nil)

View Source
@spec sejong_node!(Skogsra.Env.namespace()) :: binary() | no_return()

Sejong node: this is a test network node for applications without audit.

iex> Icon.Config.sejong_node!()
"https://sejong.net.solidwallet.io"

Bang version of Icon.Config.sejong_node/0 (fails on error). Optionally, receives the namespace for the variable.

Link to this function

sejong_node(namespace \\ nil)

View Source
@spec sejong_node(Skogsra.Env.namespace()) :: {:ok, binary()} | {:error, binary()}

Sejong node: this is a test network node for applications without audit.

iex> Icon.Config.sejong_node!()
"https://sejong.net.solidwallet.io"

Calling Icon.Config.sejong_node() will ensure the following:

Link to this function

template(filename, options \\ [])

View Source
@spec template(
  Path.t(),
  keyword()
) :: :ok | {:error, File.posix()}

Creates a template for OS environment variables given a filename. Additionally, it can receive a list of options:

  • type: What kind of file it will generate (:elixir, :unix, :windows).
  • namespace: Namespace for the variables.
Link to this function

validate!(namespace \\ nil)

View Source
@spec validate!(Skogsra.Env.namespace()) :: :ok | no_return()

Validates that all required variables are present. Returns :ok if they are, raises if they're not.

It is possible to provide a namespace as argument (defaults to nil).

Link to this function

validate(namespace \\ nil)

View Source
@spec validate(Skogsra.Env.namespace()) :: :ok | {:error, [binary()]}

Validates that all required variables are present. Returns :ok if they are, {:error, errors} if they are not. errors will be a list of all errors encountered while getting required variables.

It is possible to provide a namespace as argument (defaults to nil).