Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shh_getFilterMessages always returns empty array #4

Open
kclowes opened this issue Apr 3, 2019 · 5 comments
Open

shh_getFilterMessages always returns empty array #4

kclowes opened this issue Apr 3, 2019 · 5 comments

Comments

@kclowes
Copy link

kclowes commented Apr 3, 2019

  • Parity Ethereum version: 2.2.11
  • Operating system: MacOS
  • Installation: homebrew
  • Fully synchronized: yes
  • Network: dev
  • Restarted: no

Parity client running with the following options:
parity --config dev -lrpc=trace --whisper

When running the following snippet from web3.py:

from web3.auto import w3 
from web3.shh import Shh 
shh = Shh(w3) 
kp = shh.newKeyPair()
pubkey = shh.getPublicKey(kp)
privkey = shh.getPrivateKey(kp)
flt = shh.newMessageFilter({'topics': ['0x12345678'], 'privateKeyID': kp})
shh.post({ 
             'from': kp,
             'payload': w3.toHex(text="This is a test!"),
             'to': {'public': pubkey}, 
             'topics': ['0x12345678'],
             'priority': 1000, 
             'ttl': 100, 
}) 
received_messages = shh.getMessages(flt.filter_id)

received_messages which calls shh_getFilterMessages under the hood, comes back with an empty result ({"jsonrpc":"2.0","result":[],"id":14}.), even though there should be a message. Any hints would be awesome! Thanks!

@jam10o-new
Copy link

I'm not sure you can receive messages you send yourself, from what I understand of whisper. Whisper builds a filter of messages it's seen before as it runs and ignores them; if that includes the messages it's sent, seeing an empty result would make sense - can you try sending and receiving from different nodes?

@kclowes
Copy link
Author

kclowes commented Apr 3, 2019

Thanks for the quick response! Yeah, the same thing happens with:

from web3.auto import w3 
from web3.shh import Shh 
shh = Shh(w3) 
skp = shh.newKeyPair()
spubkey = shh.getPublicKey(kp)
sprivkey = shh.getPrivateKey(kp)
rkp = shh.newKeyPair()
rpubkey = shh.getPublicKey(rkp)
rprivkey = shh.getPrivateKey(rkp)
flt = shh.newMessageFilter({'topics': ['0x12345678'], 'privateKeyID': rkp})
shh.post({ 
             'from': skp,
             'payload': w3.toHex(text="This is a test!"),
             'to': {'public': rpubkey}, 
             'topics': ['0x12345678'],
             'priority': 1000, 
             'ttl': 100, 
}) 
received_messages = shh.getMessages(flt.filter_id)

I don't know if it's helpful or not to add that both of this snippet and the original do return results using geth ¯_(ツ)_/¯

@jam10o-new
Copy link

I'm not sure whether creating a new key pair on the same node will be sufficient but it certainly should be - I'm sure you've noticed but parity-ethereum's whisper implementation is entirely incompatible with geth's 😅

@niklasad1 niklasad1 transferred this issue from openethereum/parity-ethereum Sep 16, 2019
@pepihasenfuss
Copy link

Since whisper is not any longer part of parity-ethereum and NOT included in parity 2.7.2, it means that whisper on parity is a dead-end street, right?
An easy-to-understand answer from someone here would be highly appreciated. Thank you.

@ordian
Copy link
Contributor

ordian commented Mar 10, 2020

@pepihasenfuss as you can see in the README https://github.com/OpenEthereum/whisper#deprecated, this project is no longer maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants