Post
Topic
Board Armory
Re: Armory - Discussion Thread
by
etotheipi
on 21/01/2013, 05:42:06 UTC
Testing the armoryd branch...and armoryd...  Wink

Setting up a watch-only wallet and make a php jsonrpc call works!
Now testing the process of getting unsigned transactions.

I have some troubles to add a additional watch-only wallet to armoryd.
I get this error after the notification 'Another instance of armoryd.py is already runnning!':
Code:
~/BitcoinArmory$ {
    "error": {
        "errortype": "exceptions.ValueError",
        "extrainfo": "No JSON object could be decoded",
        "jsoncommand": "armory_abc_.watchonly.wallet",
        "jsoncommandargs": []
    }
}

It looks like I have to put in some extra arguments to make a second armoryd work with another watch-only.
I can't find what the arguments should be. (has it something to do with: AuthServiceProxy  def __call__(self, *args) ??)
Also I suspect armoryd does not except more arguments (your code states: # The only argument that armoryd.py takes is the wallet to serve)

Please let me know where to find some clues to get a second watch-only armoryd running.
I'm also wondering how the jsonrpc call is made. Is it to a different RPC_PORT? If not, how do I make a jsonrpc call to a specific wallet? If so, how do I know the rpc_port's of all wallets running?

I'm also wondering if it is possible to make use of the authentication of the (proxy) service to identify a wallet/user from the (php) jsonrpc. (otherwise I have to make a authentication for a wallet/user before the (php) jsonrpc call's could be done)

The JSON-RPC interface is still a work in progress.  I haven't really ironed out things like this yet.  But I can give you some workarounds, as long as you promise not be upset when it changes later Smiley

Specifically, I will be making armoryd.py multi-wallet, just like ArmoryQt is.  It will load all wallets in a given directory, and you will be able to "selectwallet", "getwalletinfo", "sendfromwallet", etc.   Until then, I guess you'll just have to run multiple copies.

So first thing to do is that armoryd.py detects itself via the --rpcport option.  I forget the default but you should be able to start more instances by changing that value.  If you run armoryd.py on the same port as another one that's already open, it switches from "start-server" mode to "pass-CLI-arguments-to-existing-server" mode.  It reads the /home/user/.armory/armoryd.conf file for authentication info, opens a connection with it through the port, then it passes the command line arguments to it as a native JSON-RPC call.  It receives the response, prints it out, and disconnects.  After all... if they could somehow listen on the same port, how would PHP know which one it was talking to? 

I think the last part is answered by my multi-wallet answer.  If you have recommendations for how to accommodate multi-wallet armoryd that more intelligently, I'm happy to entertain it!