Struggling with my testnet bitcoind setup

13 replies 409 views
maxcoinMember
Posts: 27 · Reputation: 238
#1Mar 11, 2022, 01:07 PM
Hey folks, I'm reaching out because I'm having a tough time with my bitcoind testnet and I could really use some guidance on what’s going wrong. Everything was running smoothly until I updated to the latest Bitcoin Core version v27.99.0-015ac13dcc96, and now my testnet node is throwing a bunch of errors... So, where do I start? I’m on MacOS (LTS) and I’ve got everything saved on an external hard drive. PATH=/Volumes/Crucial\ X8/bitcoin/Bitcoin Initially, I had issues with the config since my `bitcoind` won't apply the [test] section. I ended up using ./testnet3/bitcoin.conf instead. # Testnet bitcoin.conf printtoconsole=1 rpcallowip=127.0.0.1 testnet=1 [test] rpcport=18332 rpcbind=127.0.0.1 I start the node like this: bitcoind -datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3 -txindex=1 -testnet I had to copy blocks and indexes into ./testnet3/testnet3 because it seems if ./testnet3 is the datadir, it creates a nested testnet3 folder. The cookie file is in ./testnet3, but when I try launching bitcoin-cli, I get this error: $ bitcoin-cli -testnet -conf=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3/bitcoin.conf help error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/bitcoin.conf) This is a big issue for me. AND there’s a second problem: my wallets located in ./testnet3/wallets AND ./testnet3/testnet3/wallets aren’t recognized by the node: 2024-03-20T11:55:06Z Using wallet directory
7 Reply Quote Share
pauldefiMember
Posts: 33 · Reputation: 145
#2Mar 11, 2022, 03:43 PM
It doesn't work because you didn't write the command line arguments correctly. Before the RPC command you must provide -datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3 argument. To be able to access the wallet, you must first write a specific wallet file by adding the -rpcwallet=<filename> argument before the RPC command. So what you should do is and you must always provide -rpcwallet=<filename>, if the RPC request is regarding one of the wallets you own
0 Reply Quote Share
maxcoinMember
Posts: 27 · Reputation: 238
#3Mar 11, 2022, 08:14 PM
Ok thanks for your answer. It works for the RPC command. But I still don't see my wallets loaded I don't understand why: 2024-03-20T14:20:00Z Using wallet directory /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/wallets 2024-03-20T14:20:00Z init message: Verifying wallet(s)… 2024-03-20T14:20:00Z Using /16 prefix for IP bucketing 2024-03-20T14:20:00Z init message: Loading P2P addresses… 2024-03-20T14:20:00Z Loaded 6497 addresses from peers.dat  19ms $ bitcoin-cli -testnet -datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3 listwallets    [ ] Don't have any ideas about why.
3 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#4Mar 12, 2022, 12:25 AM
If you want to use /Volumes/Crucial\ X8/bitcoin/Bitcoin/testnet3 dir as your testnet dir; You should use: bitcoind --datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin --testnet instead. Since it's set to -testnet, it will automatically create a "/testnet3" folder in the specified -datadir. Wallets have to be manually loaded and set to be loaded on startup if you prefer, Use the command: $ bitcoin-cli --datadir=/Volumes/Crucial\ X8/bitcoin/Bitcoin --testnet loadwallet "walletname" true Set to "false" if you don't want it to load in the next session.
2 Reply Quote Share
maxcoinMember
Posts: 27 · Reputation: 238
#5Mar 12, 2022, 04:58 AM
Ok, thanks for the first flag! But for the loadwallets why? I never used it and everything worked well testnet as well as mainnet. Is it only the dual dash you think?
0 Reply Quote Share
maxcoinMember
Posts: 27 · Reputation: 238
#6Mar 12, 2022, 07:16 AM
It seems like the problem is the settings.json file. It is automatically generated by Bitcoin Core and in testnet no wallets are produced but in mainnet I have all wallets.
5 Reply Quote Share
pauldefiMember
Posts: 33 · Reputation: 145
#7Mar 12, 2022, 10:41 AM
Why don't you just share the debug.log? At least everyone here can figure out what the problem is, and If I may know where the settings.json (testnet) is located? Is it right in the X8/bitcoin/Bitcoin/testnet3/testnet3 folder or is it instead in the X8/bitcoin/Bitcoin/testnet3 folder?
3 Reply Quote Share
maxcoinMember
Posts: 27 · Reputation: 238
#8Mar 12, 2022, 11:14 AM
The file settings.json is replicated into /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3 and /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3. The settings.json file contains: {     "_warning_": "This file is automatically generated and updated by Bitcoin Core. Please do not edit this file while the node is running, as any changes might be ignored or overwritten." } I reproduce the last log above. Let me know if you need anything else to have more info. 2024-03-21T12:25:10Z Bitcoin Core version v27.99.0-015ac13dcc96 (release build) 2024-03-21T12:25:10Z Script verification uses 7 additional threads 2024-03-21T12:25:10Z Using the 'x86_shani(1way,2way)' SHA256 implementation 2024-03-21T12:25:10Z Using RdSeed as an additional entropy source 2024-03-21T12:25:10Z Using RdRand as an additional entropy source 2024-03-21T12:25:10Z Default data directory /Users/galois/Library/Application Support/Bitcoin 2024-03-21T12:25:10Z Using data directory /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3 2024-03-21T12:25:10Z Config file: /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/bitcoin.conf 2024-03-21T12:25:10Z Config file arg: [test] printtoconsole="1" 2024-03-21T12:25:10Z Config file arg: [test] rpcallowip="127.0.0.1" 2024-03-21T12:25:10Z Config file arg: [test] rpcbind="127.0.0.1" 2024-03-21T12:25:10Z Config file arg: [test] rpcport="18332" 2024-03-21T12:25:10Z Config file arg: [test] testnet="1" 2024-03-21T12:25:10Z Command-line arg: datadir="/Volumes/Crucial X8/bitcoin/Bitcoin/testnet3" 2024-03-21T12:25:10Z Command-line arg: testnet="" 2024-03-21T12:25:10Z Command-line arg: txindex="1" 2024-03-21T12:25:10Z Using at most 125 automatic connections (285 file descriptors available) 2024-03-21T12:25:10Z Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements 2024-03-21T12:25:10Z Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements 2024-03-21T12:25:10Z scheduler thread start 2024-03-21T12:25:10Z Binding RPC on address 127.0.0.1 port 18332 2024-03-21T12:25:10Z Using random cookie authentication. 2024-03-21T12:25:10Z Generated RPC authentication cookie /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/.cookie 2024-03-21T12:25:10Z Starting HTTP server with 4 worker threads 2024-03-21T12:25:10Z Using wallet directory /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/wallets 2024-03-21T12:25:10Z init message: Verifying wallet(s)… 2024-03-21T12:25:10Z Using /16 prefix for IP bucketing 2024-03-21T12:25:10Z init message: Loading P2P addresses… 2024-03-21T12:25:10Z Loaded 22415 addresses from peers.dat  71ms 2024-03-21T12:25:10Z init message: Loading banlist… 2024-03-21T12:25:10Z SetNetworkActive: true 2024-03-21T12:25:10Z Script verification uses 7 additional threads 2024-03-21T12:25:10Z Cache configuration: 2024-03-21T12:25:10Z * Using 2.0 MiB for block index database 2024-03-21T12:25:10Z * Using 56.0 MiB for transaction index database 2024-03-21T12:25:10Z * Using 8.0 MiB for chain state database 2024-03-21T12:25:10Z * Using 384.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space) 2024-03-21T12:25:10Z init message: Loading block index… 2024-03-21T12:25:10Z Assuming ancestors of block 000000000001323071f38f21ea5aae529ece491eadaccce506a59bcc2d968917 have valid signatures. 2024-03-21T12:25:10Z Setting nMinimumChainWork=000000000000000000000000000000000000000000000c59b14e264ba6c15db9 2024-03-21T12:25:10Z Opening LevelDB in /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/blocks/index 2024-03-21T12:25:10Z Opened LevelDB successfully 2024-03-21T12:25:10Z Using obfuscation key for /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/blocks/index: 0000000000000000 2024-03-21T12:25:18Z LoadBlockIndexDB: last block file = 243 2024-03-21T12:25:18Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=377, size=77285114, heights=2582462...2582883, time=2024-03-18...2024-03-21) 2024-03-21T12:25:18Z Checking all blk files are present... 2024-03-21T12:25:23Z Initializing chainstate Chainstate [ibd] @ height -1 (null) 2024-03-21T12:25:23Z Opening LevelDB in /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/chainstate 2024-03-21T12:25:23Z Opened LevelDB successfully 2024-03-21T12:25:23Z Using obfuscation key for /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/chainstate: 15c231132368eddf 2024-03-21T12:25:24Z Loaded best chain: hashBestChain=0000000001413dd752ecefeb8cd5d84fe3fb2fc8b5f9f6fc5ee3e927d63ee3e3 height=2582883 date=2024-03-21T09:53:33Z progress=0.999821 2024-03-21T12:25:24Z Opening LevelDB in /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/chainstate 2024-03-21T12:25:24Z Opened LevelDB successfully 2024-03-21T12:25:24Z Using obfuscation key for /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/chainstate: 15c231132368eddf 2024-03-21T12:25:24Z [Chainstate [ibd] @ height 2582883 (0000000001413dd752ecefeb8cd5d84fe3fb2fc8b5f9f6fc5ee3e927d63ee3e3)] resized coinsdb cache to 8.0 MiB 2024-03-21T12:25:24Z [Chainstate [ibd] @ height 2582883 (0000000001413dd752ecefeb8cd5d84fe3fb2fc8b5f9f6fc5ee3e927d63ee3e3)] resized coinstip cache to 384.0 MiB 2024-03-21T12:25:24Z init message: Verifying blocks… 2024-03-21T12:25:24Z Verifying last 6 blocks at level 3 2024-03-21T12:25:24Z Verification progress: 0% 2024-03-21T12:25:24Z Verification progress: 16% 2024-03-21T12:25:24Z Verification progress: 33% 2024-03-21T12:25:24Z Verification progress: 50% 2024-03-21T12:25:24Z Verification progress: 66% 2024-03-21T12:25:24Z Verification progress: 83% 2024-03-21T12:25:24Z Verification progress: 99% 2024-03-21T12:25:24Z Verification: No coin database inconsistencies in last 6 blocks (3224 transactions) 2024-03-21T12:25:24Z  block index           14582ms 2024-03-21T12:25:24Z Opening LevelDB in /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/indexes/txindex 2024-03-21T12:25:24Z Opened LevelDB successfully 2024-03-21T12:25:24Z Using obfuscation key for /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/indexes/txindex: 0000000000000000 2024-03-21T12:25:24Z Setting NODE_NETWORK on non-prune mode 2024-03-21T12:25:24Z block tree size = 2582900 2024-03-21T12:25:24Z nBestHeight = 2582883 2024-03-21T12:25:24Z initload thread start 2024-03-21T12:25:24Z txindex thread start 2024-03-21T12:25:24Z torcontrol thread start 2024-03-21T12:25:24Z txindex is enabled at height 2582883 2024-03-21T12:25:24Z txindex thread exit 2024-03-21T12:25:24Z Loading 0 mempool transactions from disk... 2024-03-21T12:25:24Z Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast 2024-03-21T12:25:24Z AddLocal([2a02:a03f:65fc:3900:d3:ed27:d3be:fce4]:18333,1) 2024-03-21T12:25:24Z initload thread exit 2024-03-21T12:25:24Z Discover: IPv6 en0: 2a02:a03f:65fc:3900:d3:ed27:d3be:fce4 2024-03-21T12:25:24Z AddLocal([2a02:a03f:65fc:3900:3128:fcaf:af7e:67bf]:18333,1) 2024-03-21T12:25:24Z Discover: IPv6 en0: 2a02:a03f:65fc:3900:3128:fcaf:af7e:67bf 2024-03-21T12:25:24Z Bound to 127.0.0.1:18334 2024-03-21T12:25:24Z Bound to [::]:18333 2024-03-21T12:25:24Z Bound to 0.0.0.0:18333 2024-03-21T12:25:24Z Loaded 2 addresses from "anchors.dat" 2024-03-21T12:25:24Z 2 block-relay-only anchors will be tried for connections. 2024-03-21T12:25:24Z init message: Starting network threads… 2024-03-21T12:25:24Z net thread start 2024-03-21T12:25:24Z msghand thread start 2024-03-21T12:25:24Z init message: Done loading 2024-03-21T12:25:24Z dnsseed thread start 2024-03-21T12:25:24Z addcon thread start 2024-03-21T12:25:24Z opencon thread start 2024-03-21T12:25:24Z Waiting 300 seconds before querying DNS seeds. 2024-03-21T12:25:26Z New block-relay-only v1 peer connected: version: 70016, blocks=2582896, peer=0 2024-03-21T12:25:26Z New block-relay-only v1 peer connected: version: 70015, blocks=2582896, peer=1 2024-03-21T12:25:26Z Leaving InitialBlockDownload (latching to false) 2024-03-21T12:25:27Z New outbound-full-relay v1 peer connected: version: 70016, blocks
1 Reply Quote Share
pauldefiMember
Posts: 33 · Reputation: 145
#9Mar 12, 2022, 12:30 PM
It looks like you don't have a wallet file that can be loaded, even the default wallet ("") is not loaded to the client. So I assume you won't find any wallet.dat in the /Volumes/Crucial X8/bitcoin/Bitcoin/testnet3/testnet3/wallets directory at all. If the wallet file doesn't exist, then you need to create a new one using createwallet command. It will automatically be loaded to the client after you execute the command.
2 Reply Quote Share
maxcoinMember
Posts: 27 · Reputation: 238
#10Mar 13, 2022, 07:10 AM
Yes there are. Each wallet.dat are into its folder: wallets/FirstTestWallet: wallet.dat wallets/FirstTestnetWallet: wallet.dat wallets/TestOPReturnWallet: wallet.dat wallets/ord: wallet.dat wallets/test_cli: wallet.dat         wallet.dat-journal And there are into testnet3/wallets and testnet3/tesnet3/wallets My point is really this. The structure seems to be the same as on the mainnet where I can load them (mainnet wallets not testnet ones)
4 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#11Mar 13, 2022, 05:44 PM
So the previous testnet setup had those wallets loaded? Anyways, have you received errors when loading wallets? If none and the setting.json file shows the wallet's name or path, then that wallet should now automatically load in the next session. It should have the a json-encoded list of loaded wallets below that warning message, like this: Since it's empty for some reason, Bitcoin Core wont automatically load any of the wallets in the "/wallets" directory . Refer only to the settings.json in the data directory that you've been using which is still in: .../Bitcoin/testnet3/tesnet3:
0 Reply Quote Share
maxcoinMember
Posts: 27 · Reputation: 238
#12Mar 13, 2022, 07:40 PM
Thank you for all your answers. What I did is come back to the original path and modify the config file to make it working. Now wallets are loaded with the flag -walletdir=.../testnet3/wallets. I still don't know why it doesn't work before but now it works. I'm still strugling with bitcoin-cli because he doesn't want to read config file in PATH. Rather than bitcoind is running correctly into this path... I hope to find the problem soon. Thanks again everyone for your answer.
0 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#13Mar 15, 2022, 10:48 PM
What are the args that you use with bitcoin-cli? Because if --datadir or --conf arg aren't provided, it'll assume that you're using the default path and the bitcoin.conf file in it. For example: if you launch bitcoind --datadir= ; bitcoin-cli should also be run with --datadir=. If you need to keep things tidy, you can just set every arg including the datadir in a dedicated bitcoin.conf file and set it to both bitcoind and bitcoin-cli with --conf= arg. Better yet, if you want to minimize the usage of args, you can even put that bitcoin.conf file in bitcoin's default datadir, then you can just launch bitcoind/bitcoin-cli without any args and it should load configurations on that bitcoin.conf file. Bitcoin.conf file article: github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md#configuration-file-path
2 Reply Quote Share
pauldefiMember
Posts: 33 · Reputation: 145
#14Mar 15, 2022, 11:58 PM
Maybe because you used -datadir=.../Bitcoin/testnet3 instead of just used -datadir=.../Bitcoin and because in both directories /Bitcoin/testnet3 and /Bitcoin/testnet3/testnet3 have the same wallets folder, then there is a possibility that a conflict have occur when the client reads the wallet file. Have you ever tried running bitcoind testnet using datadir=.../Bitcoin instead and using the same bitcoin.conf file used by the Mainnet. I guess it will work out as you want (running normally as when you run the Mainnet).
4 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics