Биткойн JSON RPC не работает на удаленном IP

сначала я не могу заставить его работать, я смог использовать bitcoind в своем vps (локально), но когда я добавил rpcbind и allowip в свой bitcoin.conf, я даже не могу использовать bitcoin-cli, это дает мне эту ошибку: ошибка: Ошибка авторизации: неверно rpcuser или rpcpassword, когда я использую тот же пользовательский пароль, что и в моей конфигурации

curl дает мне пустой ответ на порт "8333" и отказ в соединении на порту 8332

вот мой bitcoin.conf [без ip и пользователя/пароля]

(я использовал это раньше, когда он работал локально)

listen=1
server=1
rpcport=8332
prune=600
maxconnections=12
maxuploadtarget=20
rpcuser=XXXXX
rpcpassword=XXXXX
daemon=1
keypool=10000

теперь Когда я пытаюсь заставить его работать на моем удаленном сервере с этой конфигурацией

# Generated by https://jlopp.github.io/bitcoin-core-config-generator/

# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf
server=1
# [core]
# Maintain a full transaction index, used by the getrawtransaction rpc call.
# Run in the background as a daemon and accept commands.
daemon=1
# Reduce storage requirements by only storing most recent N MiB of block. This mode is incompatible with -txindex and -rescan. WARNING: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, greater than 550 = automatically prune blocks to stay under target size in MiB).
prune=600

# [rpc]
# Accept public REST requests.
rest=1
# Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times. (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)
rpcbind=~MY REMOTE VPS PUBLIC IP~
# Username and hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. RPC clients connect using rpcuser=<USERNAME>/rpcpassword=<PASSWORD> arguments. You can generate this value with the ./share/rpcauth/rpcauth.py script in the Bitcoin Core repository. This option can be specified multiple times.
rpcuser=XXXXXXX
rpcpassword=XXXXXXXX
# Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times.
rpcallowip=~MY HOST IP~
# Number of seconds after which an uncompleted RPC call will time out
rpcservertimeout=60

# [wallet]
# Legacy
addresstype=legacy
# Legacy
changetype=legacy
# Set key pool size to <n>. Recommended to use a large number for high volume non-HD wallets.
keypool=10000
# If paytxfee is not set, include enough fee so that transactions should confirm within <n> blocks
txconfirmtarget=3
# Broadcast transactions created by the wallet.
walletbroadcast=0
# Run a thread to flush wallet periodically.
flushwallet=0


# [Sections]
# Most options automatically apply to mainnet, testnet, and regtest networks.
# If you want to confine an option to just one network, you should add it in the relevant section.
# EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
# only apply to mainnet unless they appear in the appropriate section below.

maxconnections=12
maxuploadtarget=20

# Options only for mainnet
[main]

# Options only for testnet
[test]

# Options only for regtest
[regtest]

Ответы (1)

Попробуйте разрешить вызовы RPC для определенного IP-адреса или внести в белый список все IP-адреса, например:

rpcallowip=0.0.0.0/0

Плюс попробуйте проверить debug.log, появилось ли соединение на демоне, о котором он должен сообщить. Если нет, возможно, проблемы с брандмауэром в самой системе.

просто для подтверждения, должен ли я использовать свой общедоступный IP-адрес vps или его локальный IP-адрес в привязке rpc?
можете ли вы попробовать rpcbind=0.0.0.0& и попытаться не использовать какие-либо специальные символы в учетных данных. Если это сработает, просто добавьте правило брандмауэра для защиты демона.
да, у меня сработала часть брандмауэра, оказалось, он блокировал порт 8332, спасибо :)