jgarzik / pyminer Goto Github PK
View Code? Open in Web Editor NEWPython miner for bitcoin
License: MIT License
Python miner for bitcoin
License: MIT License
#Pyminer This is a 'getwork' CPU mining client for bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner, for study. ##In order for this software to run you must build and run bitcoind from source on your computer.
It says "Missing username and/or password in cfg file"
How do I make a username and password
Hi,
I look at an issue raised against this project which I recall was for a PDF processing library, but this project is now a bitcoin miner?
Was the repo renamed and repurposed?
Line 26 in 3740e1a
To those who have the issue import httplib ImportError: No module named httplib
, FYI in Python 3
the module renamed to http.client
Read this >>>>>>>>>>>> The documnetation
Hope I did Help anyone <3
How would I connect this to btc core?
(Traceback):
line 179, in loop
rpc = BitcoinRPC(settings['host'], settings['port'],
KeyError: 'host'
4 mining threads started
Wed Jul 28 22:12:43 2021 Miner Starts - 193.29.105.150:3333
Wed Jul 28 22:12:43 2021 Miner Stops - 193.29.105.150:3333
config.cfg
#
# RPC login details
#
host=193.29.105.150
port=3333
rpcuser=Erik_V7
rpcpass=anything
#
# mining details
#
threads=4
# periodic rate for requesting new work, if solution not found
scantime=60
#
# misc.
#
# not really used right now
logdir=/tmp/pyminer
# set to 1, to enable hashmeter output
hashmeter=0
I've tried running this program, even the pyminer3 and just can't get it to work. Bitcoin has replaced getwork with getblocktemplate. I've tried to implement it to this program but just doesn't work.
So I'm trying to create a whole new CPU miner. Want to see if you guys can help or guide me in the right direction.
https://github.com/ORP967/BTC_RPC_Mining
I am able to connect to the rpc and retrieve the getblocktemplate information, but what do I do next?
Thanks in advance for your help.
how do I start mining
Where to put my BTC address?
I have a working miner that uses the current "getworktemplate" in python 3. It is a code from (https://github.com/vsergeev) that I changed to check for a new block every 20 sc or so and start mining again every time a new block is detected. Currently getting 1.01KH/s on a Dell.
./pyminer.py example-config.cfg
...
Process Process-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "./pyminer.py", line 207, in miner_thread
miner.loop()
File "./pyminer.py", line 203, in loop
self.iterate(rpc)
File "./pyminer.py", line 167, in iterate
work = rpc.getwork()
File "./pyminer.py", line 76, in getwork
return self.rpc('getwork', data)
File "./pyminer.py", line 56, in rpc
resp = self.conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1051, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 415, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 379, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
Would you be able to update this to python 3? Some things fixed (E.g Print() )
How to use it?
I'm a bit fluent in python, so I would like to practically start to study BTC mining from this project.
I'm opening this issue just to check If someone will reply to me, and in case help me to actually run it in case I'll get stuck.
Thank you in advance
Could we get some documentation for how this miner works in order to make it easier for people to study it?
Thanks!
How do I collect the bitcoins
i tried just running this to make sure it works and i got a errno 111. Any idea why?
terminal output below
Process Process-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "pyminer.py", line 207, in miner_thread
miner.loop()
File "pyminer.py", line 203, in loop
self.iterate(rpc)
File "pyminer.py", line 167, in iterate
work = rpc.getwork()
File "pyminer.py", line 76, in getwork
return self.rpc('getwork', data)
File "pyminer.py", line 54, in rpc
'Content-type' : 'application/json' })
File "/usr/lib/python2.7/httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 812, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 793, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 111] Connection refused
targetbin = targetbin[::-1] # byte-swap and dword-swap
I don't think that comment is correct there?
Process Process-1:
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\edast\Desktop\pyminer-master\pyminer.py", line 207, in miner_thread
miner.loop()
File "C:\Users\edast\Desktop\pyminer-master\pyminer.py", line 197, in loop
rpc = BitcoinRPC(settings['host'], settings['port'],
KeyError: 'host'
Process Process-2:
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\edast\Desktop\pyminer-master\pyminer.py", line 207, in miner_thread
miner.loop()
File "C:\Users\edast\Desktop\pyminer-master\pyminer.py", line 197, in loop
rpc = BitcoinRPC(settings['host'], settings['port'],
KeyError: 'host'
Traceback (most recent call last):
File "C:\Users\edast\Desktop\pyminer-master\pyminer.py", line 221, in
time.sleep(1) # stagger threads
KeyboardInterrupt
When I try run this code in my computer, I am getting this error:
Process Process-4: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) File "pyminer.py", line 207, in miner_thread miner.loop() File "pyminer.py", line 203, in loop self.iterate(rpc) File "pyminer.py", line 167, in iterate work = rpc.getwork() File "pyminer.py", line 76, in getwork return self.rpc('getwork', data) File "pyminer.py", line 56, in rpc resp = self.conn.getresponse() File "/usr/lib/python2.7/httplib.py", line 1136, in getresponse response.begin() File "/usr/lib/python2.7/httplib.py", line 453, in begin version, status, reason = self._read_status() File "/usr/lib/python2.7/httplib.py", line 417, in _read_status raise BadStatusLine(line) BadStatusLine: ''
the command I am running is this:
python pyminer.py example-config.cfg
In the configuration file, I use as rpcuser and rpcpassword, the username and password of the user I run the bitcoind.
I am using the version 2.7.12 of Python. I am not able to run this program with version 3.5.2 (I got the error:
File "pyminer.py", line 31 MAX_NONCE = 1000000L ^ SyntaxError: invalid syntax
before the program exits).
Make an opportunity to connect to the pool without password
When I run the code all it says is Usage: pyminer.py CONFIG-FILE. Do I just leave it open and does it just work like that.
Getting a ConnectionRefusedError: [Errno 111] Connection refused when trying to do 'test mining with this script' (python 3.5.2):
.
.
.
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
MAX_NONCE = 1000000L
is the code
This code is under which licence ?
It would be great if you can add that
thanks
I have used the miner and put the config command in the shell, but its says error: [Errno 111] Connection refused and ends it. Any help would be appreciated.
After coming across a PDF that appears to use a curious trick to 'emulate' bold (overwrite the same text with a very slight offset), I wondered if it would be possible to detect this in order to remove the duplicate that it causes in pyminer. Here is my quick solution:
@@ -638,6 +638,37 @@
assert len(plane) == 1
return list(plane)
+ def remove_faux_bold(self, textobjs):
+ "Quick, Messy function for POC faux-bold removal"
+ emap = dict()
+ for x in textobjs:
+ if not emap.has_key(x.fontname):
+ emap[x.fontname] = dict()
+ fn = emap[x.fontname]
+ # something to reduce our comparisons a little, by rounding co-ordinates,
+ if not fn.has_key(int(x.x0)):
+ fn[int(x.x0)] = list()
+ # we'll still need to check buckets either-side
+ if not fn.has_key(int(x.x0)+1):
+ fn[int(x.x0)+1] = list()
+ if not fn.has_key(int(x.x0)-1):
+ fn[int(x.x0)-1] = list()
+ sz = fn[int(x.x0)]
+ dupe = False
+ # check all nearby values of x0 for possible matches
+ for c in fn[int(x.x0)] + fn[int(x.x0-1)] + fn[int(x.x0+1)]:
+ if x._text.strip() == c._text.strip() \
+ and abs(x.x0-c.x0) < 1 \
+ and abs(x.y0-c.y0) < 1 \
+ and abs(x.x1-c.x1) < 1 \
+ and abs(x.y1-c.y1) < 1:
+ dupe = True
+ x._text = ''
+ break
+ if not dupe:
+ sz.append(x)
+ return textobjs
+
def analyze(self, laparams):
# textobjs is a list of LTChar objects, i.e.
# it has all the individual characters in the page.
@@ -646,6 +677,7 @@
obj.analyze(laparams)
if not textobjs:
return
+ textobjs = self.remove_faux_bold(textobjs)
textlines = list(self.group_objects(laparams, textobjs))
(empties, textlines) = fsplit(lambda obj: obj.is_empty(), textlines)
for obj in empties:
can you update miner? Please
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.