Reads the configuration parameters (RPC user, password, port) for a given blockchain from the MultiChain data directory. The function automatically determines the platform‑specific base directory, but a custom base can be supplied for testing.
Arguments
- chain_name
Character string. Name of the MultiChain blockchain.
- base_dir
Optional character string. Base directory where MultiChain stores blockchain data. If
NULL(default), the platform‑specific default is used:Windows:
%APPDATA%/MultiChainmacOS:
~/Library/Application Support/MultiChainLinux/other:
~/.multichain
Value
A list with four components:
- user
RPC username (from
multichain.conf).- password
RPC password (from
multichain.conf).- port
RPC port number (integer).
- host
Always
"127.0.0.1"(hard‑coded).
See also
mc_connect to create a connection object using the
returned configuration.
Examples
if (FALSE) { # \dontrun{
# Get configuration for a chain called "my_chain"
config <- mc_get_config("my_chain")
print(config)
} # }