Iridium Wallet Daemon

The Iridium RPC Wallet (iridium_walletd) is a server that provides a JSON 2.0 RPC API for transactions and address management. You can call it from the command line or by it's RPC API. a configuration file can also be made to avoid typing recurrent option.

:!: you can always call the online help by typing

 $ ./iridium_walletd --help


Even in case of a non running daemon, the Iridium RPC Wallet still provive some basic functions as generating a new wallet and showing a wallet address

To start using the RPC wallet (the iridium_walletd binary) you must first generate a new wallet.
A wallet is called a container for the binary.
Container file is the only file that stores all data required to run services.
It contains the user addresses and private keys.
Make sure to backup this file regularly.

If you use the testnet, you have to generate your wallet with the –testnet option too

To generate a new container (a unique Iridium wallet), run the following command :

 $ ./iridium_walletd --container-file=mywallet --container-password=password --generate-container

or shorter :

 $ ./iridium_walletd -w mywallet -p password -g
  • mywallet is the name of the wallet file 1).
  • password is the secret password of the new wallet file. Remember it, write it, save it : there is no way to recover it.
  • the –generate-container or -g option tell iridium_walletd to generate container file and exit.

If the operation is successful, you will get message with your new Iridium address.2)

At the same time Iridium RPC Wallet will save your wallet file on the local disk (in the same folder where Iridium RPC Wallet is located) and shut down.

To show a container address (a unique Iridium wallet), run the following command :

 $ ./iridium_walletd --container-file=mywallet --container-password=password --address

or shorter :

 $ ./iridium_walletd -w mywallet -p password --address
  • mywallet is the name of the wallet file 3).
  • password is the secret password of the new wallet file. Remember it, write it, save it : there is no way to recover it.
  • the –address option tell iridium_walletd to show the address of the wallet and exit.

If the operation is successful, you will get message with the address of the asked Iridium wallet.

There are two ways for running the Iridium RPC Wallet :

  • Connect to a daemon running on a distant server.
  • Run as stand-alone by using the build-in daemon

Remote connection

This allow you to bind your Iridium RPC Wallet ( iridium_walled ) to an Iridium daemon ( iridiumd ) that is already running on a local or a remote machines.

This kind of connection allow you to start Iridium RPC Wallet on a slow machine while the daemon is going to work on a separate server and handle requests from network and some Iridium RPC Wallet or Iridium simple wallet.

For a local already running daemon, you can use either localhost or 127.0.0.1 as IP address.
For a remote daemons, specify the remote daemon's IP address4). Default Iridium daemon ports are 12007(p2p) and 13007(RPC).

Run the following command to start an Iridium RPC Wallet with a remote connection:

 $ ./iridium_walletd -w mywallet -p password --daemon-address=remote_ip --daemon-port=13007


Standalone mode

This provide you an out-of-box RPC Wallet with nothing else needed.
You will get a fully functional daemon for Iridium network inside Iridium RPC Wallet.
This is also the faster method for developping applications around Iridium.

Use the following command to start Iridium RPC Wallet with an in-process node

 $ ./iridium_walletd -w mywallet -p password --local


Command line and configuration file options

The Iridium RPC wallet and it's options can be started with both the command line and a configuration file.
The configuration file can be used for the “permanent” options.

When using a configuration file, the container-file and the container-password options have to be found in that file.
For an “exchange” usage, you surely want to intensively use the RPC queries.
In that case, just generate a dumb wallet and use it in the configuration file.


:!: Options passed to the command line has priority over a configuration file : In this example, the rpc port will be binded to 14008 :

$ cat walletd.conf
bind-port=14007
container-file=mywallet
container-password=password
local=yes
log-level=2
 $ ./iridiumd_walletd -c walletd.conf --data-dir ~/walletdDB  --testnet --bind-port 14008


Options summary

:!: Some options are not available in config file.

Command line option Description Command line example Configuration file example
Command line only
-h | --helpProduce help message and exit--help N/A
-c | --config argAbsolute or relative configuration file--config=~/iridium_walletd.conf N/A
--data-dir argSpecify the data directory5)--data-dir=~/walletdDB (default is ~/.iridium) N/A
-d | --daemonRun in backgound as daemon--daemon N/A
-g | --generate-containerGenerate a new wallet and exit-g N/A
--addressPrint the specified wallet addresses and exit–address N/A
Command line and configuration file
-w | --container-file argSpecify a wallet file-w mywalletcontainer-file=mywallet
-p | --container-password argPassword of the specified wallet file-p mypasswordcontainer-password=mypassword
--localStart the embedded daemon (default is remote mode)--locallocal=1 | yes | true
--testnetTestnet mode--testnettestnet =1 | yes | true
--bind-address argRPC bind address (default is 0.0.0.0)--bind-address=127.0.0.1bind-address=127.0.0.1
--bind-port argRPC bind port (default is 14007)--bind-port 14008bind-port=14008
-l | --log-file argSpecify the log file (default is iridium_walled.log)--log-file ~/mywalletd.loglog-file=~/mywalletd.log
--server-rootSpecify a working directory6)--server-root=~/IRDWalletdserver-root=~/IRDWalletd
--log-level argThe log verbosity level (default is 2)--log-level=1log-level=1
--daemon-address argThe Iridium daemon IP adress (default is 127.0.0.1)7)--daemon-address=192.168.1.5daemon-address=192.168.1.5
--daemon-port argThe Iridium daemon port(default is 13007)8)--daemon-port=14008daemon-port=14008
Options used only when running in local mode
--p2p-bind-ip argInterface for p2p (default is 0.0.0.0)9)--p2p-bind-ip=192.168.1.5p2p-bind-ip=192.168.1.5
--p2p-bind-port argPort for p2p (default is 12007)10)--p2p-bind-port=12008p2p-bind-port=12008
--p2p-external-port argExternal port for p2p11)--p2p-external-port=5009p2p-external-port=5009
--allow-local-ipAllow local ip add to peer list12)--allow-local-ipallow-local-ip=1 | yes | true
--add-peer argManually add peer to peerlist--add-peer=66.77.88.99add-peer=66.77.88.99
--add-priority-nodeSpecify a list of peers to connect13)–add-priority-node=66.77.88.99add-priority-node=66.77.88.99
--add-exclusive-node argSpecify list of peers to connect only14)--add-exclusive-node=66.77.88.99add-exclusive-node=66.77.88.99
--seed-node argConnect to a node to retrieve peer addresses--seed-node=66.77.88.99seed-node=66.77.88.99
--hide-my-portDo not announce yourself as a peer--hide-my-porthide-my-port=1 | yes | true


iridium_walled is setup ? you can now start to query it : The Iridum Wallet Daemon RPC calls


1) , 3)
It can also be a path to the file, relative or absolute
2)
if mywallet exists Iridium RPC Wallet will show a notification and will ask to provide a different name.
4)
the distant server has to allow incoming connections from the 13007 port and the daemon has to be started with the --rpc-bind-ip remote_ip
5)
This is where Iridium RPC wallet will store the files included the blockchain in case of local option specified
6)
every path will be relative to the specified server-root directory
7) , 8)
The RPC wallet expect to find a running daemon at the specified address and port in case of the local option is disabled
9)
The daemon should be reachable at this address for p2p exchanges. Default is to listen on all interfaces
10)
The daemon should be reachable at this port for p2p exchanges. If upnpd is enabled on the router, the daemon ask to open it
11)
In case of NAT routing, the external reachable port has to be secified here
12)
mostly in debug purposes
13)
and attempt to keep the connection open
14)
add-priority-node and seed-node are ignored