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
@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.
@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:
- Binding order: [:system, :config]
- OS environment variable: "BERLIN_NODE"
- Type: :binary
- Default: "https://berlin.net.solidwallet.io"
- Required: true
- Cached: true
@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.
@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:
- Binding order: [:system, :config]
- OS environment variable: "LISBON_NODE"
- Type: :binary
- Default: "https://lisbon.net.solidwallet.io"
- Required: true
- Cached: true
@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.
@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
@spec preload(Skogsra.Env.namespace()) :: :ok
Preloads all variables in a namespace if supplied.
@spec put_berlin_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Icon.Config.berlin_node/0. Optionally, receives
the namespace.
@spec put_lisbon_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Icon.Config.lisbon_node/0. Optionally, receives
the namespace.
@spec put_mainnet_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Icon.Config.mainnet_node/0. Optionally, receives
the namespace.
@spec put_sejong_node(binary(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value to Icon.Config.sejong_node/0. Optionally, receives
the namespace.
@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.
@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.
@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.
@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.
@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.
@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:
- Binding order: [:system, :config]
- OS environment variable: "SEJONG_NODE"
- Type: :binary
- Default: "https://sejong.net.solidwallet.io"
- Required: true
- Cached: true
@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.
@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).
@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).