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
Generate a new Iridium wallet
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.
Show an Iridium wallet address
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.
Start the Iridium wallet Daemon for RPC Calls
There are two ways for running the Iridium RPC Wallet :
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 | --help | Produce help message and exit | --help | N/A |
-c | --config arg | Absolute or relative configuration file | --config=~/iridium_walletd.conf | N/A |
--data-dir arg | Specify the data directory5) | --data-dir=~/walletdDB (default is ~/.iridium) | N/A |
-d | --daemon | Run in backgound as daemon | --daemon | N/A |
-g | --generate-container | Generate a new wallet and exit | -g | N/A |
--address | Print the specified wallet addresses and exit | –address | N/A |
Command line and configuration file | |||
-w | --container-file arg | Specify a wallet file | -w mywallet | container-file=mywallet |
-p | --container-password arg | Password of the specified wallet file | -p mypassword | container-password=mypassword |
--local | Start the embedded daemon (default is remote mode) | --local | local=1 | yes | true |
--testnet | Testnet mode | --testnet | testnet =1 | yes | true |
--bind-address arg | RPC bind address (default is 0.0.0.0) | --bind-address=127.0.0.1 | bind-address=127.0.0.1 |
--bind-port arg | RPC bind port (default is 14007) | --bind-port 14008 | bind-port=14008 |
-l | --log-file arg | Specify the log file (default is iridium_walled.log) | --log-file ~/mywalletd.log | log-file=~/mywalletd.log |
--server-root | Specify a working directory6) | --server-root=~/IRDWalletd | server-root=~/IRDWalletd |
--log-level arg | The log verbosity level (default is 2) | --log-level=1 | log-level=1 |
--daemon-address arg | The Iridium daemon IP adress (default is 127.0.0.1)7) | --daemon-address=192.168.1.5 | daemon-address=192.168.1.5 |
--daemon-port arg | The Iridium daemon port(default is 13007)8) | --daemon-port=14008 | daemon-port=14008 |
Options used only when running in local mode | |||
--p2p-bind-ip arg | Interface for p2p (default is 0.0.0.0)9) | --p2p-bind-ip=192.168.1.5 | p2p-bind-ip=192.168.1.5 |
--p2p-bind-port arg | Port for p2p (default is 12007)10) | --p2p-bind-port=12008 | p2p-bind-port=12008 |
--p2p-external-port arg | External port for p2p11) | --p2p-external-port=5009 | p2p-external-port=5009 |
--allow-local-ip | Allow local ip add to peer list12) | --allow-local-ip | allow-local-ip=1 | yes | true |
--add-peer arg | Manually add peer to peerlist | --add-peer=66.77.88.99 | add-peer=66.77.88.99 |
--add-priority-node | Specify a list of peers to connect13) | –add-priority-node=66.77.88.99 | add-priority-node=66.77.88.99 |
--add-exclusive-node arg | Specify list of peers to connect only14) | --add-exclusive-node=66.77.88.99 | add-exclusive-node=66.77.88.99 |
--seed-node arg | Connect to a node to retrieve peer addresses | --seed-node=66.77.88.99 | seed-node=66.77.88.99 |
--hide-my-port | Do not announce yourself as a peer | --hide-my-port | hide-my-port=1 | yes | true |
iridium_walled is setup ? you can now start to query it : The Iridum Wallet Daemon RPC calls
mywallet
exists Iridium RPC Wallet will show a notification and will ask to provide a different name.