Hey there,
good to have you on board and your are doing a great job!
I would recommend to take a look into https://github.com/cryptonomex/graphene-ui/tree/master/dl
this directory contains quite a nice amount of coffeescript and es6 code that deals with the bts blockchain.
There is also a python library https://github.com/xeroc/python-graphenelib
and a lot of documentation about the API of BitShares and how to use it:
http://docs.bitshares.org/api
It's late over here and I would leave you with these for now .. If you have more questions, don't hesitate to drop me a line either here or in slack.
@besson I'd like to extend a question!
AFAIK BitShares node require 32GB RAM. Such DigitalOcean instance cost $320 monthly. It's quite expensive for our small project to maintain such node just for checking BTS balances (our overall server costs now about $250). @besson @xerox Is there any possibility to use publicly available nodes or some centralized APIs now? Because if not though necessary functional concerning BitShares will be implement in a Quantum library it will not be used in production on https://cyber.fund and BitShares will be the only without support that is literally bad.
Currently, with BitShare 2.0, 2GB RAM is more than enough for witness nodes. The 32GB thing is maybe refer to BitShares 0.x.
Hello bitshares community. Nice to meet you, guys.
I am developer in cyber.fund and now I'm working on crypto-balances library which written with CoffeeScript.
You can easy check addresses balances of various crypto tokens. Script automaticaly recognize a protocol by address and return balance of tokens associated with it.
Library supports following: Bitcoin, Litecoin, Dogecoin, Ethereum, Counterparty, Open Assets, Ripple and IOUs, NXT and NXT AE, NEM, Dash and some other altcoins
In current milestone I'm working on Factom(done), Omni(done) and Bitshares.
I spent a lot of time trying to figure out how bitshares and ecosystem works.
So, I need yours help guys. What I have at this point:
1. Found that bitshares addresses have regex like BTS[a-zA-Z0-9]{50} (for example BTS7tqXBbtJwDoT8b2LY3kx547ocVfSacTirBMFEsDyhGf2FNR48p)
2. Wrote code for RPC API calls.
3. Started my own node using digital ocean instances for tests.
4. Googled and read bitshares docs and now I'm really confused about bitshares API.
Methods which I found not working and another ones use ids and names, not addresses to return balance.
(blockchain_get_balance, blockchain_list_address_balances, get_account_balances, get_named_account_balances)
Maybe I missed something out, don't know
So, to finish milestone with bitshares integration I need api which can return balance on address and nodes which will return responses.
Sorry for my english guys, I didn't have enough practice. Hope for your help and advices
The first 2 APIs you mentioned above is outdated, they are for BitShares 0.x. Currently with BitShares 2.0 we have new APIs (the last two), you need to take a look at
http://docs.bitshares.org/api.
BTS now no longer uses addresses to store balances. The new APIs for balances is documented in libraries/app/include/graphene/app/database_api.hpp
/**
* @brief Get an account's balances in various assets
* @param id ID of the account to get balances for
* @param assets IDs of the assets to get balances of; if empty, get all assets account has a balance in
* @return Balances of the account
*/
vector<asset> get_account_balances(account_id_type id, const flat_set<asset_id_type>& assets)const;
/// Semantically equivalent to @ref get_account_balances, but takes a name instead of an ID.
vector<asset> get_named_account_balances(const std::string& name, const flat_set<asset_id_type>& assets)const;
In regards to nodes, you have several options:
* set up your own witness_node and cli_wallet, connect your application with your cli_wallet, so you can use command-like APIs (raw RPC or HTTP-RPC calls).
* find a public API server, for example wss://bitshares.openledger.info/ws which can be found in the light client setting, set up your own cli_wallet to connect to that API server, then do command-like RPC calls
* connect your application with the API server or witness_node directly via web socket, so you can do request/response style API calls as well as subscription/notification, however the APIs of API servers are a bit different to wallet APIs.
* use APIs of cryptofresh.com, which is one of BitShares's public block explorer.
So, if your application communicates with cli_wallet, the correct syntax would be like:
{"jsonrpc": "2.0", "method": "list_account_balances", "params":["an_account_name"], "id":1}
Any questions please don't hesitate to ask