Armory Daemon is now available on github:
https://github.com/thedawnrider/BitcoinArmory-DaemonMore info on page 2 of this thread -
https://bitcointalksearch.org/topic/m.1197291-------------------------
I thought I'd start this thread as a place to collate information about using Armory client on a webserver, since the only info I found so far was hidden on page 16 of the Armory Discussion topic.
The info below is about getting an Armory address on a webserver and it comes from
https://bitcointalksearch.org/topic/m.765880Anyone who has information or questions about using Armory on a webserver, please post it here so webdevs can make the most of Armory, which currently seems to be focusing on GUI interaction rather than API (understandably).
I put some thought into how Armory could be used for a webserver application, and I realized that with just a couple lines of python, you can generate addresses no problem on your webserver. I added a couple convenience functions and committed them to the master branch of Armory. Here's what you do:
(1) Load Armory on your computer.
(2) Create a regular wallet.
(3) In Wallet Properties, "Create Watching-Only Copy"
(4) Upload watchonly wallet to webserver
(5) Setup webserver to load wallet and call wlt.getNextUnusedAddress() for each request
(6) Sit at home with the full wallet and watch/confirm/send transactions while the webserver does the work!
Demonstration code to see how to access/manipulate the wallet from a python script:
from armoryengine import *
wlt = PyBtcWallet().readWalletFile('/home/server/web_server.watchonly.wallet')
wlt.setAddrPoolSize(1000)
# Quick printing of addr info, and shows how to access various props of the addr
def pprint(addr):
print 'The new address: '
print ' Hash160: ', binary_to_hex(addr.getAddr160(), BIGENDIAN)
print ' Base58: ', addr.getAddrStr()
print ' Index: ', addr.chainIndex
print ' Have Pub: ', addr.hasPubKey()
print ' Have Priv:', addr.hasPrivKey()
print 'Get the next unused address...'
addr = wlt.getNextUnusedAddress()
pprint(addr)
print 'Generating 10 more addresses:'
for i in range(10):
addr = wlt.getNextUnusedAddress()
print '\t', addr.chainIndex, '\t', addr.getAddrStr()
print 'Get addr #15'
a160 = wlt.getAddress160ByChainIndex(15)
print binary_to_hex(a160, BIGENDIAN)
addr = wlt.addrMap[a160]
pprint(addr)
print 'This wallet has %d addresses computed' % wlt.getHighestComputedIndex()
print 'Addresses used: %d ' % wlt.getHighestUsedIndex()
Here's the output on a watching-only wallet (this is actually the output of the second time I ran it):
Get the next unused address...
The new address:
Hash160: 728b0b8cc930cb4756328e743b7b2e7dde93a35f
Base58: mpEeSrEr3EiyCMRskT5VrELkY8X9ZwT3BV
Index: 11
Have Pub: True
Have Priv: False
Generating 10 more addresses:
12 mrhzBHQcn7jmhvpbcfW6ebiAFEm9qZF6AL
13 moPM3KPygygsWzvUHfeDsmPChL5xWycc5y
14 n4ZtG47TNMifGJ57msGAs8ZD1HeVqSqRyx
15 mw3cxXKCaKitV8w1wBRrpjQNWu4od5Nd5H
16 n1UGPkUgUXiwsotzfpAezpy6NkRg1fGMv5
17 muFPi3pAw7Rbb9aGc9UJPX9m6JT1VGHf9J
18 n3TRNc86Vmi2EygvjeMsAXXAYhPygR2sQK
19 mikSy5FjeSPVBSaXDs8ihMKrMgZsoohsjz
20 mwb8h2PJvGGGQTA7QBgvPVrWowQZi43ZD2
21 mpBFZ1H6AcRqHUZ7ETz1Xh1PqaPiMvdQDM
Get addr #15
c42ea65330263fd9c02fe5ca2e3a1c44dca356aa
The new address:
Hash160: c42ea65330263fd9c02fe5ca2e3a1c44dca356aa
Base58: mw3cxXKCaKitV8w1wBRrpjQNWu4od5Nd5H
Index: 15
Have Pub: True
Have Priv: False
This wallet has 1021 addresses computed
Addresses used: 21
Your webserver can run blissfully ignorant about what is actually going on with the wallet, it just gives out a new address on every request. You can sit at home on your computer with Armory running and the full wallet there, with full control. But someone who compromises the webserver will not get anything!If you want the webserver to track incoming transactions, it will require loading the blockchain and checking for new blocks periodically. It's not a lot of code, but I'll save it for later if you are interested.
One other thing: Armory uses the crypto++ library, which is not particularly fast at ECDSA operations (and my key generation algorithm is kinda slow, which is why I'll be upgrading to a new one, soon). My [decent] system can generate about 200 addr/sec. So this script takes a few sec to run. But all keys are stored in the wallet, so they
don't have to be recomputed when you restart the script.