LogoLogo
  • Bluzelle GameFi Overview
  • Problem
  • The Solution
  • The BLZ Token
  • Careers
  • BLZ Staking
    • Bluzelle Staking Economics
    • Gas & Tax
    • Validator
      • Technical Requirements
      • Building a Public Validator + Sentry
      • Useful Commands
    • Delegator
  • GAMMA 4
    • Overview
    • The Story
    • Game Lite Paper
  • Bluzelle R2 - Decentralized Storage
    • Features
    • Architecture
    • Bluzelle Versus Filecoin
    • Deploy Your dApps
      • JS
      • Python
      • Go
      • Ruby
      • Java
    • CRUD Queries
  • Guide & Resources
    • Bridging between ERC20-BLZ and L1-BLZ
    • Create a Bluzelle Wallet
    • OS Setup for Curium
    • Development Environment Setup
    • Build the Curium Project
  • Useful Links
    • Bluzelle Website
    • Discord Developer and Validator Community
    • Twitter
Powered by GitBook
On this page
Export as PDF
  1. Bluzelle R2 - Decentralized Storage
  2. Deploy Your dApps

Java

PreviousRubyNextBridging between ERC20-BLZ and L1-BLZ

Last updated 4 years ago

blzjava is a Java/Android library that can be used to access the Bluzelle database service.

  • Build and API

  • Java

  • Android

Quickstart

Make sure that Java is installed and has a version at least 8 (JDK 1.8).

$ java -version
$ javac -version

If Java is not installed, install it.

$ sudo apt-get update
$ sudo apt-get install default-jdk

Download bluzelle.jar from or using terminal.

$ wget https://github.com/bluzelle/blzjava/releases/download/0.0.1/bluzelle.jar

Create file "Quickstart.java".

import com.bluzelle.*;

public class Quickstart {

    public static void main(String[] args) {
        Bluzelle bluzelle = Bluzelle.connect(
                "around buzz diagram captain obtain detail salon mango muffin brother morning jeans display attend knife carry green dwarf vendor hungry fan route pumpkin car",
                "http://dev.testnet.public.bluzelle.com:1317",
                null,
                null
        );

        GasInfo gasInfo = new GasInfo(10, 0, 0);
        LeaseInfo leaseInfo = new LeaseInfo(1, 0, 0, 0);

        bluzelle.create("key", "value", gasInfo, leaseInfo);
        System.out.println("created");
        bluzelle.update("key", "new value", gasInfo, leaseInfo);
        System.out.println("updated");
        System.out.println("'key': " + bluzelle.read("key", false));
        bluzelle.delete("key", gasInfo);
        System.out.println("deleted");
    }
}

Compile.

$ javac -cp ./bluzelle.jar Quickstart.java

Run.

$ java -cp .:./bluzelle.jar Quickstart
docs
docs
Examples
example
Tests
releases