# Implementing OpenCyphal API

**URL:** <https://forum.opencyphal.org/t/implementing-opencyphal-api/1677>\
**Category:** General\
**Created:** [June 5, 2022, 4:28pm UTC](https://forum.opencyphal.org/t/implementing-opencyphal-api/1677 "2022-06-05T16:28:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soypat](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/soypat/32/1130_2.png) [@soypat](https://forum.opencyphal.org/u/soypat)\
**Post date:** [June 5, 2022, 4:28pm UTC](https://forum.opencyphal.org/t/implementing-opencyphal-api/1677/1 "2022-06-05T16:28:02Z")

</div>

Hello, I’m interested in using OpenCyphal where I work and for side projects. I’d like to create a native Go implementation of OpenCyphal with the purpose of using it on low level micro-controllers such as the RP2040 and in linux machines. The starting point I want to reach is having sufficient functionality so as to have two nodes: one that requests data and the other that sends it over wire. What are some useful pointers to get me up and running?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [June 5, 2022, 5:45pm UTC](https://forum.opencyphal.org/t/implementing-opencyphal-api/1677/2 "2022-06-05T17:45:10Z")

</div>

I suggest working through the PyCyphal demo here to get a feel of the protocol in practice: [Demo — PyCyphal 1.8.5 documentation](https://pycyphal.readthedocs.io/en/stable/pages/demo.html)

Which transports do you want to support in your implementation? Cyphal/UDP, Cyphal/serial (which also works over TCP), or Cyphal/CAN? If you are aiming for multi-transport library, then you will likely need some form of abstraction over the transport, kind of like it is done in PyCyphal with `pycyphal.transport.Transport`.

Be sure to read the Guide also as it will help you understand why Cyphal is designed the way it is: [The Cyphal Guide - Applications & Usage - OpenCyphal Forum](https://opencyphal.org/guide)

---

<div class="post-metadata">

**Author:** ![soypat](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/soypat/32/1130_2.png) [@soypat](https://forum.opencyphal.org/u/soypat)\
**Post date:** [June 5, 2022, 10:30pm UTC](https://forum.opencyphal.org/t/implementing-opencyphal-api/1677/3 "2022-06-05T22:30:40Z")

</div>

Well, if at all possible I’d like to not differ between protocols and instead depend on a [`io.Reader`, `io.Writer`](https://github.com/golang/go/blob/master/src/io/io.go#L55-L98) interfaces. These are serial-like and don’t have intrinsic support for frames but are well known in the Go language and facilitate interoperability with pretty much any byte-stream interface out there.

Thanks for the pointers, I’ll take a look at the Demo program and read through the Cyphal Guide 🙂

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [June 6, 2022, 11:10am UTC](https://forum.opencyphal.org/t/implementing-opencyphal-api/1677/4 "2022-06-06T11:10:30Z")

</div>

> [@soypat](#):
>
> Well, if at all possible I’d like to not differ between protocols and instead depend on a [`io.Reader`, `io.Writer`](https://github.com/golang/go/blob/master/src/io/io.go#L55-L98) interfaces. These are serial-like and don’t have intrinsic support for frames but are well known in the Go language and facilitate interoperability with pretty much any byte-stream interface out there.

I suspect they may not be usable for abstracting the transport because they are too low-level for that. Consider defining a custom interface using `pycyphal.transport.Transport` as a reference. Keep in mind though that PyCyphal is complex as far as Cyphal implementations go because it incorporates many diagnostic features (like spoofing/snooping, statistics, etc.). For a bare-bones semi-embedded implementation you can simplify things a lot.
