Pages:
Author

Topic: [ANN] BitcoinArmory-Daemon - armory on web servers (Read 20540 times)

newbie
Activity: 4
Merit: 0
Awesome, thanks to everyone involved!
full member
Activity: 123
Merit: 100
Thanks to Doug we actually have a new version of that method with an optional minconf argument  on the "dev" branch:

Code:
   #############################################################################
   @catchErrsForJSON
   def jsonrpc_getreceivedbyaddress(self, address, minconf=0):
      """
      DESCRIPTION:
      Get the number of coins received by a Base58 address associated with
      the currently loaded wallet.
      PARAMETERS:
      address - The Base58 address associated with the current wallet.
      minconf - (Default=0) The minimum number of confirmations required for a
                TX to be included in the final balance.
      RETURN:
      The balance received from the incoming address (BTC).
      """

      if CLI_OPTIONS.offline:
         raise ValueError('Cannot get received amount when offline')
      # Only gets correct amount for addresses in the wallet, otherwise 0
      addr160 = addrStr_to_hash160(address, False)[1]

      # Iterate through the address in our wallet. Include coins only if values
      # are positive and the number of confirmations is high enough.
      txs = self.curWlt.getAddrTxLedger(addr160)
      balance = 0
      for curTX in txs:
         nconf = (TheBDM.getTopBlockHeader().getBlockHeight() - \
                  curTX.getBlockNum()) + 1
         if (nconf >= minconf) and (curTX.getValue() > 0):
            balance += curTX.getValue()

      return AmountToJSON(balance)
newbie
Activity: 4
Merit: 0
Hi everyone!

I made a thread over here (click me) about getreceivedbyaddress.

In short, does getreceivedbyaddress only include confirmed transactions or also unconfirmed ones?

Looking through the source gives me the impression that it counts both confirmed and unconfirmed transactions:
Code:
  def jsonrpc_getreceivedbyaddress(self, address):
      """
      DESCRIPTION:
      Get the number of coins received by a Base58 address associated with
      the currently loaded wallet.
      PARAMETERS:
      address - The Base58 address associated with the current wallet.
      RETURN:
      The balance received from the incoming address (BTC).
      """

      if CLI_OPTIONS.offline:
         raise ValueError('Cannot get received amount when offline')
      # Only gets correct amount for addresses in the wallet, otherwise 0
      addr160 = addrStr_to_hash160(address, False)[1]

      txs = self.curWlt.getAddrTxLedger(addr160)
      balance = sum([x.getValue() for x in txs if x.getValue() > 0])
      return AmountToJSON(balance)

Also looking through Transaction.py and PyBtcWallet.py did not give me any clues on how one would add an extra check to the lambda ( something like x.getConfirmations() > minconfs ) to only include confirmed transactions.

Any advice / inputs?
sr. member
Activity: 255
Merit: 250
Senior Developer - Armory
Ok I fixed the txjsonrpc problem.

As stated before, that library will be included with the next version of Armory.

Quote
The second command must be run IN the armory directory. Now the error I get is:

root@cloud-server-07:/BitcoinArmory# python armoryd.py
(ERROR) Traceback (most recent call last):
  File "armoryd.py", line 1158, in
    rpc_server = Armory_Daemon()
  File "armoryd.py", line 852, in __init__
    self.lastChecked
AttributeError: 'Armory_Daemon' object has no attribute 'lastChecked'

Traceback (most recent call last):
  File "armoryd.py", line 1158, in
    rpc_server = Armory_Daemon()
  File "armoryd.py", line 852, in __init__
    self.lastChecked
AttributeError: 'Armory_Daemon' object has no attribute 'lastChecked'


Which seems to be more Armory specific.

It is. To be honest, armoryd basically won't work out of the box if you download the latest version. I had to fix at least two or three bugs before armoryd even ran at all, and I think other team members fixed a bug or two. I don't know what happened. It just fell out of sync with the rest of Armory, I guess.

That being said, the latest version works great. There are a few rough edges and a couple of bugs that need to fixed before it gets released, but trust me, it'll be a much smoother experience. Smiley
member
Activity: 93
Merit: 10
Ok I fixed the txjsonrpc problem.

1) sudo apt-get install python-setuptools
2) sudo easy_install txJSON-RPC

The second command must be run IN the armory directory. Now the error I get is:

root@cloud-server-07:/BitcoinArmory# python armoryd.py
(ERROR) Traceback (most recent call last):
  File "armoryd.py", line 1158, in
    rpc_server = Armory_Daemon()
  File "armoryd.py", line 852, in __init__
    self.lastChecked
AttributeError: 'Armory_Daemon' object has no attribute 'lastChecked'

Traceback (most recent call last):
  File "armoryd.py", line 1158, in
    rpc_server = Armory_Daemon()
  File "armoryd.py", line 852, in __init__
    self.lastChecked
AttributeError: 'Armory_Daemon' object has no attribute 'lastChecked'


