RaiEx v0.1.0 RaiEx View Source

This module contains the definitions of all the RaiBlocks node RPC calls.

Link to this section Summary

Functions

Returns how many RAW is owned and how many have not yet been received by account

Gets the number of blocks for a specific account

Creates a new account, insert next deterministic key in wallet

Get account number for the public key

Reports send/receive information for an account

Returns frontier, open block, change representative block, balance, last modified timestamp from local database & block count for account

Get the public key for account

Lists all the accounts inside wallet

Moves accounts from source to wallet

Remove account from wallet

Returns the representative for account

Sets the representative for account in wallet

Returns the voting weight for account

Returns how many RAW is owned and how many have not yet been received by accounts list

Returns a list of pairs of account and block hash representing the head block for accounts

Returns a list of block hashes which have not yet been received by these accounts

Returns how many rai are in the public supply

Retrieves a json representation of block

Returns the account containing the block

Reports the number of blocks in the ledger and unchecked synchronizing blocks

Reports the number of blocks in the ledger by type (send, receive, open, change)

Retrieves a json representations of multiple blocks

Retrieves a json representations of blocks with transaction amount & block account

Initialize bootstrap to specific IP address and port

Initialize multi-connection bootstrap to random peers

Returns a list of block hashes in the account chain starting at block up to count

Used to connect to a different endpoint

Returns a list of pairs of delegator names given account a representative and its balance

Get number of delegators for a specific representative account

Derive deterministic keypair from seed based on index

Reports the number of accounts in the ledger

Returns a list of pairs of account and block hash representing the head block starting at account up to count

Reports send/receive information for a chain of blocks

Tells the node to send a keepalive packet to address:port

Generates an adhoc random keypair

Derive public key and account number from private key

Divide a raw amount down by the krai ratio

Multiply an krai amount by the krai ratio

Divide a raw amount down by the Mrai ratio

Multiply an Mrai amount by the Mrai ratio

Changes the password for wallet to password

Enters the password in to wallet

Checks whether the password entered for wallet is valid

Begin a new payment session. Searches wallet for an account that’s marked as available and has a 0 balance. If one is found, the account number is returned and is marked as unavailable. If no account is found, a new account is created, placed in the wallet, and returned

End a payment session. Marks the account as available for use in a payment session

Marks all accounts in wallet as available for being used as a payment session

Wait for payment of ‘amount’ to arrive in ‘account’ or until ‘timeout’ milliseconds have elapsed

Returns a list of pairs of peer IPv6:port and its node network version

Returns a list of pending block hashes with amount more or equal to threshold

Check whether block is pending by hash

Posts some json to the RaiBlocks rpc. If the POST is unsuccessful, it is re-sent @retry_count many times with a delay of @wait_time between retries. Callback implementation for RaiEx.RPC

Publish block to the network

Divide a raw amount down by the rai ratio

Multiply an rai amount by the rai ratio

Receive pending block for account in wallet

Returns receive minimum for node

Set amount as new receive minimum for node until restart

Returns a list of pairs of representative and its voting weight

Additionally rebroadcast source chain blocks for receive/open up to sources depth

Tells the node to look for pending blocks for any account in wallet

Tells the node to look for pending blocks for any account in all available wallets

Send amount from source in wallet to destination

enable_control must be set to true

Returns a list of block hashes in the account chain ending at block up to count

Returns a list of pairs of unchecked synchronizing block hash and its json representation up to count

Clear unchecked synchronizing blocks

Retrieves a json representation of unchecked synchronizing block by hash

Retrieves unchecked database keys, blocks hashes & a json representations of unchecked pending blocks starting from key up to count

Check whether account is a valid account number

Retrieves node versions

Add an adhoc private key key to wallet

Returns the sum of all accounts balances in wallet

Returns how many rai is owned and how many have not yet been received by all accounts in

Changes seed for wallet to seed

Check whether wallet contains account

Creates a new random wallet id

Destroys wallet and all contained accounts

Return a json representation of wallet

Returns a list of pairs of account and block hash representing the head block starting for accounts from wallet

Returns a list of pending block hashes with amount more or equal to threshold

Returns the default representative for wallet

Sets the default representative for wallet

Rebroadcast blocks for accounts from wallet starting at frontier down to count to the network

Returns a list of pairs of account and work from wallet

Stop generating work for block

Generates work for block

Retrieves work for account in wallet

Add specific IP address and port as work peer for node until restart

Retrieves work peers

Clear work peers node list until restart

Set work for account in wallet

Check whether work is valid for block

Link to this section Functions

Link to this function account_balance(account) View Source

Returns how many RAW is owned and how many have not yet been received by account.

Link to this function account_block_count(account) View Source

Gets the number of blocks for a specific account.

Creates a new account, insert next deterministic key in wallet.

Get account number for the public key.

Reports send/receive information for an account.

Link to this function account_history(account, count) View Source

Returns frontier, open block, change representative block, balance, last modified timestamp from local database & block count for account.

Get the public key for account.

Lists all the accounts inside wallet.

Moves accounts from source to wallet.

Node must have ‘enable_control’ set to ‘true’

Link to this function account_move(wallet, source, accounts) View Source

Remove account from wallet.

Link to this function account_remove(wallet, account) View Source
Link to this function account_representative(account) View Source

Returns the representative for account.

Link to this function account_representative_set(list) View Source

Sets the representative for account in wallet.

Node must have ‘enable_control’ set to ‘true’

Link to this function account_representative_set(wallet, account, representative) View Source

Returns the voting weight for account.

Link to this function accounts_balances(accounts) View Source

Returns how many RAW is owned and how many have not yet been received by accounts list.

Link to this function accounts_frontiers(accounts) View Source

Returns a list of pairs of account and block hash representing the head block for accounts.

Returns a list of block hashes which have not yet been received by these accounts.

Optional threshold, only returns hashes with amounts >= threshold.

Link to this function accounts_pending(accounts, count) View Source
Link to this function accounts_pending(accounts, count, accounts, count, threshold) View Source

Returns how many rai are in the public supply.

Retrieves a json representation of block.

Returns the account containing the block.

Reports the number of blocks in the ledger and unchecked synchronizing blocks.

Reports the number of blocks in the ledger by type (send, receive, open, change).

Retrieves a json representations of multiple blocks.

Retrieves a json representations of blocks with transaction amount & block account.

Initialize bootstrap to specific IP address and port.

Link to this function bootstrap(address, port) View Source

Initialize multi-connection bootstrap to random peers.

Returns a list of block hashes in the account chain starting at block up to count.

Link to this function connect(url \\ "http://localhost:7076") View Source

Used to connect to a different endpoint.

Returns a list of pairs of delegator names given account a representative and its balance.

Link to this function delegators_count(account) View Source

Get number of delegators for a specific representative account.

Derive deterministic keypair from seed based on index.

Link to this function deterministic_key(seed, index) View Source

Reports the number of accounts in the ledger.

Returns a list of pairs of account and block hash representing the head block starting at account up to count.

Link to this function frontiers(account, count) View Source

Reports send/receive information for a chain of blocks.

Tells the node to send a keepalive packet to address:port.

Link to this function keepalive(address, port) View Source

Generates an adhoc random keypair

Derive public key and account number from private key.

Divide a raw amount down by the krai ratio.

Multiply an krai amount by the krai ratio.

Divide a raw amount down by the Mrai ratio.

Multiply an Mrai amount by the Mrai ratio.

Changes the password for wallet to password.

enable_control must be set to true

Link to this function password_change(wallet, password) View Source

Enters the password in to wallet.

Link to this function password_enter(wallet, password) View Source

Checks whether the password entered for wallet is valid.

Begin a new payment session. Searches wallet for an account that’s marked as available and has a 0 balance. If one is found, the account number is returned and is marked as unavailable. If no account is found, a new account is created, placed in the wallet, and returned.

End a payment session. Marks the account as available for use in a payment session.

Link to this function payment_end(account, wallet) View Source

Marks all accounts in wallet as available for being used as a payment session.

Wait for payment of ‘amount’ to arrive in ‘account’ or until ‘timeout’ milliseconds have elapsed.

Link to this function payment_wait(account, amount, timeout) View Source

Returns a list of pairs of peer IPv6:port and its node network version.

Returns a list of pending block hashes with amount more or equal to threshold.

Link to this function pending(account, count, account, count, threshold) View Source

Check whether block is pending by hash.

Link to this function post_json_rpc(json, tries \\ 3, prev_reason \\ {:error, :unknown}) View Source

Posts some json to the RaiBlocks rpc. If the POST is unsuccessful, it is re-sent @retry_count many times with a delay of @wait_time between retries. Callback implementation for RaiEx.RPC.

Examples

iex> post_json_rpc(%{"action" => "wallet_create"})
{:ok, %{"wallet" => "0000000000000000"}}

iex> post_json_rpc(%{"action" => "timeout"})
{:error, reason}

Publish block to the network.

Divide a raw amount down by the rai ratio.

Multiply an rai amount by the rai ratio.

Receive pending block for account in wallet

enable_control must be set to true

Link to this function receive(wallet, account, block) View Source

Returns receive minimum for node.

enable_control must be set to true

Link to this function receive_minimum_set(amount) View Source

Set amount as new receive minimum for node until restart

Returns a list of pairs of representative and its voting weight.

Additionally rebroadcast source chain blocks for receive/open up to sources depth.

Link to this function republish(hash, hash, sources) View Source

Tells the node to look for pending blocks for any account in wallet.

Link to this function search_pending_all(list) View Source

Tells the node to look for pending blocks for any account in all available wallets.

Send amount from source in wallet to destination

Link to this function send(wallet, source, destination, amount) View Source

enable_control must be set to true

Returns a list of block hashes in the account chain ending at block up to count.

Link to this function successors(block, count) View Source

Returns a list of pairs of unchecked synchronizing block hash and its json representation up to count.

Clear unchecked synchronizing blocks.

enable_control must be set to true

Retrieves a json representation of unchecked synchronizing block by hash.

Retrieves unchecked database keys, blocks hashes & a json representations of unchecked pending blocks starting from key up to count.

Link to this function unchecked_keys(key, count) View Source
Link to this function validate_account_number(account) View Source

Check whether account is a valid account number.

Retrieves node versions.

Add an adhoc private key key to wallet.

enable_control must be set to true

Link to this function wallet_balance_total(wallet) View Source

Returns the sum of all accounts balances in wallet.

Returns how many rai is owned and how many have not yet been received by all accounts in .

Link to this function wallet_change_seed(list) View Source

Changes seed for wallet to seed.

enable_control must be set to true

Link to this function wallet_change_seed(wallet, seed) View Source

Check whether wallet contains account.

Link to this function wallet_contains(wallet, account) View Source

Creates a new random wallet id.

enable_control must be set to true

Destroys wallet and all contained accounts.

enable_control must be set to true

Return a json representation of wallet.

Link to this function wallet_frontiers(wallet) View Source

Returns a list of pairs of account and block hash representing the head block starting for accounts from wallet.

Returns a list of pending block hashes with amount more or equal to threshold.

enable_control must be set to true

Link to this function wallet_pending(wallet, count) View Source
Link to this function wallet_pending(wallet, count, wallet, count, threshold) View Source
Link to this function wallet_representative(wallet) View Source

Returns the default representative for wallet.

Link to this function wallet_representative_set(list) View Source

Sets the default representative for wallet.

enable_control must be set to true

Link to this function wallet_representative_set(wallet, representative) View Source

Rebroadcast blocks for accounts from wallet starting at frontier down to count to the network.

enable_control must be set to true

Link to this function wallet_republish(wallet, count) View Source

Returns a list of pairs of account and work from wallet.

enable_control must be set to true

Stop generating work for block.

enable_control must be set to true

Generates work for block

enable_control must be set to true

Retrieves work for account in wallet.

enable_control must be set to true

Link to this function work_get(wallet, account) View Source

Add specific IP address and port as work peer for node until restart.

enable_control must be set to true

Link to this function work_peer_add(address, port) View Source

Retrieves work peers.

enable_control must be set to true

Clear work peers node list until restart.

enable_control must be set to true

Set work for account in wallet.

enable_control must be set to true

Link to this function work_set(wallet, account, work) View Source

Check whether work is valid for block.

Link to this function work_validate(work, hash) View Source