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
  • Getting started
  • Examples
  • Tests
  • User Acceptance Testing
  • Abort 6 error
  • Licence
Export as PDF
  1. Bluzelle R2 - Decentralized Storage
  2. Deploy Your dApps

Ruby

PreviousGoNextJava

Last updated 4 years ago

Getting started

Ensure you have a recent version of installed.

  1. Add the gem to your Gemfile:

gem 'money-tree', git: 'https://github.com/bluzelle/money-tree'
gem 'bitcoin-secp256k1', git: 'git@github.com:cryptape/ruby-bitcoin-secp256k1'
gem 'bluzelle', git: 'https://github.com/bluzelle/blzrb'
  1. Then install:

bundle install
  1. Use:

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_info

Examples

Copy .env.sample to .env and configure if needed.

cp .env.sample .env

Then run the example:

DEBUG=false LIBRESSL_REDIRECT_STUB_ABORT=0 bundle exec ruby examples/crud.rb

Tests

Configure env as described in the examples section above.

bundle exec rspec --format documentation

User Acceptance Testing

Abort 6 error

If you encounter this error, you either might have to:

Licence

MIT

Install libsecp256k1 as described .

Please checkout the document for more details.

Add a new entry to if using a newer OpenSSL version

Specify where your libsecp256k1.dylib is located with the .

here
UAT.md
ffi_lib in money-tree/lib/openssl_extensions.rb
LIBSECP256K1 environment variable
Ruby