Here's my code for my watching only script to load the blockchain and read a balance for some addresses. Hope this helps.
import sys
sys.path.append('..')
sys.path.append('.')
from armoryengine import *
from time import sleep
start = RightNow()
TheBDM.setBlocking(True)
TheBDM.setOnlineMode(True)
print 'Loading blockchain took %0.1f sec' % (RightNow() - start)
start = RightNow()
topBlock = TheBDM.getTopBlockHeight()
print '\n\nCurrent Top Block is:', topBlock
TheBDM.getTopBlockHeader().pprint()
cppWallet = Cpp.BtcWallet()
cppWallet.addAddress_1_( addrStr_to_hash160("1ArmoryXcfq7TnCSuZa9fQjRYwJ4bkRKfv") )
print cppWallet.getNumAddr(),' addresses in this wallet'
print '\n\nRegistering the wallet with the BlockDataManager & loading...'
TheBDM.registerWallet(cppWallet)
TheBDM.scanBlockchainForTx(cppWallet)
print '\n\nTransaction history of this wallet:'
ledger = cppWallet.getTxLedger()
for le in ledger:
le.pprintOneLine()
print '\n\n************************************\nBalance of this wallet:', coin2str(cppWallet.getSpendableBalance())
print 'Unspent outputs:'
unspentTxOuts = cppWallet.getSpendableTxOutList(topBlock)
for utxo in unspentTxOuts:
utxoAddr = hash160_to_addrStr(utxo.getRecipientAddr())
print utxoAddr," ",float(utxo.getValue())/100000000.0, " ",utxo.getNumConfirm()
while True:
if TheBDM.getBDMState()=='BlockchainReady':
prevTopBlock = TheBDM.getTopBlockHeight()
newBlks = TheBDM.readBlkFileUpdate()
if newBlks>0:
print newBlks," new blocks found"
latestBlockNum = TheBDM.getTopBlockHeight()
topTimestamp = TheBDM.getTopBlockHeader().getTimestamp()
TheBDM.scanBlockchainForTx(cppWallet)
print '\n\nTransaction history of this wallet:'
ledger = cppWallet.getTxLedger()
for le in ledger:
le.pprintOneLine()
print '\n\n************************************\nBalance of this wallet:', coin2str(cppWallet.getSpendableBalance())
print 'Unspent outputs:'
unspentTxOuts = cppWallet.getSpendableTxOutList(topBlock)
for utxo in unspentTxOuts:
utxoAddr = hash160_to_addrStr(utxo.getRecipientAddr())
print utxoAddr," ",float(utxo.getValue())/100000000.0, " ",utxo.getNumConfirm()
time.sleep(10)