Listing all addresses in a wallet from the command line (or debug dialog)

The method getaddressbyaccount <account> works fine when you are passing it a single account parameter. However, it does not appear to accept an array (e.g., getaddressesbyaccount ["","account2"], using either [] or {}).

Other than writing a script that will use getaccounts to create an array and then loop through that array with getaddressesbyaccount, am I missing a simple way of getting all addresses that exist within a wallet?

I tried getaddressesbyaccount * and getaddressesbyaccount "*" but those fail.

Same here, I was looking for this a couple of days ago. Ended up using ppcoind getaccountaddress 0, getaccountaddress 1, getaccountaddress 2, etc.

But the reason behind it is that adresses are generated on the fly, try:

ppcoind getaccountaddress 100000000

I think we’re looking for different outcomes. In my use case I’d like to iterate through an array of the wallet’s current accounts and return a list of the addresses associated with each. There’s no easy way (that I know of) from the command line to generate a list like you see under the “Receive” tab in the GUI.

In the example you gave it looks like you’re generating a set of new addresses for a given account. Am I reading into the example correctly?

The ‘listreceivedbyaddress’ method lists the addresses of the wallet that received coins and indicates the account for each address.
It might be what you’re looking for…

If you want to have the addresses that didn’t receive coins as well, you can use ‘listreceivedbyaddress 0 true’, but it will show all the addresses, even those in the address book.

You might get more knowledgeable people to answer the question if you ask in bitcointalk support forums since it’s a bitcoincore question.