Bitcoin Forum

Bitcoin => Project Development => Topic started by: NewdayBTC on August 31, 2017, 09:48:40 PM



Title: How to use this Python program!?
Post by: NewdayBTC on August 31, 2017, 09:48:40 PM
Hello! I encountered this program and  I am wondering if anyone here can tell me how to use it correctly as I have never used python before.

The link to the code is here: https://github.com/petertodd/replace-by-fee-tools

If anyone could help, that would be great!

Thanks everyone!


Title: Re: How to use this Python program!?
Post by: btctousd81 on September 01, 2017, 05:35:54 AM
i hope you have basic knowledge of linux

first install

Code:
yum install git python pip
then you do

Code:
git clone https://github.com/petertodd/replace-by-fee-tools
then

Code:
cd replace-by-fee-tools
then

Code:
./bump-fee.py <txid>

e.g.
Code:
./bump-fee.py ac72df13e91b189f43b5cbe41f3f9f342391616bca553aafe04d219a665fced3

or

Code:
python bump-fee.py ac72df13e91b189f43b5cbe41f3f9f342391616bca553aafe04d219a665fced3


Title: Re: How to use this Python program!?
Post by: NewdayBTC on September 01, 2017, 06:05:38 AM
Thanks for the reply! I have done what you said and everything is working up until this point.

When i type in:
Code:
python doublespend.py

It gives me this error

Code:
Traceback (most recent call last):
  File "doublespend.py", line 10, in <module>
    import bitcoin.rpc
ImportError: No module named rpc

I have googled it and I cant find a module named bitcoin.rpc

I have already installed rpc (pip install rpc)



Any ideas?

Thanks a ton!


Title: Re: How to use this Python program!?
Post by: eternalgloom on September 01, 2017, 01:04:22 PM
Did you install libssl-dev first?

It is mentioned in the release notes that you should first install libssl-dev. Check if that fixes the problem.
I use a debian based distro, so for me it's: sudo apt-get install libssl-dev


Title: Re: How to use this Python program!?
Post by: NewdayBTC on September 01, 2017, 01:54:34 PM
Thanks for the reply! I am actually on a windows OS.

Do you think that I need a Linux Disto to run this program?

If not, how do I install libssl-dev on windows?


Title: Re: How to use this Python program!?
Post by: eternalgloom on September 01, 2017, 03:34:45 PM
Thanks for the reply! I am actually on a windows OS.

Do you think that I need a Linux Disto to run this program?

If not, how do I install libssl-dev on windows?
How did you follow all btctousd81's instructions when you're on Windows?

I mean, yum for example is a command line package manager for Linux distro's using RPM-based packaging, that shouldn't even work on Windows.

I'm pretty sure it's possible to run this on Windows, but everything in the documentation only includes instructions for installing it on Linux (Debian based distro's).

To run this on Windows, you might have to compile some of the dependancies yourself.

OR:

If you just want to apply RBF without having to run this python code, I'd suggest reading this article:
http://coinour.com/index.php/how-to-apply-replace-by-fee-to-save-the-bitcoin-transaction-fees/

You can just enable the option in Electrum ;)