Git Product home page Git Product logo

jhon-qiu / clb-polkadot-java-types Goto Github PK

View Code? Open in Web Editor NEW

This project forked from talfco/clb-polkadot-java-types

0.0 1.0 0.0 159 KB

A Java Implementation of the Polkadot types and their (de-)serialisation via SCALE codec. The initial type library was done in Rust (https://github.com/paritytech/parity-scale-codec) and then ported to Javascript (https://www.npmjs.com/package/@polkadot/types). This project now provides a Java port of this library.

License: GNU General Public License v3.0

Java 100.00%

clb-polkadot-java-types's Introduction

README: Polkadot Type Library for Java

Introduction

This project is in a pre-inception phase (Alpha) stay tuned - More to Come

The goal of this project is to port over the Polkadot Type Library to Java, which is pre-requisite if you plan to connect from a Java Application to Polkadot.

The library was built in a reverse engineer manner by assessing three exisiting implementations:

SCALE Data Format

Substrate encodes data in the "Simple Concatenated Aggregate Little-Endian" (SCALE) data format, as implemented by the parity-codec crate and several JavaScript modules.

It is an extremely light-weight encoding format designed for high-performance, copy-free encoding and decoding of data in resource-constrained execution contexts like the Substrate runtime.

It is not self-describing in any way and assumes the decoding context has all type knowledge about the encoded data.

Technical Notes

Byte Handling

A byte according to the Java language spec represents a value between -128 up to 127. The Java language doesn't provide something like a unsigned keyword. If a byte is cast to a int. Java will interpret the first bit as the sign and use sign extension. In order to calculate with the byte, we have to convert it into an unsigned representation (int), by using the method: Byte.toUnsignedInt(byte)

https://stackoverflow.com/questions/4266756/can-we-make-unsigned-byte-in-java/4266841

References

clb-polkadot-java-types's People

Contributors

acloudburo avatar talfco avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.