GithubHelp home page GithubHelp logo

bchmemo's Introduction

BCHmemo

A python package for memo. Memo is an on-chain social network built on Bitcoin Cash

Memo's original website: htttp://memo.cash

You can easily send and read memo with BCHmemo. Data are get and sent by network API.

Based on bitcash.

Installation

$ pip install bchmemo

V0.0.3

Action of "reply to memo" supported

>>> user = MemoUser('bitcoincash:qqplzy4l2uxzwa5k3zc2mftkw3q6340a4cfy4kd3nf')
>>> user.private_key = 'PRIVATEKEY'
>>> user.reply_to_memo('b2d072076b4eb462341775792e769a1eecf085091567ad15f18c3ec7fd3a3401','reply test')
Successfully sent! txid=21083c0730b25f8cb0831e76db1cf099d30ea811079e05a2bcb8b63fe3770913
Check it on: https://explorer.bitcoin.com/bch/tx/21083c0730b25f8cb0831e76db1cf099d30ea811079e05a2bcb8b63fe3770913

>>> user.get_memos()
>>> user.list_replies()
bchmemo V0.0.3 (a Python package)@...4kd3nf replied to memo(b2d072076b4eb462341775792e769a1eecf085091567ad15f18c3ec7fd3a3401) at 2018-04-26 14:12:00
reply test

How to use

>>> from bchmemo import MemoUser

>>> user = MemoUser('bitcoincash:qqplzy4l2uxzwa5k3zc2mftkw3q6340a4cfy4kd3nf')
>>> user.private_key = 'PRIVATEKEY'

>>> user.set_name('Test User For Python Package')
Successfully sent! txid=d8c9d05ffefd5211353b3ef7b47ede424d3b78f7f1a4911d5d8792ae35072c04
Check it on: https://explorer.bitcoin.com/bch/tx/txid=d8c9d05ffefd5211353b3ef7b47ede424d3b78f7f1a4911d5d8792ae35072c04

>>>user.post_memo('First memo from python package!')
Successfully sent! txid=1f84551778197aae7ea82dced737d4ef644b9517e91cc867a354a1aad55f9b09
Check it on: https://explorer.bitcoin.com/bch/tx/1f84551778197aae7ea82dced737d4ef644b9517e91cc867a354a1aad55f9b09

>>>user.follow('bitcoincash:qzdxp2z5yuxzlskafh2d8wsq7grg7rt46csg3qcn80')
Successfully sent! txid=8d95e27eb1df5c4d97446fda69baab3fa7df568131252d2685d7c3203c366fe1
Check it on: https://explorer.bitcoin.com/bch/tx/8d95e27eb1df5c4d97446fda69baab3fa7df568131252d2685d7c3203c366fe1

>>>user.like_memo('f0e24cbeb7d5cebc1577d76385892c0f28d50d34f24729981617c64441329de5')
Successfully sent! txid=262fd91e68381e1d32a6b5d93b8d672d12117588efadaa02e603aaf6253728ee
Check it on: https://explorer.bitcoin.com/bch/tx/262fd91e68381e1d32a6b5d93b8d672d12117588efadaa02e603aaf6253728ee

>>>user.get_memos()
>>>user.list_memos()
Test User For Python Package@...4kd3nf posted at 2018-04-25 02:31:49
First memo from python package!

Liked  (f0e24cbeb7d5cebc1577d76385892c0f28d50d34f24729981617c64441329de5) at 2018-04-25 02:31:49

following:
3qcn80 bitcoincash:qzdxp2z5yuxzlskafh2d8wsq7grg7rt46csg3qcn80

If you want to generate private keys, you can use bitcash from sporestack

Credits

bchmemo's People

Contributors

remem9527 avatar

Stargazers

Proteus avatar ampm avatar [sCRiPTz-TEAM] avatar Jason Chavannes avatar Laeeth Isharc avatar Gui Zhen Wei avatar  avatar Guoyu Hao avatar

Watchers

Eamon McDermott avatar Guoyu Hao avatar  avatar

bchmemo's Issues

ConnectionError: All APIs are unreachable.

Trying a pretty simple test case:

from bchmemo import MemoUser
user=MemoUser('bitcoincash:used an address here')
user.private_key = 'used WIF Compressed here'
user.get_memos()

Gets
Traceback (most recent call last):
File "get_posts.py", line 5, in
user.get_memos()
File "/home/my_dir/.local/lib/python3.6/site-packages/bchmemo/memouser.py", line 61, in get_memos
total_txs,txs=NetworkAPI.get_transactions_by_addresses(self._address)
File "/home/my_dir/.local/lib/python3.6/site-packages/bchmemo/bitcash_modified/services.py", line 575, in get_transactions_by_addresses
raise ConnectionError('All APIs are unreachable.')
ConnectionError: All APIs are unreachable.

Is this package abandoned?

user.post_memo() throws an error: sanitize_tx_data() got an unexpected keyword argument 'custom_pushdata'

I got the below error when trying to post a memo. I got a similar error when I tried to use set_name().

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\bchmemo\memouser.py", line 163, in post_memo
    return self.__send_new_memo(memo)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\bchmemo\memouser.py", line 140, in __send_new_memo
    memo.create_signed_transaction(self._private_key)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\bchmemo\memo.py", line 453, in create_signed_transaction    self.signed_transaction=pk.create_transaction(message=data_bytes,outputs=self.transfer,fee=MIN_TRANSFER_FEE,leftover=leftover)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\bitcash\wallet.py",  line 250, in create_transaction
    custom_pushdata=custom_pushdata
TypeError: sanitize_tx_data() got an unexpected keyword argument 'custom_pushdata'```

user.post_memo('sth') throws an error: 'Specify rawtx parameter'

I'm following the example from the readme, but when I try posting a memo, I keep getting this error:

>>> user.post_memo('sth')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/memo/bchmemo/memouser.py", line 150, in post_memo
    return self.__send_new_memo(memo)
  File "/tmp/memo/bchmemo/memouser.py", line 128, in __send_new_memo
    txid=memo.send_transaction()
  File "/tmp/memo/bchmemo/memo.py", line 396, in send_transaction
    NetworkAPI.broadcast_tx(self.signed_transaction)
  File "/tmp/memo/bchmemo/bitcash_modified/services.py", line 657, in broadcast_tx
    success = api_call(tx_hex)
  File "/tmp/memo/bchmemo/bitcash_modified/services.py", line 114, in broadcast_tx
    raise Exception(r.content)
Exception: b'Specify rawtx parameter'
>>>

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.