Forge-java-sdk

forge sdk for java development. For Forge-related setup, please checkout Forge

A detailed reference manual for forge-java-sdk can be found here.

Installation

if you are using gradle ,you have to add url to your repositories

and java version must >= 8.

Usage

Step 0

First get your Forge running on local with Forge CLI. Or you know another's node config info.

Step 1

Find the config your forge is using by forge ps, find forge section, and get endpoint.

forge-ps

Tutorials

Step 0: create a project

Create a SpringBoot gradle project. and ZX forge-java-sdk to it's dependencies.

Step 1: connect to Forge Node

when you want to connect with forge node.

Step 2: create a wallet

you have to declare your account like sign up your account on chain.

Step 3: Query your account information

this interface is a gRPC stream

Step 4: CheckIn/Poke your wallet to get some token

wait some seconds, check your account balance .

Step 5: Transfer your token to other

create another wallet (suppose: Bob) as step 2.

if it works, response will return a hash string. you can query this hash use forgeSDK,or query it in forgeWeb. After this tx confirmed, check Alice and Bob 's accounts to confirm if this transaction successfully.

TBA is the default currency on Forge Chain. 1 TBA has 18 digits, so it shows as 1000000000000000000. and decimal is 18.

More usage

Create wallet by existing private key

Sign a transaction

MultiSig a transaction

What is Multisig?

What MultiSig actually do

Asset

What's asset

create asset: response is send transaction response and address is asset address, if transaction send successfully

common consume asset: if asset creator sell asset to others ,and others want to consume asset

child account consume asset: if application want to others to check asset.

Delegation

What's delegation

For java user

Java user can use kotlin object like below:

and use kotlin extention like below:

🎉 Congratulations! You have finished the tutorial! Now you should have a general sense about how Forge works. Now continue to explore ! simple demo project