BlockchainCommons / Learning-Bitcoin-from-the-Command-Line

A complete course for learning Bitcoin programming and usage from the command
3.11k stars 754 forks source link

`bitcoin-cli -testnet createwallet "testwallet"` failed in v25.1 #610

Closed lshoo closed 8 months ago

lshoo commented 9 months ago

I’ve already run bitcoind -testnet, and sync latest block too.

I want to create a bitcoin wallet with bitcoin-cli, when i run bitcoin-cli -testnet createwallet "testwallet", I got an error:

error code: -32601
error message:
Method not found

when i run bitcoin-cli createwallet "testwallet", i got an error:

error: timeout on transient error: Could not connect to the server 127.0.0.1:8332

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

the local network info: bitcoin-cli -testnet getnetworkinfo

{
  "version": 250100,
  "subversion": "/Satoshi:25.1.0/",
  "protocolversion": 70016,
  "localservices": "0000000000000408",
  "localservicesnames": [
    "WITNESS",
    "NETWORK_LIMITED"
  ],
  "localrelay": false,
  "timeoffset": 1071,
  "networkactive": true,
  "connections": 10,
  "connections_in": 0,
  "connections_out": 10,
  "networks": [
    {
      "name": "ipv4",
      "limited": false,
      "reachable": true,
      "proxy": "",
      "proxy_randomize_credentials": false
    },
    {
      "name": "ipv6",
      "limited": false,
      "reachable": true,
      "proxy": "",
      "proxy_randomize_credentials": false
    },
    {
      "name": "onion",
      "limited": true,
      "reachable": false,
      "proxy": "",
      "proxy_randomize_credentials": false
    },
    {
      "name": "i2p",
      "limited": true,
      "reachable": false,
      "proxy": "",
      "proxy_randomize_credentials": false
    },
    {
      "name": "cjdns",
      "limited": true,
      "reachable": false,
      "proxy": "",
      "proxy_randomize_credentials": false
    }
  ],
  "relayfee": 0.00001000,
  "incrementalfee": 0.00001000,
  "localaddresses": [
  ],
  "warnings": "Unknown new rules activated (versionbit 28)"
}

my os: ubuntu 22.04 + wsl bitcoin version: v25.1

Do i miss something? Thanks

lshoo commented 9 months ago

bitcoin-core build options:

Build Options:
  with external callbacks = no
  with benchmarks         = no
  with tests              = yes
  with ctime tests        = no
  with coverage           = no
  with examples           = no
  module ecdh             = no
  module recovery         = yes
  module extrakeys        = yes
  module schnorrsig       = yes

  asm                     = x86_64
  ecmult window size      = 15
  ecmult gen prec. bits   = 4

  valgrind                = no
  CC                      = gcc
  CPPFLAGS                =
  SECP_CFLAGS             = -O2  -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-overlength-strings -Wall -Wno-unused-function -Wextra -Wcast-align -Wcast-align=strict -fvisibility=hidden
  CFLAGS                  = -g -O2
  LDFLAGS                 =

Options used to compile and link:
  external signer = yes
  multiprocess    = no
  with experimental syscall sandbox support = yes
  with libs       = yes
  with wallet     = yes
    with sqlite   = yes
    with bdb      = no
  with gui / qt   = no
  with zmq        = yeswa
  with test       = yes
  with fuzz binary = yes
  with bench      = yes
  with upnp       = yes
  with natpmp     = yes
  use asm         = yes
  USDT tracing    = yes
  sanitizers      =
  debug enabled   = no
  gprof enabled   = no
  werror          = no
  LTO             = no

  target os       = linux-gnu
  build os        = linux-gnu

  CC              = gcc
  CFLAGS          = -pthread -g -O2
  CPPFLAGS        =   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3  -DHAVE_BUILD_INFO -DPROVIDE_FUZZ_MAIN_FUNCTION
  CXX             = g++ -std=c++17
  CXXFLAGS        =    -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection  -Wall -Wextra -Wformat -Wformat-security -Wvla -Wredundant-decls -Wdate-time -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough  -Wno-unused-parameter -Wno-deprecated-copy    -fno-extended-identifiers -g -O2
  LDFLAGS         =  -lpthread  -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -pie
  AR              = /usr/bin/ar
  ARFLAGS         = cr

another link: https://github.com/bitcoin/bitcoin/issues/26193 https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#dependency-build-instructions says:

lshoo commented 9 months ago

the ~/.bitcoin/bitcoin.conf content is below:

alertnotify=myemailscript.sh "Alert: %s"
blocksonly=1
prune=1000
dbcache=150
maxmempool=150
user=user
password=password
# testnet=1
# rpcport=8765
# rpcbind=127.0.0.1
# sever=1
# listen=1
# bind=127.0.0.1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
lshoo commented 8 months ago

it' possible that my bitcoin core has something wrong, when i download the binary file, it works