Bitcoin Forum
May 25, 2024, 11:51:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Sign raw transaction testnet3 issue  (Read 683 times)
init1 (OP)
Jr. Member
*
Offline Offline

Activity: 43
Merit: 1


View Profile
June 30, 2015, 04:07:28 PM
 #1

Hello

I am trying to use RCP with native client + testnet3

Prepared and create raw transaction


Code:
        //We save the txid and output -> bitcoin-cli -regtest getnewaddress
        String newAddress = getApi().getNewAddress();

        //bitcoin-cli -regtest createrawtransaction
        List<Output> outputList = getApi().listUnspent();
        String raw = getApi().createRawTransaction(outOverview(outputList.get(0)), destination());

        //bitcoin-cli -regtest decoderawtransaction
        //Use the decoderawtransaction RPC to see exactly what the transaction we just created does.
        RawTransactionOverview rawTransactionOverview = getApi().decodeRawTransaction(raw);

have got valid data after decodeRawTransaction

Code:
RawTransactionOverview(super=Entity(),
txId=386f447310db1eea491291d67f21d310ff586fe3367d7c7e5a4ad56e7683e178,
version=1,
lockTime=0,
vIn=[RawInput(super=Entity(),
txId=70422d040ea45a546dc60e7d5a6aa0d03e92ed7597ca261da48f52eb6d882011,
vOut=1,
scriptSig=SignatureScript(super=Entity(),
asm=,
hex=),
coinbase=null,
sequence=4294967295)],
vOut=[RawOutput(super=Entity(),
value=0.00010000,
n=0,
scriptPubKey=PubKeyScript(super=SignatureScript(super=Entity(),
asm=OP_DUPOP_HASH16068b38e95592fbee924899b8264b0391d638e41a6OP_EQUALVERIFYOP_CHECKSIG,
hex=76a91468b38e95592fbee924899b8264b0391d638e41a688ac),
reqSigs=1,
type=ScriptTypes(name=pubkeyhash),
addresses=[mq4Zfqjo9tB25jwJRc3NQPExk4mwsFRwQQ]))])
   

Try to sign tx.

Code:
SignatureResult signatureResult = getApi().signRawTransaction(raw);

bitcoind freezes. I am waiting for response ...

Any advice ?

Regards!
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
June 30, 2015, 06:00:50 PM
 #2

Haven't tried this myself, but I'd check `top' to see if it's working hard (not actually frozen) and maybe there's some info in debug.log if it actually did crap out on you.

Also, I'm following-up here for my own info.  is RCP different from RPC (remote procedure control).  And what you wrote doesn't look like the typical rpc commands, it looks like Java to me.  I'm sure I'm missing something, thanks!
init1 (OP)
Jr. Member
*
Offline Offline

Activity: 43
Merit: 1


View Profile
July 01, 2015, 07:14:00 AM
 #3

yes you are right. it is Java RCP open source library.
I have checked same operation into QT console. All works well.
Does bitcoin has some additional RCP WEB services ?
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
July 01, 2015, 02:44:43 PM
 #4

yes you are right. it is Java RCP open source library.
I have checked same operation into QT console. All works well.
Does bitcoin has some additional RCP WEB services ?

I think that in a newer version of bitcoin-core you can use XML rather than JSON RPC commands.  Do you keep saying RCP as a typo?  Or is that distinct from RPC?

If you find that you can send the commands via command-line then it seems like the issue is in your Java package.  Can you print the output of your Java program to stdout so that you can see that it's well formed?  Also, it sounds like it's not bitcoind that freezes but your Java program.  I think you need to disentangle the layers of control here in order to get somewhere on debugging.
Pages: [1]
  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!