exchange-serverblockchainbitcoincryptocurrencybitcoind

Bitcoin how to create a new account via RPC


I am running docker container with bitcoin node and want to create a new account, but I can't find good documentation about bitcoin RPC methods.


Solution

  • To create account using RPC run:

    curl -H "Content-Type: application/json" --data '{"method": "getnewaddress"}' rpcuser:rpcpassword@ip:port 
    

    Or, you can specify account and get this address assigned to new address:

    curl -H "Content-Type: application/json" --data '{"method": "getnewaddress", "params": ["billy"]}' rpcuser:rpcpassword@ip:port
    

    I've found it here - Bitcoin cryptocurrency node administration guide

    Also, if you running docker container don't forget to publish container's port (like docker run -p "127.0.0.1:8332:8332")