- Flowee the Hub/
- Service API overview
- Service/Blockchain
- Service/Live Transactions
- Service/Mining
- Service/Util
- Service/RegTest
- Service/Hub Control
- Service/Indexer
- Service/AddressMonitor
- Service/TransactionMonitor
- Service/BlockNotification
- Service/Double Spend
- Service/System
- Protocol Spec
- Example Message
Flowee the Hub — API documentation
Service/Indexer
Indexer Service
Indexer is a service provided by the server of the same name. It operates on a different internet port (1234) and might run on a different IP address than the Hub.
Read more in the Indexer intro.
Messages
GetAvailableIndexers,
Indexer. sId=19 mId=0 |
---|
GetAvailableIndexersReply
Indexer. sId=19 mId=1 | ||
---|---|---|
AddressIndexer: 21 | boolean | included (true) if available |
TxIdIndexer 22 | boolean | included (true) if available |
SpentOutputIndexer 23 | boolean | included (true) if available |
FindTransaction
You can only ask for a transaction if the txid indexer is enabled.
Indexer. sId=19 mId=2 | ||
---|---|---|
TxId: 4 | bytearray | 32-byte transaction hash |
FindTransactionReply
Indexer. sId=19 mId=3 | ||
---|---|---|
BlockHeight: 7 | natural-number | Height of the block in the chain. |
OffsetInBlock: 8 | natural-number | Key useful for BlockChain::GetTransaction |
FindAddress
You can only ask about an address if the address indexer is enabled.
The indexer works on output-script-hash. The sha256 (single) hashing of the entire output script. You can use the BitcoinScriptHashed (32-byte) flag for such.
Additionally we support a simple p2pkh based bitcoin address. This is the ripe160 hash of the public key, which is the type of addresses most payments are made to. The indexer will convert this to a script-hash for you. Use the BitcoinP2PKHAddress tag for this.
Most user-interaction uses some encoding, base58 or cash-address are two examples. This API is not meant to be user-facing and we expect the string-based address to be decoded before using this API.
Please note that only the first hash or address found in the request is used to find data. The rest of the message is ignored.
Indexer. sId=19 mId=4 | ||
---|---|---|
BitcoinP2PKHAddress: 2 | bytearray | 20-byte ripe160 hash |
BitcoinScriptHashed: 9 | sha256 | sha256 (single) hash of the script-out (32 bytes) |
FindAddressReply
The reply will list a combination of blockheight, offset in block (which together identifies one single transaction) and output-index.
The triplets will be separated by a Separator item.
Indexer. sId=19 mId=5 | ||
---|---|---|
separator: 0 | bool | indicator that next value will follow |
BlockHeight: 7 | natural-number | Height of the block in the chain. |
OffsetInBlock: 8 | natural-number | Key useful for BlockChain::GetTransaction |
output-index: 20 | natural-number | (zero base) index of output in tx |
FindSpentOutput
You can only ask about a spent txid when the spentOutputDB is enabled on the indexer.
This call takes a transaction-id and output-index and returns the transaction that spent it.
In case the spender is not found, a blockheight of -1 is returned. See FindSpentOutputReply
Indexer. sId=19 mId=6 | ||
---|---|---|
TxId: 4 | bytearray | 32-byte transaction hash |
output-index: 20 | natural-number | (zero base) index of output in tx |
FindSpentOutputReply
You can only ask about a spent txid when the spentOutputDB is enabled on the indexer.
In case the spender is not found, a blockheight of -1 is returned. See FindSpentOutputReply
Indexer. sId=19 mId=7 | ||
---|---|---|
BlockHeight: 7 | natural-number | Height of the block in the chain. |
OffsetInBlock: 8 | natural-number | Key |