Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not store data in ordinal-api from ordhook #335

Open
louisdangw3 opened this issue Mar 17, 2024 · 7 comments
Open

Can not store data in ordinal-api from ordhook #335

louisdangw3 opened this issue Mar 17, 2024 · 7 comments

Comments

@louisdangw3
Copy link

I have a ordhook and ordinal API . i write docker compose.yml for API but when i run http://localhost:3456/ordinals/v1/brc-20/tokens the result is {"limit":20,"offset":0,"total":0,"results":[]} .please help me for this bug

123
234234
4234234
Capture

@louisdangw3
Copy link
Author

louisdangw3 commented Mar 17, 2024

hi @rafaelcr . this is my ordhook node running
23123

@rafaelcr
Copy link
Collaborator

@louisdv7192 can you share your API logs to see if it's receiving block data from ordhook correctly?

@rafaelcr
Copy link
Collaborator

From your images, I suspect the API is not reaching ordhook. Make sure ORDHOOK_NODE_RPC_PORT matches the open port you have on ordhook (usually should be port 20456)

@louisdangw3
Copy link
Author

image
image
this is my Ordhook.toml
[storage]
working_dir = "ordhook"

The Http Api allows you to register / deregister

dynamically predicates.

Disable by default.

[http_api]
http_port = 20456

[network]
mode = "testnet"
bitcoind_rpc_url =
bitcoind_rpc_username =
bitcoind_rpc_password =

Bitcoin block events can be received by Chainhook

either through a Bitcoin node's ZeroMQ interface,

or through the Stacks node. Zmq is being

used by default:

bitcoind_zmq_url = "tcp://172.17.0.1:18555"

but stacks can also be used:

stacks_node_rpc_url = "http://0.0.0.0:20443"

[resources]
ulimit = 2048
cpu_core_available = 16
memory_available = 32
bitcoind_rpc_threads = 4
bitcoind_rpc_timeout = 15
expected_observers_count = 1

Disable the following section if the state

must be built locally

[snapshot]
download_url = "https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest"

[logs]
ordinals_internals = true
chainhook_internals = true

@louisdangw3
Copy link
Author

And this is my log in Ordinal-api
image

@endangurura
Copy link

@louisdangw3 did you find a fix, I'm having the same issue

@rafaelcr rafaelcr moved this from 🆕 New to 📋 Backlog in Ordinals Apr 22, 2024
@rafaelcr
Copy link
Collaborator

@louisdangw3 apologies for the delay in getting back to you here.

Are you running both containers on the same machine? I suggest you make the following changes to your API's ENV:

  • EXTERNAL_HOSTNAME: 127.0.0.1 if both ordhook and API are running on the same machine
  • ORDHOOK_NODE_RPC_HOST: 127.0.0.1 same as above
  • ORDHOOK_NODE_RPC_PORT: 20456 this should equal your http_port setting in Ordhook.toml

Settings above will allow you to run service start in ordhook and have the API register the predicate for you. Keep in mind that ordhook accepts predicate registrations once it has caught up with bitcoin chain tip so you might have to wait a bit for that to happen before launching the API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants