Port other electrum endpoints to hub #3

Open
opened 2021-05-07 16:53:21 +02:00 by lyoshenka · 0 comments
lyoshenka commented 2021-05-07 16:53:21 +02:00 (Migrated from github.com)
  • blockchain.claimtrie.search

headers

  • need an API that returns N headers. it will replace all of the following

    • blockchain.block.headers
    • blockchain.block.get_chunk (unused)
    • blockchain.block.get_header (unused)

    API: getHeaders(startHeight, numHeaders)
    make sure that 0 < numHeaders <= 40960, though this upper limit may not be the right one anymore. why do we have it? just because we need some limit?

    when Go hub starts, connect to python block processor and load all current headers. keep them in ram
    subscribe to block processor's zmq notifications for new headers. full header will be in there.

  • blockchain.headers.subscribe (don't do this until Go hub can read from block processor db directly - aka till we switch to rocksdb)

db

  • python block processor will emit stream of PUT/DELETE zmq events
  • go hub will listen to zmq events and write them to it's own pebble db
  • no more db in python... but python needs db access for processing blocks

federation

speced in #6

  • server.add_peer
  • server.peers.subscribe

other

  • server.ping
  • server.version
  • server.features
  • blockchain.block.get_server_height
  • blockchain.transaction.broadcast

don't do any of the ones below

needs reorg support

tx can change blocks during a reorg, so we need to handle that correctly to do all this

otoh, doing this reorg support is way easier than doing resolve reorgs. and in fact, btcd may already have all this implemented

blockchain.transaction.get_merkle
blockchain.transaction.get (depends on get_merkle)
blockchain.transaction.get_batch (depends on get_merkle)
blockchain.transaction.info (depends on get_merkle)
blockchain.transaction.get_height
blockchain.address.get_history
blockchain.address.subscribe
blockchain.address.unsubscribe

resolve

wait on this till roy/brannon finish porting chain to Go. they'll be implementing this

blockchain.claimtrie.resolve

unused

blockchain.address.get_mempool
blockchain.estimatefee
blockchain.relayfee
blockchain.scripthash.get_balance
blockchain.scripthash.get_history
blockchain.scripthash.get_mempool
blockchain.scripthash.listunspent
blockchain.scripthash.subscribe
server.banner
server.payment_address
server.donation_address
mempool.get_fee_histogram
blockchain.address.get_balance
blockchain.address.listunspent

## search - [x] blockchain.claimtrie.search ## headers - [ ] need an API that returns N headers. it will replace all of the following - blockchain.block.headers - blockchain.block.get_chunk (unused) - blockchain.block.get_header (unused) API: `getHeaders(startHeight, numHeaders)` make sure that `0 < numHeaders <= 40960`, though this upper limit may not be the right one anymore. why do we have it? just because we need some limit? when Go hub starts, connect to python block processor and load all current headers. keep them in ram subscribe to block processor's zmq notifications for new headers. full header will be in there. - [ ] ~~blockchain.headers.subscribe~~ (don't do this until Go hub can read from block processor db directly - aka till we switch to rocksdb) ## db - python block processor will emit stream of PUT/DELETE zmq events - go hub will listen to zmq events and write them to it's own pebble db - no more db in python... but python needs db access for processing blocks ## federation speced in #6 - [x] server.add_peer - [x] server.peers.subscribe ## other - [x] server.ping - [x] server.version - [ ] server.features - [ ] blockchain.block.get_server_height - [ ] blockchain.transaction.broadcast ---- # don't do any of the ones below ## needs reorg support tx can change blocks during a reorg, so we need to handle that correctly to do all this otoh, doing this reorg support is way easier than doing resolve reorgs. and in fact, btcd may already have all this implemented blockchain.transaction.get_merkle blockchain.transaction.get (depends on get_merkle) blockchain.transaction.get_batch (depends on get_merkle) blockchain.transaction.info (depends on get_merkle) blockchain.transaction.get_height blockchain.address.get_history blockchain.address.subscribe blockchain.address.unsubscribe ## resolve wait on this till roy/brannon finish porting chain to Go. they'll be implementing this blockchain.claimtrie.resolve ## unused blockchain.address.get_mempool blockchain.estimatefee blockchain.relayfee blockchain.scripthash.get_balance blockchain.scripthash.get_history blockchain.scripthash.get_mempool blockchain.scripthash.listunspent blockchain.scripthash.subscribe server.banner server.payment_address server.donation_address mempool.get_fee_histogram blockchain.address.get_balance blockchain.address.listunspent
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/herald.go#3
No description provided.