Giter Site home page Giter Site logo

python-mainsail's Introduction

python-mainsail

This package provides a simple implementation to interact with Ark blockchain API and managment tools for validators aiming to run a pool.

>>> from mainsail.tx.v1 import Transfer
>>> from mainsail import rest
>>> # http://xxx.xxx.xxx.xxx:4006/api/wallets/toons
>>> wallet = rest.GET.api.wallets.toons()
>>> wallet["address"]
'D5Ha4o3UTuTd59vjDw1F26mYhaRdXh7YPv'
>>> rest.GET.api.wallets()["meta"]["totalCount"]
89
>>> # use a custop peer
>>> custom_peer = rest.Peer("http://49.13.30.19:4006", port_name="api-development")
>>> custom_peer
{'ip': '49.13.30.19', 'ports': {'api-development': 4006}}
>>> # http://49.13.30.19:4003/api/transactions?type=4
>>> [t["blockId"] for t in rest.GET.api.transactions(type=4, peer=custom_peer)["data"]]
['41afebd995473aab76e8dd7415ab742a6882a08f4c0e0a7305d1a48c551c955c', 'aff37ad0288fadc9d5fdec584d1affab2df0021e86cde3ecb2ba263d6deba3cc']
>>> t = Transfer(1, 'D5Ha4o3UTuTd59vjDw1F26mYhaRdXh7YPv', 'message \U0001f919')
>>> t.sign()
Type or paste your passphrase >
>>> t.send()
{'data': {'accept': [0], 'broadcast': [0], 'excess': [], 'invalid': []}}

Linux distributions

Due to RIPEMD160 issue with OpenSSL v>=3, hashlib.ripemd160 is disabled within python3. To enable it back, get the installation folder...

openssl version -d

... and make sure that the openssl config file contains following lines:

openssl_conf = openssl_init

[openssl_init]
providers = provider_sect

[provider_sect]
default = default_sect
legacy = legacy_sect

[default_sect]
activate = 1

[legacy_sect]
activate = 1

Available transactions

  • Transfer
  • ValidatorRegistration
  • Vote
  • MultiSignature
  • MultiPayment
  • ValidatorResignation
  • UsernameRegistration
  • UsernameResignation

Features

  • secured private keys storage
  • secured webhook subscriptions storage
  • offline network configuration available
  • pool server with remote managment tool
  • cmd command line set_pool and dump_prk for windows platform
  • pool installation and update using pip

Support this project

Paypal me Bitcoin

python-mainsail's People

Contributors

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