Author

Topic: Please help with Bitcoin Core CLI (Read 310 times)

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
December 23, 2023, 01:12:18 AM
#20
But it could be cooler to just have the config file to setup and not re write a long cli args to put each time.

So, it's not necessary but cool for the next ^^
In that case, you should put your bitcoin.conf file inside bitcoin's default data directory, put the datadir for mainnet and testnet in that file and remove the conf files from the separate custom datadirs.
In MacOS, it should be in: ~/Library/Application Support/Bitcoin/bitcoin.conf
That way, bitcoind will automatically load it without needing you to specify the paths. (the GUI will still use the one set in the Welcome Screen though)

Or set the --datadir in the command line arg for testnet and mainnet and remove the --conf and --walletdir args.
Then put a bitcoin.conf file for testnet (still with [test]) and mainnet in those separate datadirs.

In both cases, you do not need to set blocksdir, walletsdir, settings lines in your bitcoin.conf file or command line.
Because those aren't necessary if you intended to save the settings.json, blocks folder, wallets folder inside the custom datadir which is already done by default.



Also, you may consider fixing the paths in testnet (if it's not intentional) because-
in testnet, it'll automatically create "testnet3" directory in the specified 'blocksdir' and 'datadir'.

For example:
Quote
datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3
blocksdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/blocks
These configurations will result with this folder structure:
Folder where the datadir will be saved: "......./Bitcoin/testnet3/testnet3"
Folder where the blk and rev files will be stored: "......./Bitcoin/testnet3/blocks/testnet3/blocks"

If the intention is to save the block in the testnet3 directory and the datadir is set, you can remove it from the config/args.
Lastly, if the datadir is to be set in "......./Bitcoin/testnet3", the datadir for testnet should be: datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin
newbie
Activity: 27
Merit: 1
December 22, 2023, 01:08:09 PM
#19
Ok ! With command line args it works.

But it could be cooler to just have the config file to setup and not re write a long cli args to put each time.

So, it's not necessary but cool for the next ^^
newbie
Activity: 27
Merit: 1
December 22, 2023, 01:01:56 PM
#18
The absolute path doesn't work with error :
./bin/bitcoind -conf=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/bitcoin.conf -walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/wallets -txindex=1 -testnet

Assertion failed: (base.is_absolute()), function AbsPathJoin, file fs.cpp, line 37.
[1]    28624 abort      ./bin/bitcoind   -txindex=1 -testnet


A problem is also that in my main config we can see that I set /Volumes/Crucial\ X8/bitcoin/Bitcoin/wallets/main as walletdir path but when I run bitcoind, it's still set with walletdir : /Volumes/Crucial\ X8/bitcoin/Bitcoin/wallets and so it doesn't find any wallet.

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
December 21, 2023, 11:53:59 PM
#17
Also, when I'm trying to run bitcoind from the fodler testnet3 with :
./bin/bitcoind -conf=bitcoin.conf -walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/wallets -txindex=1 -testnet

I have this in the launch :

2023-12-21T16:07:06Z Config file: /Volumes/Crucial X8/bitcoin/Bitcoin/bitcoin.conf
2023-12-21T16:07:06Z Config file arg: blocksdir="/Volumes/Crucial X8/bitcoin/Bitcoin/blocks"
2023-12-21T16:07:06Z Config file arg: conf="/Volumes/Crucial X8/bitcoin/Bitcoin/bitcoin.conf"
2023-12-21T16:07:06Z Config file arg: datadir="/Volumes/Crucial X8/bitcoin/Bitcoin"
2023-12-21T16:07:06Z Config file arg: settings="/Volumes/Crucial X8/bitcoin/Bitcoin/settings.json"
2023-12-21T16:07:06Z Config file arg: walletdir="/Volumes/Crucial X8/bitcoin/Bitcoin/wallets"


Which is not what is specified in the bitcoin.conf file into testnet3 :
The "Config file arg" lines for testnet should be listed as "Config file arg: [test]" instead.
Those are most likely for your mainnet configurations set somewhere else which will show regardless of the chain you indicated in the command line.

Since your bitcoin.conf file isn't in the default data directory, specify its absolute path in --conf command line option.
newbie
Activity: 27
Merit: 1
December 21, 2023, 11:09:19 AM
#16
Hello,

I have a weird issue with my configuration. I tried many things and nothing really works well.

For now if the following can works it could be good.

Context : I've got MacOS last version and my hard drive 1Tb connected. I'm running everything from the path '/Volumes/Crucial X8/bitcoin/Bitcoin'.

Objectives : Run my node is testnet and in mainnet with different configs properly with `bitcoind`. Everything related to the node should be into the hard drive (obviously, I don't have enough space on my computer haha).

Config file :
# Listen for connections on this port (default: 8333):
port=8332

# Network-related settings:
# Bind to given address and whitelist peers connecting to it:
bind=127.0.0.1

# JSON-RPC options:
# Server for JSON-RPC connections (default: 127.0.0.1)
#rpcbind=127.0.0.1  
# Username for JSON-RPC connections
#rpcuser=rpc_bitcoin
# Password for JSON-RPC connections
#rpcpassword=rpc_bitcoin

# Miscellaneous options:
# Size of the "memory pool" for transactions awaiting confirmation (default: 300MB)
#maxmempool=300

# File containing masternodes IPs and rewards private key
#masternode=

# Reduce storage requirements by only storing most recent N blocks (default: 288)
#prune=550

[main]
datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin
blocksdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/blocks
walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/wallets/main
conf=bitcoin.conf
spendzeroconfchange=1
txindex=1
rpcworkqueue=128
settings=/Volumes/Crucial\ X8/bitcoin/Bitcoin/settings.json

[test]
testnet=1
datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3
blocksdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/blocks
walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/wallets/test
addnode=testnet.blixtwallet.com
settings=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/settings.json


Folder structure :
| - bitcoin.conf
|
| bin -- bitcoind
|
| blocks -- | blocks
               -- | index
               -- | tesnet3 -- blocks
|
| indexes -- | txindex
|
| wallets -- | main -- MyMainWallets
            -- | test -- MyTestsWallets
|
| testnet3 -- bitcoin.conf (for some tests but bitcoind couldn't read it. I don't know why cause all rights are openned)
               -- | bin -- bitcoind and others
               -- | blocks -- *.dat
                            -- | index -- *.log
               -- | wallets -- MyTestsWallets
               -- | indexes -- | txindex


Command run :
- For mainnet : ./bin/bitcoind -conf=bitcoin.conf -txindex=1. With this command the problem now is : Using wallet directory /Volumes/Crucial X8/bitcoin/Bitcoin/wallets which should be with wallets/main for mainnet.
- For testnet : The same with the flag -testnet. And here I got the error : Error: Config setting for -walletdir only applied on test network when in [test] section. But as we can see in config file it's well setup for each network. And the fact that mainnet doesn't read properly the wallet dir path seems to show a problem.

I don't know how can I solve this misleading configuration. I tried to do everything in testnet3 folder, but I already built a part of the testnet in the main folder. So I'm wondering if it's possible to make work my configuration.

Maybe you can have some ideas. I don't know.

I can move it if it's not in the right place ^^



Also, when I'm trying to run bitcoind from the fodler testnet3 with :
./bin/bitcoind -conf=bitcoin.conf -walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/wallets -txindex=1 -testnet

I have this in the launch :

2023-12-21T16:07:06Z Config file: /Volumes/Crucial X8/bitcoin/Bitcoin/bitcoin.conf
2023-12-21T16:07:06Z Config file arg: blocksdir="/Volumes/Crucial X8/bitcoin/Bitcoin/blocks"
2023-12-21T16:07:06Z Config file arg: conf="/Volumes/Crucial X8/bitcoin/Bitcoin/bitcoin.conf"
2023-12-21T16:07:06Z Config file arg: datadir="/Volumes/Crucial X8/bitcoin/Bitcoin"
2023-12-21T16:07:06Z Config file arg: settings="/Volumes/Crucial X8/bitcoin/Bitcoin/settings.json"
2023-12-21T16:07:06Z Config file arg: walletdir="/Volumes/Crucial X8/bitcoin/Bitcoin/wallets"


Which is not what is specified in the bitcoin.conf file into testnet3 :

[test]
conf=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/bitcoin.conf
datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3
blocksdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/blocks
walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/wallets
addnode=testnet.blixtwallet.com
settings=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/settings.json


I don't understand why the node is not syncing on the right conf file...
newbie
Activity: 27
Merit: 1
December 21, 2023, 10:54:21 AM
#15
Hello,

I have a weird issue with my configuration. I tried many things and nothing really works well.

For now if the following can works it could be good.

Context : I've got MacOS last version and my hard drive 1Tb connected. I'm running everything from the path '/Volumes/Crucial X8/bitcoin/Bitcoin'.

Objectives : Run my node is testnet and in mainnet with different configs properly with `bitcoind`. Everything related to the node should be into the hard drive (obviously, I don't have enough space on my computer haha).

Config file :
# Listen for connections on this port (default: 8333):
port=8332

# Network-related settings:
# Bind to given address and whitelist peers connecting to it:
bind=127.0.0.1

# JSON-RPC options:
# Server for JSON-RPC connections (default: 127.0.0.1)
#rpcbind=127.0.0.1  
# Username for JSON-RPC connections
#rpcuser=rpc_bitcoin
# Password for JSON-RPC connections
#rpcpassword=rpc_bitcoin

# Miscellaneous options:
# Size of the "memory pool" for transactions awaiting confirmation (default: 300MB)
#maxmempool=300

# File containing masternodes IPs and rewards private key
#masternode=

# Reduce storage requirements by only storing most recent N blocks (default: 288)
#prune=550

[main]
datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin
blocksdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/blocks
walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/wallets/main
conf=bitcoin.conf
spendzeroconfchange=1
txindex=1
rpcworkqueue=128
settings=/Volumes/Crucial\ X8/bitcoin/Bitcoin/settings.json

[test]
testnet=1
datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3
blocksdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/blocks
walletdir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/wallets/test
addnode=testnet.blixtwallet.com
settings=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/settings.json


Folder structure :
| - bitcoin.conf
|
| bin -- bitcoind
|
| blocks -- | blocks
               -- | index
               -- | tesnet3 -- blocks
|
| indexes -- | txindex
|
| wallets -- | main -- MyMainWallets
            -- | test -- MyTestsWallets
|
| testnet3 -- bitcoin.conf (for some tests but bitcoind couldn't read it. I don't know why cause all rights are openned)
               -- | bin -- bitcoind and others
               -- | blocks -- *.dat
                            -- | index -- *.log
               -- | wallets -- MyTestsWallets
               -- | indexes -- | txindex


Command run :
- For mainnet : ./bin/bitcoind -conf=bitcoin.conf -txindex=1. With this command the problem now is : Using wallet directory /Volumes/Crucial X8/bitcoin/Bitcoin/wallets which should be with wallets/main for mainnet.
- For testnet : The same with the flag -testnet. And here I got the error : Error: Config setting for -walletdir only applied on test network when in [test] section. But as we can see in config file it's well setup for each network. And the fact that mainnet doesn't read properly the wallet dir path seems to show a problem.

I don't know how can I solve this misleading configuration. I tried to do everything in testnet3 folder, but I already built a part of the testnet in the main folder. So I'm wondering if it's possible to make work my configuration.

Maybe you can have some ideas. I don't know.

I can move it if it's not in the right place ^^
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
July 04, 2023, 02:44:04 PM
#14
Just a small input. I'm not sure I understood it all correctly but you just said your attic is hot as f... My advice is in that case, don't put your nodes there (Bitcoin or LN), mainly if you're using SBCs like Raspberry or other similar devices. When they are verifying the blockchain, they can heat up a bit and cause some problems!

I don't plan to put any node in the attic. I was talking about running ethernet cables through my attic to the different rooms in the house and how hot it will be to do that now during the summer months. Really, I guess it would be best to do it now before it is the absolute hottest days or I will have months of ethernet cables laying in my hallways.

Oh ok. In that case only make sure there are no hungry mice or other rodents that may affect your cables and all of a suden you find you node offline without having a clue of what is going on! Cheesy
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
July 04, 2023, 03:40:34 AM
#13
Just a small input. I'm not sure I understood it all correctly but you just said your attic is hot as f... My advice is in that case, don't put your nodes there (Bitcoin or LN), mainly if you're using SBCs like Raspberry or other similar devices. When they are verifying the blockchain, they can heat up a bit and cause some problems!

I don't plan to put any node in the attic. I was talking about running ethernet cables through my attic to the different rooms in the house and how hot it will be to do that now during the summer months. Really, I guess it would be best to do it now before it is the absolute hottest days or I will have months of ethernet cables laying in my hallways.

OK, since its a Windows PC and you're not planning to expose your JSON-RPC interface across the network - which would open a new can of worms with the Firewall program - you actually don't need to pass any RPC user/password options at all to the daemon or CLI, because by default, bitcoind creates a cookie file with a temporary username and password, which is automatically found by bitcoin-cli before it talks to the daemon. Which means you can simply run bitcoin-cli stop without any additional arguments or configuration.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
July 03, 2023, 05:01:05 PM
#12
Since you're issuing the CLI commands as a different user than the "user" (system) running the process, it'll look for the credentials of the user in the user's home directory.  The same thing happens on Linux, it's not just a Windows thing.  On my Linux servers I run the bitdoind process using a system user with no home directory, password, or the ability to log into the system.  Safer that way.

Also, it could be that your bitcoin daemon isn't reading any configuration settings, it's just running on defaults.  When starting bitcoind, did you include any command line options?  Did you specify a configuration file?

When running a daemon it's more practical to have two configuration files, one for the daemon to start all the services you want the daemon to run, and another in your home path that specifies the user's preferred settings, like wallet location and whatnot.  To me it sounds like the daemon isn't configured with rpcauth.

A practical way to set the authorization string it by using rpcauth.py, you can find it in the bitcoin master tree under share/rpcauth/.



So, if you were to use the example in the image above, you would add the following string to the daemon's bitcoin.conf file:

Code:
rpcauth=username:c02d625224be734104c3515c3fd274e7$f3a29a147dc1322a99bf820328d9918fc5bc626598049b12a0d654f860e952c8

And in the user's bitcoin.conf file you would add:

Code:
rpcconnect=127.0.0.1:8332
rpcuser=username
rpcpassword=R7eq4jQVYcFvbRUJEGwPX7QOfRBwtp-8cPMdOiF0944=

newbie
Activity: 13
Merit: 2
July 03, 2023, 05:09:15 AM
#11
Just a small input. I'm not sure I understood it all correctly but you just said your attic is hot as f... My advice is in that case, don't put your nodes there (Bitcoin or LN), mainly if you're using SBCs like Raspberry or other similar devices. When they are verifying the blockchain, they can heat up a bit and cause some problems!

I don't plan to put any node in the attic. I was talking about running ethernet cables through my attic to the different rooms in the house and how hot it will be to do that now during the summer months. Really, I guess it would be best to do it now before it is the absolute hottest days or I will have months of ethernet cables laying in my hallways.
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
July 02, 2023, 06:09:40 AM
#10
Easy fix: get a cable, it beats Wifi any time.

I have recently connected a ethernet cable, but I now have a ethernet wire though my hallways..... I should run cable through the entire house one of these weekends soon... should have done this over the winter when it wasn't so hot in the attic.

During that time, are you using the GUI or bitcoind?
Because the latter wont use the GUI's setting and will use the default data directory's config file by default.

Anyways, since you've included those in your config, try adding  --rpcuser=bitcoin and --rpcpassword=yourpassword in your command
since there seem to be a problem in the cookie file which should've been created automatically.

I used GUI to access and edit the config file and the command was me trying to control the GUI through Windows PowerShell.

Although I have deleted everything on my external. Everything started to mess up and I became frustrated and reformatted the external hd so i could return it. figured that the files were corrupted anyways... at least that was my thinking atm I was frustrated.

I will have a new ssd soon and after the setting everything back up and redownloading the blockchain, I will post brand new ways that I screw everything up

Just a small input. I'm not sure I understood it all correctly but you just said your attic is hot as f... My advice is in that case, don't put your nodes there (Bitcoin or LN), mainly if you're using SBCs like Raspberry or other similar devices. When they are verifying the blockchain, they can heat up a bit and cause some problems!
newbie
Activity: 13
Merit: 2
June 27, 2023, 07:57:03 AM
#9
Easy fix: get a cable, it beats Wifi any time.

I have recently connected a ethernet cable, but I now have a ethernet wire though my hallways..... I should run cable through the entire house one of these weekends soon... should have done this over the winter when it wasn't so hot in the attic.

During that time, are you using the GUI or bitcoind?
Because the latter wont use the GUI's setting and will use the default data directory's config file by default.

Anyways, since you've included those in your config, try adding  --rpcuser=bitcoin and --rpcpassword=yourpassword in your command
since there seem to be a problem in the cookie file which should've been created automatically.

I used GUI to access and edit the config file and the command was me trying to control the GUI through Windows PowerShell.

Although I have deleted everything on my external. Everything started to mess up and I became frustrated and reformatted the external hd so i could return it. figured that the files were corrupted anyways... at least that was my thinking atm I was frustrated.

I will have a new ssd soon and after the setting everything back up and redownloading the blockchain, I will post brand new ways that I screw everything up
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
June 26, 2023, 02:02:24 AM
#8
I have already created a bitcoin.conf file using Bitcoin Core GUI on my external HD following the instructions from https://sparrowwallet.com/docs/connect-node.html
-snip-
I just don't know why it tries to find it in C:\Users\john\AppData\Roaming\Bitcoin\bitcoin.conf
During that time, are you using the GUI or bitcoind?
Because the latter wont use the GUI's setting and will use the default data directory's config file by default.

Anyways, since you've included those in your config, try adding  --rpcuser=bitcoin and --rpcpassword=yourpassword in your command
since there seem to be a problem in the cookie file which should've been created automatically.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
June 25, 2023, 11:42:56 PM
#7
What happens is I lose internet connection because of my internet browser, usually from a website that is too much. I don't know if it is a wifi signal thing or if my network adapter needs to be replaced
Easy fix: get a cable, it beats Wifi any time.
newbie
Activity: 13
Merit: 2
June 25, 2023, 02:01:12 PM
#6
During the initial block download, I get that. But once it's synced, Bitcoin Core takes at most a few CPU seconds every 10 minutes (on average). The only real reason I see to stop it, is if you need the RAM for something else.
You're right, I misspoke. What happens is I lose internet connection because of my internet browser, usually from a website that is too much. I don't know if it is a wifi signal thing or if my network adapter needs to be replaced, but I guess that is the next problem I need to tackle. probably for another website forum though. idk

thanks for bringing that to my attention
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
June 25, 2023, 11:09:38 AM
#5
From my other post, I was having trouble with shutting down Bitcoin Core all the way. In order to make sure that it was shut down, it was suggested to me to use CLI to make certain.
The CLI isn't going to help you if it's caused by a power problem on the drive.

Quote
Also, I use the same computer to run other labor intensive programs and I need to stop Bitcoin Core in order for things to run more smoothly.
During the initial block download, I get that. But once it's synced, Bitcoin Core takes at most a few CPU seconds every 10 minutes (on average). The only real reason I see to stop it, is if you need the RAM for something else.

Quote
But you are right, I do try to make things more difficult than they should lol.
It is the most fun way that way Smiley
newbie
Activity: 13
Merit: 2
June 25, 2023, 10:20:13 AM
#4
You should instead create the bitcoin.conf file inside your custom data directory.

Create a "bitcoin.conf" file inside your custom data directory and write server=1 on it.
Restart Bitcoin Core, then try using bitcoin-cli commands again.

Take note that it should be "bitcoin.conf" not "bitcoin.conf.txt" so enable Window Explorer's "View->File name extensions" to see its actual extension.

I have already created a bitcoin.conf file using Bitcoin Core GUI on my external HD following the instructions from https://sparrowwallet.com/docs/connect-node.html

server=1
rpcuser=bitcoin
rpcpassword=yourpassword

[main]
rpcbind=127.0.0.1
rpcbind=192.168.0.10
rpcallowip=127.0.0.1
rpcallowip=192.168.0.0/16

I just don't know why it tries to find it in C:\Users\john\AppData\Roaming\Bitcoin\bitcoin.conf

I want to do things like start/stop Bitcoin Core with CLI.
Allow me to quote from your other topic:
I want to contribute to the network and I read that running a full node is how I can do that.
Somehow I get the feeling you're making it unnecessarily difficult on yourself. If you're using a Windows computer, and that's me assuming you use a desktop, why would you want to use the CLI? I get it if you'd use a server, but that doesn't sound very likely considering you're using an external hard drive.
Just start Bitcoin Core, and keep it on Smiley

From my other post, I was having trouble with shutting down Bitcoin Core all the way. In order to make sure that it was shut down, it was suggested to me to use CLI to make certain. So I am trying to learn how to do so I can start learning to fix my own problems.

Also, I use the same computer to run other labor intensive programs and I need to stop Bitcoin Core in order for things to run more smoothly. Once, I have an upgraded computer, then I might be able to keep it running all the time.

But you are right, I do try to make things more difficult than they should lol.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
June 25, 2023, 07:32:48 AM
#3
I want to do things like start/stop Bitcoin Core with CLI.
Allow me to quote from your other topic:
I want to contribute to the network and I read that running a full node is how I can do that.
Somehow I get the feeling you're making it unnecessarily difficult on yourself. If you're using a Windows computer, and that's me assuming you use a desktop, why would you want to use the CLI? I get it if you'd use a server, but that doesn't sound very likely considering you're using an external hard drive.
Just start Bitcoin Core, and keep it on Smiley
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
June 25, 2023, 07:26:49 AM
#2
for example, to stop Bitcoin Core
C:\Program Files\Bitcoin\daemon\bitcoin-cli stop
but I get the message that "'C:\Program' is not recognized as an internal or external command..."
In your example, you've indicated the absolute path but it has a whitespace so command prompt took "C:\Program" (before the whitespace) as command.
In that case, enclose the absolute path with quotation marks;
For example, the correct command should be: "C:\Program Files\Bitcoin\daemon\bitcoin-cli" stop

But I recommend you to always use 'change directory' so that you can use bitcoin-cli without specifying the absolute path in every command.

-snip- and then enter "bitcoin-cli stop" in which i receive the message "error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (C:\Users\john\AppData\Roaming\Bitcoin\bitcoin.conf)"
Create a "bitcoin.conf" file inside your custom data directory and write server=1 on it.
Restart Bitcoin Core, then try using bitcoin-cli commands again.

Take note that it should be "bitcoin.conf" not "bitcoin.conf.txt" so enable Window Explorer's "View->File name extensions" to see its actual extension.
newbie
Activity: 13
Merit: 2
June 25, 2023, 06:32:59 AM
#1
Bitcoin Client Software and Version Number: Bitcoin Core v25.0.0
Operating System: Windows 11
System Hardware Specs:
Processor - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz   2.80 GHz
RAM - 16.0 GB
Toshiba 1 TB external hard drive

Description of Problem:

I am trying to use CLI with Bitcoin Core.

I want to do things like start/stop Bitcoin Core with CLI.

I am using the info from https://bitcoin.org/en/full-node#windows-10 to figure out the commands but I am running into problems possibly from a lack of knowledge of how to use Windows command prompt.

for example, to stop Bitcoin Core
C:\Program Files\Bitcoin\daemon\bitcoin-cli stop
but I get the message that "'C:\Program' is not recognized as an internal or external command..."

I figure that I maybe need to change the directory so I entered "cd C:\Program Files\Bitcoin\daemon\" and then enter "bitcoin-cli stop" in which i receive the message "error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (C:\Users\john\AppData\Roaming\Bitcoin\bitcoin.conf)"

I do know that my config file is not in C:\Users\john\AppData\Roaming\Bitcoin\. That folder doesn't even exist. I have my data all on an external hard drive.

I am at a lost on what I need to do from here in order to use Bitcoin Core CLI.

Any Related Addresses: n/a
Any Related Transaction IDs: n/a
Screenshot of the problem: n/a
Log Files from the Bitcoin Client: n/a
Jump to: