Code Monkey home page Code Monkey logo

pyminer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyminer's Issues

Error

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

is it on

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.

mining

how do I start mining

Documentation?

Could we get some documentation for how this miner works in order to make it easier for people to study it?

Thanks!

target value calculations

    targetbin = targetbin[::-1] # byte-swap and dword-swap

I don't think that comment is correct there?

Not working

(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

Empty password

Make an opportunity to connect to the pool without password

Detection of faux/artificial bold

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:

Getting a conn error 111

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

BTC CPU MINER PYTHON 3

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.

Interested in study BTC mining

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

PDF library is now bitcoin miner?

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?

process problem

./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: ''

Pyminer doesn't work?

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


getblocktemplate

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.

Program fails to be executed

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).

error: [Errno 111] Connection refused

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.