(Partial?) Swift SDK

I’m contemplating converting a few speed sensitive daemons from Python to Swift and have added the Swift SDK to my dependencies.

Now, I had thought this would give me a complete implementation, but it appears that only a subset of the commands are implemented in NodeClient.swift? For example, there is a convenience method to get accountInfo, but I haven’t found one that does the equivalent GetBlockInfo?

Any Hints?

Hi there.

The swift SDK is very much work in progress (we’re currently working on bringing it up to speed), and you’re right this method is missing at the moment.

There’s no good solution for you at the moment if you want to use swift for this task, but you do have a couple of options:

  • Generate the GRPC client yourself (you can see how we do this from the Makefile in the swift SDK repository, see the generate-grpc command) and use this client.
  • Use another SDK (and another language). At Concordium, we will always recommend the Rust SDK, as the language we use ourselves for most implementation is Rust. It’s great for speed, safety, and many concepts translate nicely from swift (in my opinion).

Hope this helps, sorry for the inconvenience.

Hi,

I’m using the equivalent protoc command for my Python SDK, not looking forward to doing that again in another language.

Finally, I’m trying very hard to avoid learning Rust :slight_smile: I’d like to stick to Swift, which has similar redeeming qualities, but thankfully doesn’t have a borrow checker…

I think I’ll wait until this SDK is further along the path.

Thanks.

Alright. If you want to follow the progress you can watch the the repository on github.

1 Like

@sderuiter just wanted to get back to you if this is still of interest: The swift SDK version 1.0.0 has just been released which includes a lot of added functionality.

Check out the release and the changes here: Release 1.0.0 · Concordium/concordium-swift-sdk · GitHub

If you need more functionality added to the GRPCNodeClient as mentioned in the original post of this thread, feel free to contribute the required changes if you want.

1 Like

Hi, thank you, this is definitely something I will be picking up again. Just checked and it seems the main GRPC methods (if not all) are present in the SDK, so that’s super helpful!

It’s on the todo list again, after finalising the API authentication/rate limiting project and main site redesign. I’ll get there, just not today, nor tomorrow :slight_smile: