Bitcoin-cli - ошибка: не удалось подключиться к серверу: неизвестно (код -1)

Я прочитал несколько сообщений здесь об этой ошибке, но, похоже, ни одна из них не решает мою проблему. Я пытаюсь использовать Altcoin-cli для своей альтернативной монеты (которая является точным клоном источника биткойнов), используя сгенерированный демон Altcoind и Altcoin-cli.

Я знаю, что это точная копия биткойна, потому что я сам разветвил его (в учебных целях), поэтому ошибка не вызвана тем, что я нарушил какой-то код. Вот шаги, которые я делаю:

1) В одном терминале запускаюAltcoind -daemon -reindex

2) В моем Altcoin.conf отлично у меня есть это:

rpcuser=barney
rpcpassword=12345
rpcport=22777
listen=1
server=1
dbcache=50
daemon=1
testnet=0
maxuploadtarget=200
txindex=1

3) Затем я бегу Altcoin-cli generate 1 -1, пытаясь добыть блок. Вот где я получаю ошибку:

error: couldn't connect to server: unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)

Кроме того, когда я запускаю cliкоманду, эта строка появляется вdebug.log

keypool reserve 2

Я также добавлю свой дамп debug.log ниже, но он выглядит нормально. Ошибки connection refused— это монета, пытающаяся подключиться к начальным узлам, которых еще не существует.

Дамп DEBUG.LOG

2018-01-04 07:10:51 Bitcoin version v0.1.0.0-0b9d033-dirty
2018-01-04 07:10:51 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-01-04 07:10:51 Assuming ancestors of block 00000000000000000013176bf8d7dfeab4e1db31dc93bc311b436e82ab226b90 have valid signatures.
2018-01-04 07:10:51 Default data directory /home/veggie/.Teggie
2018-01-04 07:10:51 Using data directory /home/veggie/.Teggie
2018-01-04 07:10:51 Using config file /home/veggie/.Teggie/Teggie.conf
2018-01-04 07:10:51 Using at most 125 automatic connections (1024 file descriptors available)
2018-01-04 07:10:51 Using 32 MiB out of 32 requested for signature cache, able to store 1048576 elements
2018-01-04 07:10:51 Using 0 threads for script verification
2018-01-04 07:10:51 Binding RPC on address 0.0.0.0 port 22777 failed.
2018-01-04 07:10:51 HTTP: creating work queue of depth 16
2018-01-04 07:10:51 Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation.
2018-01-04 07:10:51 HTTP: starting 4 worker threads
2018-01-04 07:10:51 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-01-04 07:10:51 Using wallet wallet.dat
2018-01-04 07:10:51 init message: Verifying wallet...
2018-01-04 07:10:51 CDBEnv::Open: LogDir=/home/veggie/.Teggie/database ErrorFile=/home/veggie/.Teggie/db.log
2018-01-04 07:10:51 scheduler thread start
2018-01-04 07:10:51 Bound to [::]:22822
2018-01-04 07:10:51 Bound to 0.0.0.0:22822
2018-01-04 07:10:51 Cache configuration:
2018-01-04 07:10:51 * Using 6.2MiB for block index database
2018-01-04 07:10:51 * Using 8.0MiB for chain state database
2018-01-04 07:10:51 * Using 35.8MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-01-04 07:10:51 init message: Loading block index...
2018-01-04 07:10:51 Wiping LevelDB in /home/veggie/.Teggie/blocks/index
2018-01-04 07:10:51 Opening LevelDB in /home/veggie/.Teggie/blocks/index
2018-01-04 07:10:51 Opened LevelDB successfully
2018-01-04 07:10:51 Using obfuscation key for /home/veggie/.Teggie/blocks/index: 0000000000000000
2018-01-04 07:10:51 Wiping LevelDB in /home/veggie/.Teggie/chainstate
2018-01-04 07:10:51 Opening LevelDB in /home/veggie/.Teggie/chainstate
2018-01-04 07:10:51 Opened LevelDB successfully
2018-01-04 07:10:51 Wrote new obfuscate key for /home/veggie/.Teggie/chainstate: 2e49fc905edaf50c
2018-01-04 07:10:51 Using obfuscation key for /home/veggie/.Teggie/chainstate: 2e49fc905edaf50c
2018-01-04 07:10:51 Initializing databases...
2018-01-04 07:10:51 init message: Verifying blocks...
2018-01-04 07:10:51  block index              15ms
2018-01-04 07:10:51 CTxMemPool::ReadFeeEstimates(): unable to read policy estimator data (non-fatal)
2018-01-04 07:10:51 init message: Loading wallet...
2018-01-04 07:10:51 nFileVersion = 10000
2018-01-04 07:10:51 Keys: 103 plaintext, 0 encrypted, 103 w/ metadata, 103 total
2018-01-04 07:10:51  wallet                    6ms
2018-01-04 07:10:51 setKeyPool.size() = 101
2018-01-04 07:10:51 mapWallet.size() = 0
2018-01-04 07:10:51 mapAddressBook.size() = 1
2018-01-04 07:10:51 Reindexing block file blk00000.dat...
2018-01-04 07:10:51 UpdateTip: new best=0000794e30ec87650feebfdc5c39c51927ebb8407129ed5e93375dd825e50380 height=0 version=0x00000001 log2_work=17 tx=1 date='2017-12-06 14:20:46' progress=1.000000 cache=0.0MiB(0tx)
2018-01-04 07:10:51 mapBlockIndex.size() = 1
2018-01-04 07:10:51 nBestHeight = 0
2018-01-04 07:10:51 init message: Loading addresses...
2018-01-04 07:10:51 Loaded 2 addresses from peers.dat  1ms
2018-01-04 07:10:51 init message: Loading banlist...
2018-01-04 07:10:51 init message: Starting network threads...
2018-01-04 07:10:51 init message: Done loading
2018-01-04 07:10:51 msghand thread start
2018-01-04 07:10:51 opencon thread start
2018-01-04 07:10:51 addcon thread start
2018-01-04 07:10:51 dnsseed thread start
2018-01-04 07:10:51 net thread start
2018-01-04 07:10:51 torcontrol thread start
2018-01-04 07:10:51 Loaded 1 blocks from external file in 210ms
2018-01-04 07:10:51 Reindexing finished
2018-01-04 07:10:51 Imported mempool transactions from disk: 0 successes, 0 failed, 0 expired
2018-01-04 07:10:53 connect() to 207.246.105.211:22822 failed after select(): Connection refused (111)
2018-01-04 07:10:55 connect() to 45.63.111.147:22822 failed after select(): Connection refused (111)
2018-01-04 07:10:58 connect() to 45.63.111.147:22822 failed after select(): Connection refused (111)
2018-01-04 07:11:00 connect() to 207.246.105.211:22822 failed after select(): Connection refused (111)

Ответы (1)

Вы подтвердили, что ваш пользователь, пытающийся использовать bitcoin-cli, имеет права собственности на каталог .bitcoin? Вот что доставляло мне неприятности. Чтобы исправить, я побежал:

sudo chown username:username /directory/location/of/.bitcoin