README.md in swarmclient-0.1.1 vs README.md in swarmclient-0.1.3

- old
+ new

@@ -1,8 +1,9 @@ # Swarmclient-rb -- Bluzelle Hackathon 2018 +[![Build Status](https://api.travis-ci.org/wlwanpan/swarmclient-rb.png?branch=master)](https://travis-ci.org/wlwanpan/swarmclient-rb) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ## Installation Add this line to your application's Gemfile: @@ -25,15 +26,16 @@ Require and Initialize ``` require 'swarmclient' -bluzelle = Swarmclient::Communication.new endpoint: "127.0.0.1", port: 50001, uuid: "80174b53-2dda-49f1-9d6a-6a780d4" +bluzelle = Swarmclient::Communication.new endpoint: '127.0.0.1', port: 51010, uuid: '80174b53-2dda-49f1-9d6a-6a780d4' ``` -Note: The uuid is the uniq id of a referenced db hosted in the swarm. -Generate a new one to generate a new store. +Note: The uuid is the unique id of a referenced db hosted in the swarm. +Generate a new one to generate a new store. The gem will default to: +'8c073d96-7291-11e8-adc0-fa7ae01bbebc' if none is provided. Refer to https://bluzelle.github.io/api/ for more info. Create New Entry (key-value) ``` bluzelle.create 'myKey', 'Your Value' @@ -43,22 +45,13 @@ ``` bluzelle.read 'myKey' ``` - Result ``` -{:value => "Your Value"} +=> "Your Value" ``` -Read Multiple Keys -``` -bluzelle.read ['myKey', 'myKey2'] -``` -- Result -``` -[{:myKey => "Your Value"}, {:myKey2 => nil}] -``` - Update Key value ``` bluzelle.update 'myKey', 'New Value' ``` @@ -71,26 +64,31 @@ ``` bluzelle.has 'myKey' ``` - Result ``` -=> {:"key-exists" => true} +=> true ``` Read all keys stored ``` bluzelle.keys ``` - Result ``` - => {:keys => ["myKey"]} + => ["myKey1"] ``` -## Pubsub (Swarmclient::Pubsub) +Get size of database +``` +bluzelle.size +``` +- Result +``` +=> 1 +``` -For data streaming -> WIP - ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). @@ -99,6 +97,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/wlwanpan/swarmclient-rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). +The gem is under the terms of the [Apache License](http://www.apache.org/licenses/).