bestinslot-xyz / OPI

Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.
Apache License 2.0
202 stars 110 forks source link

error: JSON-RPC error: transport error: unexpected HTTP code: 401 #24

Closed ioupeng closed 7 months ago

ioupeng commented 8 months ago

} ord version: opi-ord 0.14.0-2

error: JSON-RPC error: transport error: unexpected HTTP code: 401 ERROR ON ORD!!! Error: Command failed: ./ord --bitcoin-data-dir /var/lib/bitcoind/ --data-dir . --height-limit 831470 index run at checkExecSyncError (node:child_process:890:11) at execSync (node:child_process:962:15) at main_index (/root/OPI/modules/main_index/index.js:159:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { status: 1, signal: null, output: [ null, null, null ], pid: 3097, stdout: null, stderr: null } How to solve this?

samedcildir commented 7 months ago

It seems like your bitcoin rpc node has a custom username and password set. By default, OPI uses .cookie file for RPC authentication but your RPC node returned 401 (Unauthorized) error so it rejected the password in .cookie file.

To use the custom RPC passwords, you can set BITCOIN_RPC_USER and BITCOIN_RPC_PASSWD in .env file of main_index.

nathanddrake commented 7 months ago

@ioupeng Does this answer your question? Will close this issue in a few days ✌️

ioupeng commented 7 months ago

@ioupeng Does this answer your question? Will close this issue in a few days ✌️

Solved it. Thank you so much, sir.