Ensure 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: 'git@github.com:cryptape/ruby-bitcoin-secp256k1'
gem 'bluzelle', git: 'https://github.com/bluzelle/blzrb'
- Then install:
bundle install
- 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
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
Configure env as described in the examples section above.
bundle exec rspec --format documentation
Please 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
inmoney-tree/lib/openssl_extensions.rb
if using a newer OpenSSL version - Specify where your
libsecp256k1.dylib
is located with theLIBSECP256K1
environment variable.
MIT