Giter Club home page Giter Club logo

java-xpx-chain-sdk's Introduction

ProximaX Sirius Blockchain Java SDK

License Coverage Status Build Status

ProximaX Sirius Blockchain Java SDK

Official ProximaX Sirius Blockchain SDK Library in Java.

The ProximaX Sirius Chain Java SDK is a Java library for interacting with the Sirius Blockchain. It provides a complete library set coverage, and supports synchronous and asynchronous requests. This SDK can be used with JVM-based languages like Java, Kotlin, Scala.

Use the library

See wiki for latest version of the project.

This library requires use of Java8. Releases of library are published to Maven Central and snapshots are available in Sonatype snapshot repository. To include library and its dependencies, add following to your build script:

Maven

<dependency>
    <groupId>io.proximax</groupId>
    <artifactId>java-xpx-chain-sdk</artifactId>
    <version>${javaXpxVersion}</version>
</dependency>

Gradle

compile "io.proximax:java-xpx-chain-sdk:${javaXpxVersion}"

Documentation

For SDK documentation and examples see wiki and JavaDoc.

Check integration tests for working examples how to use the library.

Contribution

We'd love to get more people involved in the project. Please feel free to raise issue or PR and we'll review your contribution.

License

Project is licensed under Apache License Version 2.0. See LICENSE file for details.

Copyright (c) 2019 ProximaX Limited

java-xpx-chain-sdk's People

Contributors

alexjavabraz avatar avanaur avatar carlocayos avatar cempl avatar dgarcia360 avatar dl-nice avatar fullcircle23 avatar guillemsole avatar jeraytheon avatar slackve avatar sleepyowl14 avatar tonowie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

thuhc

java-xpx-chain-sdk's Issues

Some of e2e tests are failing on bctestnet1

following test fail on http://bctestnet1.xpxsirius.io:3000 but not on local docker image

  • E2EBlockchainTest - block2MerklePath, block1TransactionMerklePath - http request returns conflict - likely data issue because test depends on expected block content
  • E2EAggregateTest - escrowBetweenThreeParties - timeout. sice 2 parties work this will likely be some deadline not being met on slower network
  • E2EAliasTest - all tests fail - need to revisit this, there are some insufficient funds, expired mosaics etc. likely fixes will be increased timeouts and longer transaction/mosaic/namespace lifespans

Create central router for requests

at the moment it is difficult to tell which endpoint is used where and validate that all endpoints are available in the API.

Come up with mechanism that allows

  • central definition of request routing
  • string substitution to use directly openapi definitions
  • lookup of "where do I call this route"
  • assess whether all defined routes are implemented

Flatbuffers serialization issue of 0 integers

flatbuffers serialize integer zero as 1 byte value which then fails deserialization on server which expects int32 to be 4 bytes

Check Schema whether int type serialization can fix this

Allow transfers to account via alias

Allow account alias to be used in transactions. ATM only address can be used as a target of transactions. Both namespace and address should be allowed because namespaces can be used as aliases for accounts. Thomas got this working by representing namespace id as 25 bytes.

I should probably introduce some kind of abstraction that would allow use of both address and namespace id (assuming it is aliased to account). Need to come up with name for it. Either Destination or Target. it would have 2 static "from" constructors where one would take address, the other namespaceid, perhaps even string representing namespace fully qualified name as a convenience.

Simplify retrieval of account balances

following calls are needed to retrieve account balance (and understand it)

  1. GET accountHttp.getAccountInfo - this provides mosaic ids and balances
  2. POST mosaicHttp.getMosaics - this provides divisibility in the mosaic properties
  3. POST mosaicHttp.getMosaicNames - this resolves mosaic name for mosaic id

Consider creating some API above all this to simplify retrieval of all that data

add support for metadata

If you want to add a metadata to account/ namespace/ mosaic. You need to create according transaction=)
The schema of modifyMetadataTransaction you can find here:
https://github.com/proximax-storage/go-xpx-catapult-sdk/blob/feature/SP-411/transactions/schemas/schema_modify_metadata_transaction.fbs

The example of transaction creation you can find here:
https://github.com/proximax-storage/go-xpx-catapult-sdk/blob/development/sdk/transaction_model.go#L343

The routes you can find here(And in swagger):
https://github.com/proximax-storage/go-xpx-catapult-sdk/blob/feature/SP-411/sdk/metadata.go

And examples of DTO you can find here(And in swagger):
https://github.com/proximax-storage/go-xpx-catapult-sdk/blob/feature/SP-411/sdk/mosaic_internal.go

Support for Android runtime

as described by https://github.com/nemtech/nem2-sdk-java/pull/17 current implemntation is not compatible with Android.

We should consider refactoring to add Android support

  • Replace Vert.x to OkHttp and Gson.
  • Change hash library from bouncycastle to spongycastle.
  • Implement Base32 encoding and decoding in the SDK and drop the dependency of apache commons-codec.
  • Replace java.time package to the backport library(threetenbp).

Travis build cache issue

build cache on travis always reports miss..

/home/travis/.gradle/caches/5.4.1/javaCompile/javaCompile.lock
/home/travis/.gradle/caches/journal-1/file-access.bin
/home/travis/.gradle/caches/journal-1/journal-1.lock\n

need to delete these files before caching process

Add more info to manifest and to publishing

following (and more) can be added to manifest and publishing can also take advantage of more information

            "Specification-Title"   : "ProximaX Sirius Blockchain Java SDK" 
            "Implementation-Vendor" : "ProximaX"

Handle SENTINEL Account property type

Account property type sentinel is declared in the types but is not supported by the SDK. Either implement support for this account property type or drop it from the enum

Add support for account properties

Account properties are not supported at the moment by java API. need to add new route to accounthttp and create whole model and mapping for it

Use fee with transactions

The implementation from nemtech does not use the fee and uses 0 instead. I already implemented use of the fee with some of the transactions but the ones which came from original implementation still use 0. Need to fix this

get up-to-date with the server

Anatoliy Osetsymskyi
Hi guys. We merged some udpates from NEM for rest server and added minor changes from us.

They on review now, but you can test them locally via latest version of dfms-dev-net:
https://github.com/proximax-storage/dfms-dev-net

A new version of swagger you can find here:
https://github.com/proximax-storage/js-xpx-catapult-rest/blob/feature/PC-103/swagger.yaml

Change log:
Updated BlockInfo and AccountInfo
Updated status errors
Changed the Fee fields to MaxFee
Updated Account Property formatter
Added route to get names of mosaic
Changed route of account properties

Sort out integration tests

integration tests do not compile at the moment. Need to align them with implementation and make sure they run fine

Remove obsolete buffer classes

Buffer classes were moved to gen and still need to remove couple of them that are in the SDK code and even used.... i.e. MultisigAggregateModificationTransactionBuffer, ProvisionNamespaceTransactionBuffer

improve test code coverage

combined jUnit and e2e test code coverage for src/main/java is 89.7%. Review both junit and e2e tests to get coverage up to 95%

Make integration tests configurable

there are now separate config files for IT and jUnit tests. That will make it difficult to run on CI server. Add environment variables which will have precedence over config files and will provide basic setup for tests

fix javadoc

atm javadoc is invalid in couple places and to get past this javadoc linter was disabled. will be better to fix javadoc and enable javadoc linter

MosaicNonce uses inconsistent serialization/deserialization between byte[] and numbers

MosaicNonce createFromBigInteger(BigInteger number) method uses little endian when converting big integer to byte array (nonce)

int getNonceAsInt() on the other hand uses big endian to convert byte array to int

this inconsistency creates confusing situation when making invocation like this
createFromBigInteger(BigInteger.ONE).getNonceAsInt()
One would expect this to return 1 but it does not because of the mismatch

Automation enhancements

tasks to do via Travis CI

Javadoc was added in issue #56 but at the moment I have to re-publish it manually. Doing the automation will change following

  • published javadoc will match master instead of last release

Review swagger endpoints

Review swagger endpoints, identify missing/untested ones and raise issues to eventually cover everything

Listener needs to filter events to specific address

some of the listener events take address when subscribing but do not filter by that address. Issue #40 fixes Listener to filter cosignatoryAdded events by specified address.

Need to review all events and make sure filtering is done properly even with multiple subscriptions of the same type. Also do refactoring to make Listener code lighter

PrivateKey#toString returns incorrect result

Private key is random and it can happen that first byte is 0 in which case the resulting hex-encoded string is 62 characters long instead of 64 characters. Need to prefix this with 00

Get HASH_160 and HASH_256 working

HASH_160 and HASH_256 do not work properly. HASH_160 oes not seem to be properly handled by server and HASH_256 worked in aggregate transaction but fails standalone (lat time I tried anyway)

Both hash functions are now deprecated and tests disabled. Need to resolve this

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.