Git Product home page Git Product logo

cryptokit's Introduction

cryptokit

Utilities for working with bitcoin (or altcoin) data structures. Decode raw transactions and build merkle trees or branches to confirm valid blocks. Includes basic tests that run against a running bitcoin (or litecoin, etc) instance and confirm that structures serialize/deserialize like the servers.

Full credit to sources that I've read/morphed/copied to create this package:

cryptokit's People

Contributors

devurandom avatar ericecook avatar icook avatar kaniini avatar luke-jr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cryptokit's Issues

get_bcaddress_version throws a casting error

2015-08-12 18:29:44,066 [StratumServer_STRAT_SCRYPT] [DEBUG] Data {u'params': [u' 1H62sfHUNArwqoSooT58UVLvHcxep6L5dM.2', u'X'], u'id': 203615, u'method': u'mining.authorize'} recieved on client 71c5c504
2015-08-12 18:29:44,066 [StratumServer_STRAT_SCRYPT] [INFO] Authentication request from 199.36.88.176 for username  1H62sfHUNArwqoSooT58UVLvHcxep6L5dM.2
2015-08-12 18:29:44,066 [StratumServer_STRAT_SCRYPT] [DEBUG] Registering worker name 2
Python int too large to convert to C long
 1H62sfHUNArwqoSooT58UVLvHcxep6L5dM Has Address Version: False
2015-08-12 18:29:44,067 [StratumServer_STRAT_SCRYPT] [DEBUG] Invalid address passed in, checking aliases against 1h62sfhunarwqosoot58uvlvhcxep6l5dm
2015-08-12 18:29:44,067 [StratumServer_STRAT_SCRYPT] [DEBUG] Falling back to donate key donate
2015-08-12 18:29:44,067 [StratumServer_STRAT_SCRYPT] [DEBUG] success response: {'error': None, 'id': 203615, 'result': True}
2015-08-12 18:29:44,067 [StratumServer_STRAT_SCRYPT] [DEBUG] Sending job id 02000000 to worker donate.2
2015-08-12 18:29:44,174 [StratumServer_STRAT_SCRYPT] [DEBUG] Data {u'params': [], u'id': 203616, u'method': u'mining.extranonce.subscribe'} recieved on client 71c5c504
2015-08-12 18:29:44,175 [StratumServer_STRAT_SCRYPT] [DEBUG] success response: {'error': None, 'id': 203616, 'result': True}
Traceback (most recent call last):
  File "/home/ahmed/powerpool/powerpool/server.py", line 24, in convert_username
    version = get_bcaddress_version(username)
  File "build/bdist.linux-x86_64/egg/cryptokit/base58.py", line 88, in get_bcaddress_version
    return _parse_address(str_address)[0]
  File "build/bdist.linux-x86_64/egg/cryptokit/base58.py", line 71, in _parse_address
    raw = b58decode(str_address, 25)
  File "build/bdist.linux-x86_64/egg/cryptokit/base58.py", line 54, in b58decode
    result = chr(long_value) + result
OverflowError: Python int too large to convert to C long

 1H62sfHUNArwqoSooT58UVLvHcxep6L5dM Has Address Version: False

Thats the output from powerpool. will fetch a traceback now

ImportError: No module named types

Setting up PowerPool on Debian 7.6.0, got all other dependencies ready and even installed Future from source to troubleshoot. Getting this error regarding cryptokit:

Traceback (most recent call last):
  File "/usr/local/bin/pp", line 9, in <module>
    load_entry_point('powerpool==0.5.1', 'console_scripts', 'pp')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/xdqadmin/source/powerpool/powerpool/main.py", line 19, in <module>
    from .monitor import MonitorWSGI, MinuteStatManager, SecondStatManager
  File "/home/xdqadmin/source/powerpool/powerpool/monitor.py", line 5, in <module>
    from cryptokit.block import BlockTemplate
  File "/usr/local/lib/python2.7/dist-packages/cryptokit/block.py", line 10, in <module>
    from .transaction import Transaction
  File "/usr/local/lib/python2.7/dist-packages/cryptokit/transaction.py", line 3, in <module>
    from future.builtins.types import newbytes
ImportError: No module named types

Tests are a mess

The tests were mostly created to confirm functionality and isolate bugs, but were never really cleaned up enough to be properly run as a suite. Some only run in Python 3.3, some only run in Python 2.7. Once I have the time cleaning them up and throwing it on TravisCI would be really nice.

Add a method to generate a dummy address

Given an address version, produce a valid test address. This can then be used with coinserver rpc method verifyaddress to confirm that the coinserver you're connected to is for the right currency.

bad exception from rpc call

Traceback (most recent call last):
  File "/home/isaac/programming/powerpool/powerpool/jobmanagers/monitor_network.py", line 404, in getblocktemplate
    'prevblock',
  File "/home/isaac/programming/cryptokit/cryptokit/rpc.py", line 173, in __call__
    return self._get_response(response)
  File "/home/isaac/programming/cryptokit/cryptokit/rpc.py", line 189, in _get_response
    raise CoinserverRPC(response['error'])
  File "/home/isaac/programming/cryptokit/cryptokit/rpc.py", line 110, in __init__
    url, auth = self.parse_url_string(service_url)
  File "/home/isaac/programming/cryptokit/cryptokit/rpc.py", line 139, in parse_url_string
    url = urlparse.urlparse(service_url)
  File "/usr/lib/python2.7/urlparse.py", line 142, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib/python2.7/urlparse.py", line 175, in urlsplit
    cached = _parse_cache.get(key, None)
TypeError: unhashable type: 'dict'

5369fdf

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.