Package zephyr.daemon

Class ZephyrDaemonDefault

java.lang.Object
zephyr.daemon.ZephyrDaemonDefault
All Implemented Interfaces:
ZephyrDaemon
Direct Known Subclasses:
ZephyrDaemonRpc

public abstract class ZephyrDaemonDefault extends Object implements ZephyrDaemon
Abstract default implementation of a Zephyr daemon.
  • Constructor Details

    • ZephyrDaemonDefault

      public ZephyrDaemonDefault()
  • Method Details

    • getBlockTemplate

      public ZephyrBlockTemplate getBlockTemplate(String walletAddress)
      Description copied from interface: ZephyrDaemon
      Get a block template for mining a new block.
      Specified by:
      getBlockTemplate in interface ZephyrDaemon
      Parameters:
      walletAddress - is the address of the wallet to receive miner transactions if block is successfully mined
      Returns:
      a block template for mining a new block
    • getBlocksByRangeChunked

      public List<ZephyrBlock> getBlocksByRangeChunked(Long startHeight, Long endHeight)
      Description copied from interface: ZephyrDaemon
      Get blocks in the given height range as chunked requests so that each request is not too big.
      Specified by:
      getBlocksByRangeChunked in interface ZephyrDaemon
      Parameters:
      startHeight - is the start height lower bound inclusive (optional)
      endHeight - is the end height upper bound inclusive (optional)
      Returns:
      blocks in the given height range
    • getTx

      public ZephyrTx getTx(String txHash)
      Description copied from interface: ZephyrDaemon
      Get a transaction by hash.
      Specified by:
      getTx in interface ZephyrDaemon
      Parameters:
      txHash - is the hash of the transaction to get
      Returns:
      the transaction with the given hash or null if not found
    • getTx

      public ZephyrTx getTx(String txHash, Boolean prune)
      Description copied from interface: ZephyrDaemon
      Get a transaction by hash.
      Specified by:
      getTx in interface ZephyrDaemon
      Parameters:
      txHash - is the hash of the transaction to get
      prune - specifies if the returned tx should be pruned (defaults to false)
      Returns:
      the transaction with the given hash or null if not found
    • getTxs

      public List<ZephyrTx> getTxs(Collection<String> txHashes)
      Description copied from interface: ZephyrDaemon
      Get transactions by hashes.
      Specified by:
      getTxs in interface ZephyrDaemon
      Parameters:
      txHashes - are hashes of transactions to get
      Returns:
      found transactions with the given hashes
    • getTxHex

      public String getTxHex(String txHash)
      Description copied from interface: ZephyrDaemon
      Get a transaction hex by hash.
      Specified by:
      getTxHex in interface ZephyrDaemon
      Parameters:
      txHash - is the hash of the transaction to get hex from
      Returns:
      the tx hex with the given hash
    • getTxHex

      public String getTxHex(String txHash, Boolean prune)
      Description copied from interface: ZephyrDaemon
      Get a transaction hex by hash.
      Specified by:
      getTxHex in interface ZephyrDaemon
      Parameters:
      txHash - is the hash of the transaction to get hex from
      prune - specifies if the returned tx hex should be pruned (defaults to false)
      Returns:
      the tx hex with the given hash
    • getTxHexes

      public List<String> getTxHexes(Collection<String> txHashes)
      Description copied from interface: ZephyrDaemon
      Get transaction hexes by hashes.
      Specified by:
      getTxHexes in interface ZephyrDaemon
      Parameters:
      txHashes - are hashes of transactions to get hexes from
      Returns:
      are the tx hexes
    • getFeeEstimate

      public ZephyrFeeEstimate getFeeEstimate()
      Description copied from interface: ZephyrDaemon
      Get mining fee estimates per kB.
      Specified by:
      getFeeEstimate in interface ZephyrDaemon
      Returns:
      mining fee estimates per kB
    • submitTxHex

      public ZephyrSubmitTxResult submitTxHex(String txHex)
      Description copied from interface: ZephyrDaemon
      Submits a transaction to the daemon's pool.
      Specified by:
      submitTxHex in interface ZephyrDaemon
      Parameters:
      txHex - is the raw transaction hex to submit
      Returns:
      the submission results
    • relayTxByHash

      public void relayTxByHash(String txHash)
      Description copied from interface: ZephyrDaemon
      Relays a transaction by hash.
      Specified by:
      relayTxByHash in interface ZephyrDaemon
      Parameters:
      txHash - identifies the transaction to relay
    • getKeyImageSpentStatus

      public ZephyrKeyImageSpentStatus getKeyImageSpentStatus(String keyImage)
      Description copied from interface: ZephyrDaemon
      Get the spent status of the given key image.
      Specified by:
      getKeyImageSpentStatus in interface ZephyrDaemon
      Parameters:
      keyImage - is key image hex to get the status of
      Returns:
      the status of the key image
    • getOutputDistribution

      public List<ZephyrOutputDistributionEntry> getOutputDistribution(Collection<BigInteger> amounts)
      Description copied from interface: ZephyrDaemon
      Creates an output distribution.
      Specified by:
      getOutputDistribution in interface ZephyrDaemon
      Parameters:
      amounts - are amounts of outputs to make the distribution with
      Returns:
      output distribution entries meeting the parameters
    • setPeerBan

      public void setPeerBan(ZephyrBan ban)
      Description copied from interface: ZephyrDaemon
      Ban a peer node.
      Specified by:
      setPeerBan in interface ZephyrDaemon
      Parameters:
      ban - contains information about a node to ban
    • submitBlock

      public void submitBlock(String blockBlob)
      Description copied from interface: ZephyrDaemon
      Submit a mined block to the network.
      Specified by:
      submitBlock in interface ZephyrDaemon
      Parameters:
      blockBlob - is the mined block to submit
    • downloadUpdate

      public ZephyrDaemonUpdateDownloadResult downloadUpdate()
      Description copied from interface: ZephyrDaemon
      Download an update.
      Specified by:
      downloadUpdate in interface ZephyrDaemon
      Returns:
      the result of the update download