Which seems to be more Armory specific.
member
Activity: 93
Merit: 10
I cloned the repo to BitcoinArmory directory. But I still get

Code:
root@cloud-server-07:/BitcoinArmory# python armoryd.py
Traceback (most recent call last):
  File "armoryd.py", line 55, in
    from txjsonrpc.auth import wrapResource
ImportError: No module named txjsonrpc.auth

I'm guessing I need to install it but I could not figure out how to do that.
 

You're probably cloning the master branch, which doesn't have any of the new armoryd code. You need to clone the devel branch to get all the new armoryd code. Just be aware that it is a work-in-progress. Various things may be incomplete or completely broken.

All I need is to be able to get the balance. So I think the version on the master branch will be fine?

The only problem I have right now is to get armoryd.py to find txjsonrpc.auth module.

Traceback (most recent call last):
  File "armoryd.py", line 55, in
    from txjsonrpc.auth import wrapResource
ImportError: No module named txjsonrpc.auth


I'm probably going to run into some other issues after I solve it but still...
sr. member
Activity: 255
Merit: 250
Senior Developer - Armory
I cloned the repo to BitcoinArmory directory. But I still get

Code:
root@cloud-server-07:/BitcoinArmory# python armoryd.py
Traceback (most recent call last):
  File "armoryd.py", line 55, in
    from txjsonrpc.auth import wrapResource
ImportError: No module named txjsonrpc.auth

I'm guessing I need to install it but I could not figure out how to do that.
 

You're probably cloning the master branch, which doesn't have any of the new armoryd code. You need to clone the devel branch to get all the new armoryd code. Just be aware that it is a work-in-progress. Various things may be incomplete or completely broken.
member
Activity: 93
Merit: 10
I cloned the repo to BitcoinArmory directory. But I still get

Code:
root@cloud-server-07:/BitcoinArmory# python armoryd.py
Traceback (most recent call last):
  File "armoryd.py", line 55, in
    from txjsonrpc.auth import wrapResource
ImportError: No module named txjsonrpc.auth

I'm guessing I need to install it but I could not figure out how to do that.
 
sr. member
Activity: 255
Merit: 250
Senior Developer - Armory
How can I install txjsonrpc on the BitcoinArmory directory?

Hi. As part of my ongoing cleanup of armoryd, I grabbed a copy of txjsonrpc and am now distributing it along with Armory. If anybody can't wait for the next version of Armory and wants to do what I did, https://github.com/etotheipi/BitcoinArmory/commit/5a75164e90e9898cddf66d13199744e8d94b873b has the details.

Speaking of armoryd, I've added quite a bit of functionality over the past couple of weeks. armoryd is still rough around the edges but is quickly becoming a pretty useful tool. Feel free to check it out, with the caveat that there's still plenty to do and that any version you download now definitely won't be the version that goes into Armory 0.92. (In fact, I'll be checking in some more lockbox functionality in the next hour or two.)
member
Activity: 93
Merit: 10
How can I install txjsonrpc on the BitcoinArmory directory?
newbie
Activity: 23
Merit: 0
Hi!

I noticed that some transactions are not getting to mainbranch, and for this reason the Tx never gets confirmed.
At this moment I dont know why it happens. Over 25.000 transactions on Testnet and maybe 50 cases on which happens the mainbranch issue.

Is there a way to detect the "scrap" items on armory core?
At this moment the one and only working solution I got is to restart the watching only wallet service.
After restarting armory service the TxId just dissapears and I mark them as "Scrap" in database and reissue the Tx creating a new one.


Is there a way to ask Armory core if the transaction is really a "scrap" item?
And how can it happen that the Tx does not get into the Mainbranch? (all tests are done over testnet so far)

Best regards
legendary
Activity: 1428
Merit: 1093
Core Armory Developer
I am a bit confused, Why does armory run bitcoind in the background and what is the use of armory daemon?

If you don't know the answer to that question, you should probably spend some time with the Armory GUI to understand the vast functionality provided by Armory.   Especially the offline wallets.  Most people are interested in armoryd because of the ease with which you can create watching-only wallets to put on your webserver, and keep the private keys on an offline computer.

Armory uses Bitcoin Core solely for communicating with the Bitcoin network, peer finding, and blockchain validation.   Armory provides 100% new wallet infrastructure to provide deterministic wallets (only needeing to be backed up one time), plethora of backup features, the ability to manage multiple wallets at once, and the ability to manage wallets created offline but still monitor the wallet activity and distribute payment addresses from an online computer.
 
Armory uses the filtered datastream provided from Bitcoin Core, since no other software can reliably and securely replicate the validation/verification behavior of Bitcoin Core (if you use something else, you risk getting forked).   Armory doesn't even try to do blockchain validation -- that's Core's job.  Therefore you need to run both, and Armory watches the blk*.dat files from Core and the tx messages that are sent over P2P.
newbie
Activity: 30
Merit: 0
I am a bit confused, Why does armory run bitcoind in the background and what is the use of armory daemon?
newbie
Activity: 30
Merit: 0
Its the work I'm afraid  I will have to do if I'm to use armory for our exchange. Etotheipi mentioned some where it requiring some work. The transaction format is the same across coins only the hashing algorithm changes from sha256 to scrypt?
Indulge me what makes you say its a lot of work?

