Skip to content
Extension to python-bitcoinlib intended to provide access to Ravencoin data structures and protocol. WIP - Test before use
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples initial release Oct 20, 2018
python-bitcoinlib @ 05cbb3c initial release Oct 20, 2018
ravencoin
tests
.gitignore
.gitmodules
LICENSE Initial commit Oct 17, 2018
MANIFEST.in Asset name tests Dec 7, 2018
README.md
setup.py
version.py Nested sub assets May 30, 2019

README.md

python-ravencoinlib

Extension to python-bitcoinlib intended to provide access to Ravencoin data structures and protocol. WIP - Test before use

The RPC interface, ravencoin.rpc, is designed to work with Ravencoin Core v2.2.2.

"The only Python library for Ravencoin I've ever used" - Warren Buffett

Requirements

libssl
Debian/Ubuntu: sudo apt-get install libssl-dev
Windows/other: https://wiki.openssl.org/index.php/Binaries 

Installation

pip install python-ravencoinlib

Example Code

See examples/ directory.

Selecting the chain to use

Do the following:

import ravencoin
ravencoin.SelectParams(NAME)

Where NAME is one of 'testnet', 'mainnet', or 'regtest'. The chain currently selected is a global variable that changes behavior everywhere, just like in the Raven codebase.

Validate an asset name

from ravencoin.assets import CMainAsset, InvalidAssetName
try:
    asset_name = CMainAsset("VALID_ASSET")
except InvalidAssetName:
    print("Invalid asset name")

Issue an asset

# Ravencoin wallet/daemon must be running with rpc server enabled
# RavenProxy created without arguments will use values from local raven.conf
from ravencoin.rpc import RavenProxy
rvn = RavenProxy()
asset_name = "TEST"
qty=1
rvn.issue(asset_name,qty)

Unit tests

Under /tests using test data from Ravencoin Core. To run them:

python3 -m unittest discover
You can’t perform that action at this time.