Git Product home page Git Product logo

pycoinnet's Introduction

pycoinnet -- Speaking the Bitcoin Protocol

The pycoinnet library is designed for use in conjunction with the Python pycoin library. It provides utilities and examples for writing tools in pure Python that speak the bitcoin protocol on the bitcoin network.

Note that it uses the new asyncio library included in Python 3.4 (and available from pypi in Python 3.3 -- type "pip install asyncio"), and so requires Python 3.3 or higher (unlike pycoin, which supports Python 2.7).

Install

Using virtual environments:

$ NEW_ENV=~/.virtualenv-pycoinnetwork # or whatever path you'd like to use
$ python3 -m venv $NEW_ENV
$ source $NEW_ENV/bin/activate

Note that venv may require Python 3.4. You should use Python 3.4.

Install Dependencies

Anyway, now install the dependencies.

$ pip install -r requirements.txt
$ pip install .

Nothing here really pycoinnet-specific except the dependency on pycoin.

Try the SPV Demo

$ mkdir -p ~/.wallet/default
$ echo 1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3 > ~/.wallet/default/watch_addresses  # first transaction ever, block 170
$ echo 1CaNHx4vzpmPBv4a6U7pcKQF6R8U6JeLUy >> ~/.wallet/default/watch_addresses # very common address starting block 258045
$ ku -ua 1 >> ~/.wallet/default/watch_addresses # address for secret exponent 1
$ PYTHONPATH=`pwd` python pycoinnet/examples/wallet.py

This example will connect, then update its view of the blockchain, noting spendables that are paid to the addresses in ~/.wallet/default/watch_addresses. Check the source for more info. NOTE: it will probably display a lot of errors when it runs, as most of the initial peers, acquired via DNS, are down.

Future Direction

More work on the SPV wallet, and features to make it more reliable and more useful as a wallet.

Donate

Want to donate? Feel free. Send to 1KissEskteXTAXbh17qJYLtMes1B6kJxZj. Or hire me to do bitcoin consulting... [email protected].

pycoinnet's People

Contributors

erkan-yilmaz avatar knaperek avatar richardkiss avatar

Watchers

 avatar

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.