Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Is there anyone who handles Polkadot in Java or Rust? #4966

Closed
paperfrog95 opened this issue Feb 22, 2022 · 7 comments
Closed

Is there anyone who handles Polkadot in Java or Rust? #4966

paperfrog95 opened this issue Feb 22, 2022 · 7 comments

Comments

@paperfrog95
Copy link

I am developing by a coin exchange company.
so, I can't use polkadot-js.
I have a problem of not being able to decode extrinsics received from this polkadot's node.

Apart from this node, my server will decode it and collect data.
(my server use java, but I can also use Rust through Java Navtive Inteface)

However, I don't know how to decode. What library or crate should I use?

I know extrinsics is encoded through scale-codec.

I just don't know what library to decode this with.

so please tell us detailed guidelines or how to use it.

@drahnr
Copy link
Contributor

drahnr commented Feb 22, 2022

This has only been enabled very recently with the advent of the type annotation paritytech/substrate#8615 which can be utilized with i.e. (:warning: alpha :warning: ) https://github.com/paritytech/subxt

@KiChjang
Copy link
Contributor

There is also parity-scale-codec, which is the crate that we use internally to encode/decode SCALE data. As you said, you can either use this via JNI, or make a Java-based SCALE encoder/decoder. The latter is preferred as Rust types aren't 1-to-1 convertible to Java types -- you'll need to do that conversion even if you're using JNI.

@drahnr
Copy link
Contributor

drahnr commented Feb 22, 2022

@KiChjang 's approach is easier if you only need a few dozen types.

@paperfrog95
Copy link
Author

Thank you for your opinions. In order to use it at the production level, I have to use scale-codec to develop it again..
Polkadot is developed as Rust, right?
It's strange that there's no utility or library for decoding in a rust environment. haha

@KiChjang
Copy link
Contributor

It's strange that there's no utility or library for decoding in a rust environment. haha

I don't understand what you're saying? We just told you that there's subxt and parity-scale-codec.

@paperfrog95
Copy link
Author

Polkadot-js is providing a lot of support.
What I mean is that there's no utility for me to use at the production level.
Even if scale-codec is used, I have to proceed with the development one more time.

@KiChjang
Copy link
Contributor

We are using parity-scale-codec at the production level. parity-scale-codec is developed in Rust and for Rust.

In any case, your question has been answered in multiple communication channels, and I'll be closing this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants