Coding Guidelines in Java
I. To create a new account in your client/app, you need to follow these steps:
1) Install bitcoinj library via github url:
https://github.com/bitcoinj/bitcoinj
or using gradle/maven:
https://mvnrepository.com/artifact/org.bitcoinj/bitcoinj-core/0.16.2
2) Install fruits-kit library:
Maven:
// Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
// Add the fruits-kit dependency
<dependencies>
<dependency>
<groupId>com.github.fruits-eco-blockchain</groupId>
<artifactId>fruits-kit4j</artifactId>
<version>v1.0.0</version>
</dependency>
</dependencies>Gradle:
3) Generate your passphrase from bitcoinj library:
4) Generate keys, accountId address from passphrase
5) After completing the above steps, you have a new account, but it does not exist in the FRUITS network. You need to call our active service according to the instructions below, then your account can be used.
II. To activate your account on FRUITS network, you need to follow these steps:
1) Call API to activator:
Method: POST
Request Body:
Response:
➔ errorCode = 0 means there is no error, you have successfully requested.
➔ errorCode = 1 means that an error has occurred, you need to check the information in the message.
2) After calling API, you need to wait about 2 - 5 minutes for the system to activate the account. After that time, you can check if the account is active or not by calling the following API, if not please contact us:
Method: GET
If the response has an errorCode, you have not activated it successfully, please contact us for support.
Otherwise, if the response has no errorCode, you have created it successfully.
Last updated