Skip to content

A sample project that demonstrate the call to Casper Kotlin SDK

Notifications You must be signed in to change notification settings

hienbui9999/SampleCallCasperKotlinSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SampleCallCasperKotlinSDK

A sample project that demonstrate the call to Casper Kotlin SDK This sample call 2 RPC methods: chain_get_state_root_hash and info_get_deploy, then print the result to the log panel.

How to run this sample

Open IntelliJ IDEA and choose "Get from VCS"

Screen Shot 2022-06-28 at 18 20 04

Enter the URL of the project: https://github.com/hienbui9999/SampleCallCasperKotlinSDK.git

Screen Shot 2022-06-28 at 18 20 49

Click "Clone"

Click "Trust Project"

Screen Shot 2022-06-28 at 18 22 39

The project is then loaded to IntelliJ IDEA, but at first with many error. Since we have not imported the CasperKotlinSDK.jar file to the project.

Screen Shot 2022-06-28 at 18 24 19

Import the "CasperKotlinSDK.jar" file

Get the "CasperKotlinSDK.jar" file from this address https://drive.google.com/drive/u/0/folders/1BE8G2dSK-RaiFwJqehlxujs5YCGCS7QV

Download and put it to some place in your computer, for example "Downloads" folder

Screen Shot 2022-06-28 at 18 28 24

Back to the IntelliJ IDEA with the "SampleCallCasperKotlinSDK" project. Choose "File->Project Structure ..."

Screen Shot 2022-06-28 at 18 29 37

Choose "Libaries" and do as the image below

Screen Shot 2022-06-28 at 18 30 11

Next step is to add the "CasperKotlinSDK.jar" file by hitting the "+" button

Screen Shot 2022-06-28 at 18 33 26

Browse for the "CasperKotlinSDK.jar" file that you have already downloaded in the "Downloads" folder.

Screen Shot 2022-06-28 at 18 34 33

Click "Open" button.

You will see the "CasperKotlinSDK.jar" file being imported.

Screen Shot 2022-06-28 at 18 36 21

Click "Apply" and then "OK"

Wait for a while, the project will be loaded without error, like this

Screen Shot 2022-06-28 at 18 37 24

If not, please choose "File-> Invalidate Caches..."

Screen Shot 2022-06-28 at 18 38 03

Check all the check box and hit "Invalidate and Restart"

Screen Shot 2022-06-28 at 16 35 08

Wait for a while for the project to fully loaded.

Right click on any blank region in the file "Main.kt" and hit "Run MainKt"

Screen Shot 2022-06-28 at 18 40 17

You will then see the state root hash being retrieved and printed in the log. There is also a call to "info_get_deploy" RPC being implemented and you can see some information of the deploy, original at this address: https://testnet.cspr.live/deploy/9ff98d8027795a002e41a709d5b5846e49c2e9f9c8bfbe74e4c857adc26d5571

Screen Shot 2022-06-28 at 19 00 54

About

A sample project that demonstrate the call to Casper Kotlin SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages