Open lubokkanev opened 6 years ago
Seems to work if you revert to the upstream bitcash.network.services. In memo.py, replace it like so:
# from bchmemo.bitcash_modified.services import NetworkAPI
from bitcash.network.services import NetworkAPI
user.post_memo() works now, for messages with less than 75 symbols. For 150 I'm getting the following:
File "./create-memo-transaction-new.py", line 9, in <module>
user.post_memo("012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789") # 150-symbols
File "/mnt/x/Dropbox/source-code/java/projects/membo/bchmemo/memouser.py", line 151, in post_memo
return self.__send_new_memo(memo)
File "/mnt/x/Dropbox/source-code/java/projects/membo/bchmemo/memouser.py", line 129, in __send_new_memo
txid=memo.send_transaction()
File "/mnt/x/Dropbox/source-code/java/projects/membo/bchmemo/memo.py", line 398, in send_transaction
NetworkAPI.broadcast_tx(self.signed_transaction)
File "/usr/local/lib/python3.5/dist-packages/bitcash/network/services.py", line 341, in broadcast_tx
raise ConnectionError('Transaction broadcast failed, or '
ConnectionError: Transaction broadcast failed, or Unspents were already used.
I've changed the hardcoded limit to 217 symbols and made sure I have enough funds.
Also user.get_memos() fails with this:
File "./bchmemo/memouser.py", line 61, in get_memos
total_txs,txs=NetworkAPI.get_transactions_by_addresses(self._address)
AttributeError: type object 'NetworkAPI' has no attribute 'get_transactions_by_addresses'
get_transactions_by_addresses is in this repo's bitcash_modified\services.py, so looks like reverting to upstream isn't really a fix. Changes from upstream have to be merged (i.e. the CashExplorerBitcoinDotComAPI class).
I'm also seeing the "Transaction broadcast failed" error message, but this looks like an API failure. Perhaps the Insight API providers don't support BCH's new, longer OP_RETURN.
Yep, definitely an API issue. A long post_memo() leads to an error 400 with text: 64: scriptpubkey. Code:-26.
Switching the MAIN_ENDPOINT of one of the classes over to https://bch-insight.bitpay.com/api/ gives success, but it seems that they don't actually broadcast transactions that you send them.
Actually, I've tried submitting the raw_tx of a long message on several BCH sites, and I always get an error. Maybe the transaction generator has to be updated beyond changing the symbol limit to 217.
I'm following the example from the readme, but when I try posting a memo, I keep getting this error: