bytecoin
bytecoin copied to clipboard
RPC API methods not found
Hello, I'm trying to query the bytecoin chain using some API methods listed here and here but all i'm getting is that the methods are not found. The only one working for me is get_status..
I'm running version 3.0.2. Is there anywhere an up to date list of possible API calls?
I've found the full list here: https://github.com/bcndev/bytecoin/blob/master/src/rpc_api.hpp
Thanx, I'm looking into it, but can't seem to find some calls that would allow me to get transactions within a block?
get_transfers method is returning not found.
"get_transfers", two named parameters: from_height (=blockno-1), to_height (=blockno).
curl -X POST http://localhost:8081/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "test", "method": "get_transfers", "params": {"from_height": 2, "to_height":5}}'
Still, doen't matter which params i put in, theres no error regarding parsing or params, but always just: {"error":{"code":-32601,"message":"Method not found"},"id":"test","jsonrpc":"2.0"}
Do you need all block transactions or just "your" transactions? If you need all, you have to look for bytecoind api ("get_transfers" is walletd api). If you need only your transaction, you should send your request to walletd api port.
I need all transactions in a block, this should be the bytecoind api, but i don't see anything relevant?
Did you try sync_blocks?
curl -X POST http://localhost:8081/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "test", "method": "sync_blocks", "params": {}}'
Response: { "id": "test", "jsonrpc": "2.0", "result": { "blocks": [], "start_height": 0, "status": { "incoming_peer_count": 0, "lower_level_error": "", "next_block_effective_median_size": 0, "outgoing_peer_count": 0, "recommended_fee_per_byte": 0, "top_block_difficulty": 0, "top_block_hash": "", "top_block_height": 0, "top_block_timestamp": 0, "top_block_timestamp_median": 0, "top_known_block_height": 0, "transaction_pool_version": 0 } } }
@kocho Mind the daemon you send request to. This is an example of get_transfers
request to walletd
:
curl -s -u <user>:<pass> -X POST http://localhost:8070/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "test", "method": "get_transfers", "params": {}}' | jq