Elixir

You are here:
< Back

Elixir Installation

Elixir can be installed by following this guide

Installation

The package can be installed by adding qredit_client to your list of dependencies in mix.exs:

def deps do
  {:qredit_client, "~> 0.1.0"}
end

Once installed, you should run the following command to install the dependencies :

$ mix deps.get

Development setup

If you want to contribute to the code of this package execute the following commands

  1. Fork the package
  2. Clone your forked repository
$ git clone https://github.com/<githubusername>/elixir-client
  1. Next, move into the fresh cloned directory
$ cd elixir-client
  1. Install the dependencies
$ mix deps.get
  1. Dependencies are now installed, you can now run the tests to see if everything is running like it should
$ mix test

Usage

Initializing the Client

First step is to initialize the Client, the nethash and version values might be different :

iex > client = Qredit.Client.new(%{
... >             host: "http://my.node.ip:myport/api",
... >             nethash: "578e820911f24e039733b45e4882b73e301f813a0d2c31330dafda84534ffa23",
... >             version: "1.1.1"
... > })

Blocks V2

iex> Qredit.Client.API.Two.Blocks.list(client)
... > {:ok,
... > ...
... > }

More details

Delegates V2

iex> Qredit.Client.API.Two.Delegates.list(client)
... > {:ok,
... > ...
... > }

More details

Node – V2

iex> Qredit.Client.API.Two.Node.status(client)
... > {:ok,
... > ...
... > }

More details

Peers – V2

iex> Qredit.Client.API.Two.Peers.list(client)
... > {:ok,
... > ...
... > }

More details

Transactions – V2

iex> Qredit.Client.API.Two.Transactions.list(client)
... > {:ok,
... > ...
... > }

More details

Votes – V2

iex> Qredit.Client.API.Two.Votes.list(client)
... > {:ok,
... > ...
... > }

More details

Wallets – V2

iex> Qredit.Client.API.Two.Wallets.list(client)
... > {:ok,
... > ...
... > }

More details

Last Updated On January 15, 2019