I'm basing that assessment on this thread in github https://github.com/etotheipi/BitcoinArmory/issues/32

Wondering if etotheipi can chime in, why does the hashing function need changing for ltc if I am just using armory wallets for storing coins. or are wallets and hashing function connected together?

Can armory not use the coin daemon (litecoin daemon via rpc calls ) and manage offline wallets that way. I can modify armory to convert the unsigned tx to work with armory's offline signing and then all should be good?
full member
Activity: 123
Merit: 100
Its the work I'm afraid  I will have to do if I'm to use armory for our exchange. Etotheipi mentioned some where it requiring some work. The transaction format is the same across coins only the hashing algorithm changes from sha256 to scrypt ? 
Indulge me what makes you say its a lot of work ?

I'm basing that assessment on this thread in github https://github.com/etotheipi/BitcoinArmory/issues/32
newbie
Activity: 30
Merit: 0
Its the work I'm afraid  I will have to do if I'm to use armory for our exchange. Etotheipi mentioned some where it requiring some work. The transaction format is the same across coins only the hashing algorithm changes from sha256 to scrypt ? 
Indulge me what makes you say its a lot of work ?
full member
Activity: 123
Merit: 100
OK armory would need to be modified and recompiled. Can Armorybe modified to create wallets for a coin type ? So I want multiple wallets maybe one wallet per coin type.  

No need to recompile since armoryd is written in Python.

Modifying Armory to run with different crypto currencies requires a lot of work.
newbie
Activity: 30
Merit: 0
OK armory would need to be modified and recompiled. Can Armorybe modified to create wallets for a coin type ? So I want multiple wallets maybe one wallet per coin type. 
full member
Activity: 123
Merit: 100

I need to figure out how to use bitcoind and armory offline wallets together via json rpc or some other method.
I think this is the post I am looking for  https://bitcointalksearch.org/topic/solved-made-script-signing-raw-transactions-from-bitcoind-with-armory-448284
this is able to convert a signedtransaction from bitcoind into something armory can sign in offline mode. correct me if i am wrong?


Assuming you mean that  you want to convert an "unsigned transaction" for armory to sign. Yes, you can do this with a bit of coding in armoryd.

Take whatever raw transaction hex from bitcoind and use the unserialize method on the appropriate object to get an Armory object. You probably want PyTx or PyTxDistProposal. Note that in the devel branch (and others) PyTxDistProposal is renamed UnsignedTransaction. So whatever the code base you're using look for the appropriate object and call unserialize on it.
newbie
Activity: 30
Merit: 0
Armory unsigned transactions are different.  It's because they store all the extra data needed for the offline computer to verify the transaction without the blockchain.  It can be a lot of data, but required to maximize security. 

On the other hand, you might be able to go the other way, but you'd have to build some helper functions to convert a raw unsigned transaction from bitcoind, to collect all the blockchain data that is needed for Armory to verify the tx before signing.  Armory assumes all transactions will always be signed by a dumb device with no blockchain -- there is no alternative form.

This is not standardized in any way.  Maybe one day it will be.

Ok I am actually trying to build an exchange and the idea is to have cold warm and hot wallets. The cold would be using offline armory and the hot would be using online armory. The warm wallet will be built using either armory daemon or bitcoind.  I didnt know armory daemon was not complete. So like you explained, I can use bitcoind and then before sending the unsigned transaction to cold storage, I would need add extra data to the transaction.

What about signing a transaction, can that be done using bitcoind or do i need to implement a command specific to  armory's requirements?


I'm not sure what you're asking with the last question.  If you are signing with bitcoind (can it do offline signing?) then you can just broadcast it with any network-connected app once you get it back online.  Armory's default is to pass in this decorated-unsigned-tx, and return the same decorated-signed-tx to the online computer.  That Armory instance will "prepareFinalTx().serialize()" which converts the decorated-tx to a byte string appropriate to be sent over the wire.

Btw, we do have many users leveraging armoryd as their backend, it just requires a bit of work to fill in the gaps.  One of the nice things about armoryd.py is that it's pretty easy to adapt it to whatever you need to do:  there's a clear place to put code everytime a new tx comes in, everytime a new wallet-relevant tx comes in, and every new block.  You don't have to operate through RPC, you can just program your hooks directly in.

I need to figure out how to use bitcoind and armory offline wallets together via json rpc or some other method.
I think this is the post I am looking for  https://bitcointalksearch.org/topic/solved-made-script-signing-raw-transactions-from-bitcoind-with-armory-448284
this is able to convert a signedtransaction from bitcoind into something armory can sign in offline mode. correct me if i am wrong?
Pages:
Jump to: