<p>I don't know the listaccounts, getaccount and setaccount commands inside the Bitcoin core 18.1.</p>

<p>I think you have used the wrong commands with the bitcoin 18.1, perhaps the equivalents are:</p>

<ul>
<li><p>listaccounts -> <a href="https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/getaddressinfo/" rel="nofollow noreferrer">getwalletinfo</a></p></li>
<li><p>setaccount -> <a href="https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/importaddress/" rel="nofollow noreferrer">importaddress</a></p></li>
</ul>

<p>But before you use this command look the official documentation <a href="https://bitcoincore.org/en/doc/" rel="nofollow noreferrer">rpc framework</a></p>

CC BY-SA 4.0
2019-09-16T12:55:48.297Z
ah I was using the documentation from https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
Jeffrey L. Roberts
CC BY-SA 4.0
2019-09-16T12:50:02.080Z
2019-09-16T15:34:31.983Z
2019-09-16T15:34:31.983Z
vincenzopalazzo
<p><code>accounts</code> method was deprecated in v0.17 and was removed since v0.18. <code>accounts</code> was replaced by <code>label</code> and it provides more flexibility as compared to before such as setting label on any address, not just receiving address. It also irons out <a href="https://github.com/bitcoin/bitcoin/issues/3816" rel="nofollow noreferrer">issues raised in the past</a>. If you are used to using accounts to mimic separate wallets, you now have an option to use separate wallets in separate wallet files in Bitcoin Core.</p>

<p>So according to the commands you are looking, you will replace them by:</p>

<ol>
<li><code>getaccount</code> with <code>getaddressinfo</code></li>
<li><code>listaccounts</code> with <code>listlabels</code></li>
<li><code>setaccount</code> with <code>setlabel</code></li>
</ol>

<p>You can see the full documentation of accounts vs labels in the <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#label-and-account-apis-for-wallet" rel="nofollow noreferrer">v0.17 release docs</a>.</p>

CC BY-SA 4.0
2019-09-16T13:13:12.490Z
2019-09-16T13:13:12.490Z
Ugam Kamat
<p>I just setup bitcoind (0.18.1) and put it in regtest mode, I am trying to work with accounts, but the account commands are not found...</p>

<p>setaccount</p>

<pre><code> jlroberts@mixerregtest:~$ bitcoin-cli -regtest setaccount 2NDCk4d7BYGztagf812gUdWqqPSMymdH4rS one
 error code: -32601
 error message:
 Method not found
</code></pre>

<p>getaccount</p>

<pre><code>jlroberts@mixerregtest:~$ bitcoin-cli -regtest getaccount one
error code: -32601
error message:
Method not found
</code></pre>

<p>listaccounts</p>

<pre><code>jlroberts@mixerregtest:~$ bitcoin-cli -regtest listaccounts
error code: -32601
error message:
Method not found
</code></pre>

<p>getblockchaininfo</p>

<pre><code>{
  "chain": "regtest",
  "blocks": 303,
  "headers": 303,
  "bestblockhash": "77d7169d013574a1254ccf472389b40c3393f41498ddc6f84b8d078c740d3da3",
  "difficulty": 4.656542373906925e-10,
  "mediantime": 1568636861,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "chainwork": "0000000000000000000000000000000000000000000000000000000000000260",
  "size_on_disk": 92175,
  "pruned": false,
  "softforks": [
    {
      "id": "bip34",
      "version": 2,
      "reject": {
        "status": false
      }
    },
    {
      "id": "bip66",
      "version": 3,
      "reject": {
        "status": false
      }
    },
    {
      "id": "bip65",
      "version": 4,
      "reject": {
        "status": false
      }
    }
  ],
  "bip9_softforks": {
    "csv": {
      "status": "locked_in",
      "startTime": 0,
      "timeout": 9223372036854775807,
      "since": 288
    },
    "segwit": {
      "status": "active",
      "startTime": -1,
      "timeout": 9223372036854775807,
      "since": 0
    }
  },
  "warnings": ""
}
</code></pre>

<p>What could I be doing wrong?</p>

CC BY-SA 4.0
2019-09-16T12:39:30.320Z
What is your bitcoin core version? also, can you try `bitcoin-cli -regtest getblockchaininfo`?
vincenzopalazzo
CC BY-SA 4.0
2019-09-16T12:42:21.577Z
using the latest, 0.18.1
Jeffrey L. Roberts
<bitcoin-cli><regtest>
Bitcoin-cli -regtest getaccount, listaccounts, setaccount, method not found
Jeffrey L. Roberts
# Bitcoin-cli -regtest getaccount, listaccounts, setaccount, method not found

(Asked by: username_0 on 2019-09-16)

I just setup bitcoind (0.18.1) and put it in regtest mode, I am trying to work with accounts, but the account commands are not found...

setaccount

```
 jlroberts@mixerregtest:~$ bitcoin-cli -regtest setaccount 2NDCk4d7BYGztagf812gUdWqqPSMymdH4rS one
 error code: -32601
 error message:
 Method not found

```

getaccount

```
jlroberts@mixerregtest:~$ bitcoin-cli -regtest getaccount one
error code: -32601
error message:
Method not found

```

listaccounts

```
jlroberts@mixerregtest:~$ bitcoin-cli -regtest listaccounts
error code: -32601
error message:
Method not found

```

getblockchaininfo

```
{
  "chain": "regtest",
  "blocks": 303,
  "headers": 303,
  "bestblockhash": "77d7169d013574a1254ccf472389b40c3393f41498ddc6f84b8d078c740d3da3",
  "difficulty": 4.656542373906925e-10,
  "mediantime": 1568636861,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "chainwork": "0000000000000000000000000000000000000000000000000000000000000260",
  "size_on_disk": 92175,
  "pruned": false,
  "softforks": [
    {
      "id": "bip34",
      "version": 2,
      "reject": {
        "status": false
      }
    },
    {
      "id": "bip66",
      "version": 3,
      "reject": {
        "status": false
      }
    },
    {
      "id": "bip65",
      "version": 4,
      "reject": {
        "status": false
      }
    }
  ],
  "bip9_softforks": {
    "csv": {
      "status": "locked_in",
      "startTime": 0,
      "timeout": 9223372036854775807,
      "since": 288
    },
    "segwit": {
      "status": "active",
      "startTime": -1,
      "timeout": 9223372036854775807,
      "since": 0
    }
  },
  "warnings": ""
}

```

What could I be doing wrong?

**Tags:** bitcoin-cli, regtest

> **Comments:**
> **username_1**: What is your bitcoin core version? also, can you try `bitcoin-cli -regtest getblockchaininfo`?  
> **username_0**: using the latest, 0.18.1  

---

## 2 answers

### Answer by username_1 on 2019-09-16. Score: 1 | Accepted answer

I don't know the listaccounts, getaccount and setaccount commands inside the Bitcoin core 18.1.

I think you have used the wrong commands with the bitcoin 18.1, perhaps the equivalents are:

* listaccounts -> [getwalletinfo](https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/getaddressinfo/)
* setaccount -> [importaddress](https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/importaddress/)

But before you use this command look the official documentation [rpc framework](https://bitcoincore.org/en/doc/)

> **Comments:**
> **username_0**: ah I was using the documentation from https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list  

---

### Answer by username_2 on 2019-09-16. Score: 2

`accounts` method was deprecated in v0.17 and was removed since v0.18. `accounts` was replaced by `label` and it provides more flexibility as compared to before such as setting label on any address, not just receiving address. It also irons out [issues raised in the past](https://github.com/bitcoin/bitcoin/issues/3816). If you are used to using accounts to mimic separate wallets, you now have an option to use separate wallets in separate wallet files in Bitcoin Core.

So according to the commands you are looking, you will replace them by:

1. `getaccount` with `getaddressinfo`
2. `listaccounts` with `listlabels`
3. `setaccount` with `setlabel`

You can see the full documentation of accounts vs labels in the [v0.17 release docs](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#label-and-account-apis-for-wallet).


---

