Good afternoon. I'm trying to implement the "Status" at the moment. I use the library Web3.shh. I sent the message and gives the answer "True", but I can not receive all the messages on the other address. In the documentation of the Ethereum and in the documentation "Status" I did not find any answers. Tell me how to correctly pull messages from the Geth at? Here's the code:
from web3 import shh
from web3 import HTTPProvider, Web3
status_host = 'https://host:port''
privatekey = '0x....7f2afa922ffdbeac65867f544a....'
connect = Web3(HTTPProvider(status_host))
print('connect status ===> ', connect.isConnected())
ms = shh.Shh(connect)
print('info ===>>>> ', ms.info)
id = ms.addPrivateKey(key=privatekey)
print('id ===>>>> ', id)
user_address = ms.getPublicKey(id)
print('user_address ===>>> ', user_address)
privkey = ms.getPrivateKey(id)
print("privkey => ", privkey)
topic = Web3.toHex(b'AS')
print("topic => ", topic)
text = 'test message'
address_to = '0x0487be55c072702a0e4da72158a7432281e8c26aca9501cd0bfeea726dc85f2611e96884e8fc4807c95c04c04af3387b83350a27cc18b96c37543e0f9a41ae47b5'
mes_send = ms.post(
{
'ttl': 20,
'payload': Web3.toHex(text=text),
'pubKey': address_to,
'topic': topic,
'powTarget': 2.5,
'powTime': 2,
}
)
if mes_send == True:
print('Status message => Send')
else:
print('Message not send')