dfinity / agent-rs

A collection of libraries and tools for building software around the Internet Computer, in Rust.
https://sdk.dfinity.org/
Apache License 2.0
121 stars 74 forks source link

support `no_std` #370

Open smallstepman opened 2 years ago

smallstepman commented 2 years ago

A user asked a question on the forum https://forum.dfinity.org/t/about-iot-using-dfinity/14518

Is it currently possible to compile ic-agent with no_std flag?

adamspofford-dfinity commented 2 years ago

You need an operating system to have a network socket. We are not about to implement a network card driver for ic-agent. IoT devices typically have an androidlike operating system, so a no-std mode would not be necessary either.

smallstepman commented 2 years ago

no one is talking about implementing network card drivers here ;p

could you link the "IoT androidlike OS" you're referring to?

I can't think of a straightforward way to install ic-agent on something like RPi Pico. I guess the first thing I'd try is to install ZephyrOS and then try to somehow add ic-agent to the mix, although I'd still have to bridge C++ and Rust. I'm not sure if/how Zephyr would be able to expose the network socket from C++ to Rust ic-agent.

Perhaps it would be a good idea to put network stuff behind feature flags? Then flag with pub all functions that generate (or interpret) the content of network requests. What do you think?

Another option would be to split ic-agent into