Bitcoin Forum
June 29, 2024, 01:55:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Create transaction  (Read 1652 times)
Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
February 23, 2016, 08:45:48 AM
 #1

Hi all
I am running the Create transaction script, I want to create a transaction using this script instead of clicking the buttons on Armory Bitcoin wallet GUI, it seemed it had a lot of code that doesn't work but I have fixed most of it.
This is errors remain:
\______________________________________________________
(ERROR) Traceback (most recent call last):
  File "Unsigned.py", line 153, in <module>
    txdp = createTxFromAddrList(wlt, addrList, recipList, 100000, sendChangeTo)
  File "Unsigned.py", line 79, in createTxFromAddrList
    pprintUnspentTxOutList(utxoList, 'Available outputs: ')
  File "//BitcoinArmory/armoryengine/CoinSelection.py", line 164, in pprintUnspentTxOutList
    print '   ',str(utxo.getNumConfirm()).rjust(Cool,
  File "//BitcoinArmory/CppBlockUtils.py", line 931, in getNumConfirm
    def getNumConfirm(self, *args): return _CppBlockUtils.UnspentTxOut_getNumConfirm(self, *args)
TypeError: UnspentTxOut_getNumConfirm() takes exactly 2 arguments (1 given)
\_______________________________________________________________________________________________________________________

1. I can not find CppBlockUtils.py file

If I run this script again I get:
2. Segmentation fault (core dumped)

and it also presents this error:

(ERROR) Traceback (most recent call last):
  File "Unsigned.py", line 153, in <module>
    txdp = createTxFromAddrList(wlt, addrList, recipList, 100000, sendChangeTo)
  File "Unsigned.py", line 66, in createTxFromAddrList
    unspentTxOuts = walletObj.getAddrTxOutList(addr160, 'Spendable')
  File "/home/buildmds/Documents/BitcoinArmory/armoryengine/PyBtcWallet.py", line 52, in inner
    return func(*args, **kwargs)
  File "//BitcoinArmory/armoryengine/PyBtcWallet.py", line 481, in getAddrTxOutList
    return cppAddr.getSpendableTxOutList(IGNOREZC);
  File "//BitcoinArmory/CppBlockUtils.py", line 1971, in getSpendableTxOutList
    def getSpendableTxOutList(self, ignoreZC=True): return _CppBlockUtils.ScrAddrObj_getSpendableTxOutList(self, ignoreZC)
3. RuntimeError: Cannot start transaction without db env

Has anybody encountered this error, or has the updated and working version of Createtransaction.py

Thank you for your help

goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
February 23, 2016, 05:38:45 PM
 #2

If you can reproduce this error in my dev branch, I'll get it fixed for the upcoming release.

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
February 24, 2016, 09:13:46 AM
 #3

That would be awesome_okay, but how do I do it, please share the steps?
:-)
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
February 24, 2016, 05:13:50 PM
 #4

Pull dev from my repo, build and try.

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
February 25, 2016, 08:38:00 AM
Last edit: February 25, 2016, 09:23:31 AM by Nelzat
 #5

Goatpig, the dev branch you relating to is the one in Github forked from etotheipi right?
If that is it, it still has not changed. Still the same script I have, and was edited 9 months ago. If I build and run it will it not give me the same errors and issues. If you run it? does it produce the required result? Which is an unsigned transaction.
achow101
Staff
Legendary
*
Offline Offline

Activity: 3444
Merit: 6721


Just writing some code


View Profile WWW
February 25, 2016, 12:46:29 PM
 #6

Have you compiled the software? There are c++ things that armory uses and those need to be compiled. It looks like you may not have compiled it.

goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
February 25, 2016, 05:52:39 PM
 #7

Code:
def getSpendableTxOutList(self, ignoreZC=True): return _CppBlockUtils.ScrAddrObj_getSpendableTxOutList(self, ignoreZC)

That's your error. Anything from CppBlockUtils is C++ code. That has drastically changed in my repo.

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
February 26, 2016, 08:07:09 AM
 #8

I see, so this means If i pull your dev branch, if I build and compile, it is going to be like I am reinstalling armory,?
Just want to make sure I understand...

And thank you so much for taking your time to respond.
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
February 26, 2016, 05:23:03 PM
 #9

I see, so this means If i pull your dev branch, if I build and compile, it is going to be like I am reinstalling armory,?
Just want to make sure I understand...

You won't be reinstalling Armory, you'll be using a different binary you built yourself, for the purpose of trying to reproduce this bug with my code.

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 07, 2016, 02:25:16 PM
 #10

hi GoatPig

It seems the problem is in this line,

unspentTxOuts = walletObj.getAddrTxOutList(addr160, 'Spendable')
      utxoList.extend(unspentTxOuts[:])

The error I am getting is a Segmentation fault (core dumped)

This is line 64 in createTxFromAddrList.py, the function getAddrTxOutList which is in PyBtcWallet.py line 469  is probably the one raising a flag,I am not sure.

goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
March 07, 2016, 06:17:43 PM
 #11

I'll try to get this fixed for the 2nd testing builds

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 07, 2016, 07:29:47 PM
 #12

Thank you so much. :-)
Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 08, 2016, 08:28:10 AM
 #13

Hi Goatpig

One last question, the last time we talked you said I need to initialize the DB first.
I am using TheBDM.GoOnline() to do this. Is this the right way?
It does not seem to be producing results.

I know I have used up a lot of your time, thank you for always responding.
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
March 08, 2016, 08:56:46 AM
 #14

Hi Goatpig

One last question, the last time we talked you said I need to initialize the DB first.
I am using TheBDM.GoOnline() to do this. Is this the right way?
It does not seem to be producing results.

I know I have used up a lot of your time, thank you for always responding.


1) register a wallet
2) TheBDM.goOnline()
3) wait on "db is ready" signal
4) do your stuff

If goOnline() fails, it means it failed to auto detect your db and blockchain folder paths. Force these with the command line arguments like you would for running Armory.

https://github.com/goatpig/BitcoinArmory/blob/master/extras/BDMbasics_listUTXOs.py

This is a pretty straight forward example on how to do this.

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 08, 2016, 09:04:48 AM
 #15

Alright thanks a lot.
Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 14, 2016, 01:13:19 PM
 #16

Hi there

I have tried the code to initiate the db, almost below every line in the creaTxFromAddList. where exactly do i initialize in the code?

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 17, 2016, 11:48:14 AM
 #17

fixed. finally  Wink
goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3682
Merit: 1347

Armory Developer


View Profile
March 17, 2016, 12:02:32 PM
 #18

Feel free to submit fixes to the example code as a PR =)

Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 18, 2016, 10:13:44 AM
 #19

hi GoatPig

Okay will do, gosh I probably need a tutorial on how to use github  Cheesy, but I will find my way.

I am currently broadcasting/ sending the transaction on Armory offline transactions, can I do it using python code instead?
Nelzat (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
March 30, 2016, 01:29:48 PM
 #20

Hi
Can I email the fixes to you so you can do update the script...?
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!