Documentation ¶
Index ¶
- Constants
- type AnchorBTC
- func (app *AnchorBTC) AnchorReward(CoreID string) error
- func (app *AnchorBTC) AnchorToChain(startTxRange int64, endTxRange int64) error
- func (app *AnchorBTC) BeginTxMonitor(msgBytes []byte) error
- func (app *AnchorBTC) BlockSyncMonitor()
- func (app *AnchorBTC) CheckAnchor(btcmsg types.BtcTxMsg) error
- func (app *AnchorBTC) ConfirmAnchor(btcMonObj types.BtcMonMsg) error
- func (app *AnchorBTC) FindAndRemoveBtcCheck(aggRoot string) error
- func (app *AnchorBTC) GenerateBtcBatch(proofIds []string, btcHeadState types.AnchorBtcHeadState) error
- func (app *AnchorBTC) GetBlockTree(btcTx types.TxID) (lnrpc.BlockDetails, merkletools.MerkleTree, int, error)
- func (app *AnchorBTC) GetTreeFromCalRange(startTxRange int64, endTxRange int64) (types.BtcAgg, error)
- func (app *AnchorBTC) IsInConfirmedTxs(anchorRoot string) (bool, types.TxID)
- func (app *AnchorBTC) LogError(err error) error
- func (app *AnchorBTC) MonitorBlocksForConfirmation(startHeight int64, endHeight int64) error
- func (app *AnchorBTC) MonitorConfirmedTx()
- func (app *AnchorBTC) MonitorFailedAnchor()
- func (app *AnchorBTC) ResetAnchor(startTxRange int64)
- func (app *AnchorBTC) SendBtcTx(anchorDataObj types.BtcAgg, height int64, start int64, end int64) (string, []byte, error)
Constants ¶
const CHECK_BTC_TX_IDS_KEY = "BTC_Mon:CheckNewBTCTxIds"
const CONFIRMED_BTC_TX_IDS_KEY = "BTC_Mon:ConfirmedBTCTxIds"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnchorBTC ¶
type AnchorBTC struct { Cache *level.KVStore Db database.ChainpointDatabase LnClient *lightning.LightningClient // contains filtered or unexported fields }
func NewBTCAnchorEngine ¶
func NewBTCAnchorEngine(state *types.AnchorState, config types.AnchorConfig, tendermintRpc *tendermint_rpc.RPC, database *database.ChainpointDatabase, cache *level.KVStore, LnClient *lightning.LightningClient, logger log.Logger, analytics *analytics2.UniversalAnalytics) *AnchorBTC
func (*AnchorBTC) AnchorReward ¶
AnchorReward : Send sats to last anchoring core
func (*AnchorBTC) AnchorToChain ¶
AnchorToChain : StartAnchoring scans all CAL transactions since last anchor epoch and writes the merkle root to the Calendar and to bitcoin
func (*AnchorBTC) BeginTxMonitor ¶
BeginTxMonitor : Consumes a btctx message to initiate monitoring on all nodes
func (*AnchorBTC) BlockSyncMonitor ¶
func (app *AnchorBTC) BlockSyncMonitor()
BlockSyncMonitor : maintains unlock of wallet while abci is running, updates height, runs confirmation loop
func (*AnchorBTC) ConfirmAnchor ¶
ConfirmAnchor : consumes a btc mon message and issues a BTC-Confirm transaction along with completing btc proof generation
func (*AnchorBTC) FindAndRemoveBtcCheck ¶
FindAndRemoveBtcCheck : remove all checks in case of btc tx failure
func (*AnchorBTC) GenerateBtcBatch ¶
func (app *AnchorBTC) GenerateBtcBatch(proofIds []string, btcHeadState types.AnchorBtcHeadState) error
func (*AnchorBTC) GetBlockTree ¶
func (app *AnchorBTC) GetBlockTree(btcTx types.TxID) (lnrpc.BlockDetails, merkletools.MerkleTree, int, error)
GetBlockTree : constructs block merkel tree with transaction as index
func (*AnchorBTC) GetTreeFromCalRange ¶
func (*AnchorBTC) IsInConfirmedTxs ¶
func (*AnchorBTC) MonitorBlocksForConfirmation ¶
MonitorBlocksForConfirmation : since LND can't retrieve confirmed Txs, search block by block
func (*AnchorBTC) MonitorConfirmedTx ¶
func (app *AnchorBTC) MonitorConfirmedTx()
MonitorConfirmedTx : Begins anchor confirmation process when a Tx is in the mempool
func (*AnchorBTC) MonitorFailedAnchor ¶
func (app *AnchorBTC) MonitorFailedAnchor()
FailedAnchorMonitor: ensures transactions reach btc chain within certain time limit
func (*AnchorBTC) ResetAnchor ¶
ResetAnchor ensures that anchoring will begin again in the next block