# How to directly communicate with cardano-node through its socket?

**URL:** <https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735>\
**Category:** Cardano Integration\
**Created:** [3 January 2022 14:11 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735 "2022-01-03T14:11:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrbena](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@petrbena](https://forum.cardano.org/u/petrbena)\
**Post date:** [3 January 2022 14:11 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/1 "2022-01-03T14:11:55Z")

</div>

I know of cardano-cli and I want to access some of its functionality (such as querying address balances, inspecting UTXOs etc.), but I don’t want to my program to call cardano-cli and parse its terminal output, instead I would rather interact with cardano-node directly, just as for example dbsync does.

Is there any description of the underlying protocol that describes how should I form and read the packets that go in / from the socket? What format is it using, is it all binary, or json?

---

<div class="post-metadata">

**Author:** ![georgem1976](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/georgem1976/32/38471_2.png) [@georgem1976](https://forum.cardano.org/u/georgem1976)\
**Post date:** [4 January 2022 08:20 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/2 "2022-01-04T08:20:38Z")

</div>

You can use cardano-wallet to do some of those queries (inspecting balances for example), but you need cardano-db-sync and cardano-graphql to query UTxOs for example.

The diagram on this page (scroll down) shows how different components are interacting with each other:  
[https://docs.cardano.org/tools/comp-matrix](https://docs.cardano.org/tools/comp-matrix)

I do not know about any documentation about the protocol used to talk to the node directly through the socket, but that would be interesting.

---

<div class="post-metadata">

**Author:** ![petrbena](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@petrbena](https://forum.cardano.org/u/petrbena)\
**Post date:** [4 January 2022 08:26 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/3 "2022-01-04T08:26:14Z")

</div>

I know, I have experience with cardano-wallet, but I specifically don’t want to use that, in my use case the cardano-node could belong to semi-trusted intermediary that isn’t supposed to know any wallet secrets.

cardano-wallet requires wallet secrets to operate. I simply want to be able to query blockchain data or submit already signed transactions, just like cardano-cli can.

---

<div class="post-metadata">

**Author:** ![Psychomb](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/psychomb/32/16719_2.png) [@Psychomb](https://forum.cardano.org/u/Psychomb)\
**Post date:** [4 January 2022 08:48 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/4 "2022-01-04T08:48:02Z")

</div>

Try to look for [Ogmios](https://github.com/CardanoSolutions/ogmios) if you want to interact with the node, or [blockfrost.io](http://blockfrost.io) for an API variant may be.

---

<div class="post-metadata">

**Author:** ![petrbena](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@petrbena](https://forum.cardano.org/u/petrbena)\
**Post date:** [4 January 2022 10:29 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/5 "2022-01-04T10:29:03Z")

</div>

blockfrost is useless for my case, I am trying to create a light wallet. blockfrost requires registration and is too centralized for this use case.

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [4 January 2022 10:40 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/6 "2022-01-04T10:40:11Z")

</div>

Looking at the Cardano documentation, I found: [GitHub - input-output-hk/ouroboros-network: An implementation of the Ouroboros family of consensus algorithms, with its networking support](https://github.com/input-output-hk/ouroboros-network/#ouroboros-network)

Do the PDFs there maybe help? They say that they also speak about the node-to-client protocol.

---

<div class="post-metadata">

**Author:** ![Psychomb](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/psychomb/32/16719_2.png) [@Psychomb](https://forum.cardano.org/u/Psychomb)\
**Post date:** [4 January 2022 11:53 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/7 "2022-01-04T11:53:05Z")

</div>

Please have a look at the added link to ogmios.

---

<div class="post-metadata">

**Author:** ![petrbena](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@petrbena](https://forum.cardano.org/u/petrbena)\
**Post date:** [4 January 2022 12:06 UTC](https://forum.cardano.org/t/how-to-directly-communicate-with-cardano-node-through-its-socket/90735/8 "2022-01-04T12:06:30Z")

</div>

yes that’s exactly what I was looking for
