Ensure you have a recent version of installed.
Grab the package from github:
Use:
Copy .env.sample to .env and configure if needed.
Then run the example:
The tests/ can best be run in a environment. To do so, initialize one with:
Install requirements:
Then run the tests:
Please checkout the document for more details.
MIT
pipenv install git+https://github.com/bluzelle/blzpy.git#egg=bluzelleimport bluzelle
client = bluzelle.new_client({
'address': '...',
'mnemonic': '...',
})
gas_info = {
'max_fee': 4000001,
}
key = 'foo'
client.create(key, 'bar', gas_info)
value = client.read(key)
client.update(key, 'baz', gas_info)
client.delete(key, gas_info)cp .env.sample .envDEBUG=false python examples/crud.pypipenv --python 3pipenv installmake testEnsure you have a recent version of Go installed.
Grab the package from github:
go get github.com/bluzelle/blzgoUse:
package main
import (
"github.com/bluzelle/blzgo"
"log"
)
func main() {
// create client
options := &bluzelle.Options{
Mnemonic: "...",
Endpoint: "http://dev.testnet.public.bluzelle.com:1317",
UUID: "...",
}
client, err := bluzelle.NewClient(options)
if err != nil {
log.Fatalf("%s", err)
}
key := "foo"
value := "bar"
gasInfo := bluzelle.GasInfo{
MaxFee: 4000001,
}
leaseInfo := bluzelle.LeaseInfo{
Days: 1,
}
// create key
if err := client.Create(key, value, gasInfo, leaseInfo); err != nil {
log.Fatalf("%s", err)
} else {
log.Printf("create key success: true\n")
}
// read key
if v, err := client.Read(key); err != nil {
log.Fatalf("%s", err)
} else {
log.Printf("read key success: %t\n", v == value)
}
// update key
if err := client.Create(key, value, gasInfo, nil); err != nil {
log.Fatalf("%s", err)
} else {
log.Printf("create key success: true\n")
}
// delete key
if err := client.Delete(key, gasInfo); err != nil {
log.Fatalf("%s", err)
} else {
log.Printf("delete key success: true\n")
}
}You can test out the examples/ included by following these steps:
Copy .env.sample to .env and configure if needed.
cp .env.sample .envInstall dependencies:
go get ./...Run an example as defined in the Makefile, for example, to read the value of an existing key, foo, run:
make read key=fooThis will run the examples/crud/read.go.
make testPlease checkout the UAT.md document for more details.
MIT
blzjava is a Java/Android library that can be used to access the Bluzelle database service.
Make sure that Java is installed and has a version at least 8 (JDK 1.8).
$ java -version
$ javac -versionIf Java is not installed, install it.
$ sudo apt-get update
$ sudo apt-get install default-jdkDownload bluzelle.jar from releases or using terminal.
$ wget https://github.com/bluzelle/blzjava/releases/download/0.0.1/bluzelle.jarCreate 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.javaRun.
$ java -cp .:./bluzelle.jar QuickstartEnsure you have a recent version of Ruby installed.
Install libsecp256k1 as described here.
Add the gem to your Gemfile:
gem 'money-tree', git: 'https://github.com/bluzelle/money-tree'
gem 'bitcoin-secp256k1', git: '[email protected]:cryptape/ruby-bitcoin-secp256k1'
gem 'bluzelle', git: 'https://github.com/bluzelle/blzrb'Then install:
bundle installUse:
require "bluzelle"
client = Bluzelle::new_client({
"address" => "...",
"mnemonic" => "...",
"uuid" => "bluzelle",
"endpoint" => "http://dev.testnet.public.bluzelle.com:1317",
})
key = 'foo'
gas_info = {
'max_fee' => 4000001,
}
client.create key, 'bar', gas_info
value = client.read key
client.update key, 'baz', gas_info
client.delete key, gas_infoCopy .env.sample to .env and configure if needed.
cp .env.sample .envThen run the example:
DEBUG=false LIBRESSL_REDIRECT_STUB_ABORT=0 bundle exec ruby examples/crud.rbConfigure env as described in the examples section above.
bundle exec rspec --format documentationPlease checkout the UAT.md document for more details.
If you encounter this error, you either might have to:
Add a new entry to ffi_lib in money-tree/lib/openssl_extensions.rb if using a newer OpenSSL version
Specify where your libsecp256k1.dylib is located with the LIBSECP256K1 environment variable.
MIT
blzjs is a Typescript/JavaScript library that can be used to access the Bluzelle database service.
yarn add bluzelle
or
npm install bluzelleThere are two versions of the bluzelle library. bluzelle-node.js and bluzelle-js.js.
By default the NodeJS version will be used.
import { bluzele } from 'bluzelle';
or
const { bluzelle } = require('bluzelle');import { bluzele } from 'bluzelle/lib/bluzelle-js';
or
const { bluzelle } = require('bluzelle/lib/bluzelle-js');import {bluzelle, API, BluzelleConfig} from 'bluzelle'import {bluzelle, API, BluzelleConfig} from 'bluzelle/lib/bluzelle-js'const {bluzelle} = require('bluzelle');
const config = {
mnemonic: "apology antique such ancient spend narrow twin banner coral book iron summer west extend toddler walnut left genius exchange globe satisfy shield case rose",
endpoint: "http://testnet.public.bluzelle.com:1317",
chain_id: 'bluzelle',
uuid: Date.now().toString()
};
(async () => {
const bz = await bluzelle(config);
await bz.create("somekey", "somevalue", {'gas_price': 10})
console.log(await bz.read("somekey"))
})();import {bluzelle, API, BluzelleConfig} from 'bluzelle';
const config: BluzelleConfig = {
mnemonic: "apology antique such ancient spend narrow twin banner coral book iron summer west extend toddler walnut left genius exchange globe satisfy shield case rose",
endpoint: "http://testnet.public.bluzelle.com:1317",
chain_id: 'bluzelle',
uuid: Date.now().toString()
};
(async () => {
const bz: API = await bluzelle(config);
await bz.create("somekey", "somevalue", {'gas_price': 10})
console.log(await bz.read("somekey"))
})();


