Skip to content
Blockchain made easy. Wrapper for Multichain JSON RPC API for Elixir.
Branch: master
Clone or download
Arif
Latest commit 86a9614 Aug 10, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config fix bug in send and work with stream Aug 10, 2018
lib
test initial commit Aug 1, 2018
.formatter.exs initial commit Aug 1, 2018
.gitignore
LICENSE
README
README.md fix bug in send and work with stream Aug 10, 2018
mix.exs fix bug in send and work with stream Aug 10, 2018
mix.lock

README.md

Multichain

Multichain is a permissioned blockchain platform as a fork from bitcoin protocol. It is very useful to be an immutable ledger system which can be used in various project. Multichain by default provide JSON RPC api interface. This library is a wrapper to the JSON RPC to make easy and simple operation with Multichain instance.

Installation

  1. Add followind dependency into your mix.exs
def deps do
  [
    {:multichain, "~> 0.1.0"}  
  ]
end
  1. Get the dependency
mix deps.get
  1. Add your Multichain node configuration into config.exs, match the value to your own credential.
config :multichain,
  protocol: "http",
  port: "1234",
  host: "188.199.177",
  username: "multichainrpc",
  password: "xxxxxxxxxxxxxxx",
  chain: "chain1"

Done! Now you can use it inside your Module.

How to use

You can now call all of Multichain api in simple way by calling Multichain.api/2

Some of example can be seen below:

Multichain.api("listaddresses", ["*", true, 3, -3])

Multichain.api("getinfo", [])

Multichain.api("help", [])

iex(1)> Multichain.api("validateaddress", ["1KFjut7GpLN2DSvRrh6UATxYxy5nxYaY7EGhys"])
{:ok,
 %{
   "error" => nil,
   "id" => nil,
   "result" => %{
     "account" => "",
     "address" => "1KFjut7GpLN2DSvRrh6UATxYxy5nxYaY7EGhys",
     "ismine" => false,
     "isscript" => false,
     "isvalid" => true,
     "iswatchonly" => true,
     "synchronized" => false
   }
 }}

The docs of this package can be found at https://hexdocs.pm/multichain.

Multichain complete API can be found https://www.multichain.com/developers/json-rpc-api/.

TODO

Some of common task is a combination of multiple api call. Previously has been implemented in python and nodejs. We should make it here too to simplify common operation.

  • Check balance api
  • Create Address api
  • Publish Stream api
  • Retreive stream api
  • Create new asset
  • Reissue new asset
  • List asset
  • FIX STREAM DECODEE
You can’t perform that action at this time.