Skip to content
Chris Priest edited this page Nov 7, 2017 · 2 revisions

Estimate coin supply

>>> import datetime
>>> from moneywagon.supply_estimator import SupplyEstimator
>>> btc = SupplyEstimator('btc')
>>> btc.estimate_height_from_date(datetime.datetime(2014, 3, 12))
272736
>>> btc.calculate_supply(block_height=3244)
162200.0
>>> btc.calculate_supply(at_time=datetime.datetime(2017, 3, 12))
15882000.0
>>> ltc = SupplyEstimator('ltc')
>>> ltc.calculate_supply(block_height=320224)
16011200.0

Note that the calculate_supply function returns perfect results when estimating from a block height. If estimating from at_time, then the results will be approximate. The function estimate_height_from_date works by dividing the amount of time between the passed in date and the genesis date of the currency, then dividing that amount of time by the block interval. Because block are never found exactly every block interval, the result of this calculation will be approximate.

Network Replay

This utility is used to mirror transactions from one network to another. Usage:

$ moneywagon network-replay btc bch latest --verbose`

This command will fetch the latest block from th BTC network, and then replay each transaction to the BCH network. The word "latest" can be replaced with a block number also. By default the first 5 transactions are attempted. To perform a full block replay, append the --limit=0 flag.

Currently only BCH and BTC are supported. Support for other forks will be added eventually.

Clone this wiki locally