I have 2 ceramic-one nodes in different machines (C1-A and C1-B) and I am trying to verify that information created in C1-A is properly retrieved from C1-B, but I am not able to do so.
I created a model and one instance in C1-A, and registered interest in this model in C1-B.
When I query the C1-A node about the information added, I am able to retrieve everything, including documentState and events, using queries like /feed/events and /experimental/events/{sep}/{sepValue}, being able to retrieve the information properly.
On the other hand, when I use C1-B, I can check that there is one interest registered properly on it by using /experimental/interests api. But if I use the same apis mentioned before and used successfully with C1-A, trying to get the information related to the created model including events or even documentState, I am not able to retrieve anything.
Am I doing something wrong?
I am running the ceramic-one nodes using docker and with the following commands: ceramic-one daemon --bind-address 0.0.0.0:5101 --external-swarm-addresses /ip4/{machine_ip_C1-A}/tcp/4101 --external-swarm-addresses /ip4/{machine_ip_C1-A}/udp/4101/quic-v1 --extra-ceramic-peer-addresses /ip4/{machine_ip_C1-B}/tcp/4101/p2p/{C1-B_peer_id}
And I can see in the logs that the nodes are connected:
INFO ceramic_p2p::behaviour::ceramic_peer_manager: connection established, stop dialing ceramic peer, peer_id: {C1-B peer_id}, multiaddr: {/ip4/{machine_ip_C1-B}/tcp/4101/p2p/C1-B_peer_id}
at p2p/src/behaviour/ceramic_peer_manager.rs:143
in ceramic_p2p::node::run
I just figured out the issue. The creator node C1-A must registerInterest too for the new created model. This made the trick to retrieve the events in C1-B properly as expected.
Nevertheless, getDocumentState is not working in C1-B, so I think I am doing something wrong or something is wrong. Are you able to make it work with 2 different nodes?
Hey @mohsin, sorry I thought I had reply to this thread.
This is still not working for me. It is weird, because I register interest for specific model in different ceramic nodes, and I am able to retrieve the events successfully from both nodes, but if I try to use getDocumentState then it only works if I call it using the node where the stream was created but not in the other node that registered interest about it.
I am working with the events now, but this fix would be really helpful, since right now I need to filter events to find the latest one, while using this function would let me retrieve the latest information without the need of filtering events.
From what I read in the repo, maybe register interests is only to retrieve events related to a specific schema/model, but nothing related to the stream states? It makes sense that following the events it would be possible to get the state of the stream, but as I mentioned not working for me or doing something wrong on my end maybe.
Thats why I am able to get events but not streams information?
Whenever I do registerInterestModel in different nodes, right after it I am able to retrieve events from these two nodes, but if I want to retrieve specific stream state, of one instance from the model for example, I am only able to call getDocumentState (which calls /streams/stream_id api) successfully from the node where the instance stream was created, but I am able to get the new events from all the nodes that registered interest in this model.
Let me know if this is not clear so I can specify more.