shh_post,发送一个whisper消息.
参数
- Object - whisper端口对象:
- from: DATA, 60 Bytes - (可选)发送人的身份。
- to: DATA, 60 Bytes - (可选)接收者的身份。当whisper将加密消息,以便只有接收者可以解密它。
- topics: Array of DATA - DATA主题数组,供接收方识别消息。
- payload: DATA - 消息的有效负载。
- priority: QUANTITY - 范围内的优先级整数 ...(?)。
- ttl: QUANTITY - 以秒为单位的整数时间。
params: [{
from: "0x04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a03e245533f97284d442460f2998cd41858798ddfd4d661997d3940272b717b1",
to: "0x3e245533f97284d442460f2998cd41858798ddf04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a0d4d661997d3940272b717b1",
topics: ["0x776869737065722d636861742d636c69656e74", "0x4d5a695276454c39425154466b61693532"],
payload: "0x7b2274797065223a226d6",
priority: "0x64",
ttl: "0x64",
}]
返回
- Boolean - 如果消息已发送,则返回true,否则返回false。
例子
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"shh_post","params":[{"from":"0xc931d93e97ab07fe42d923478ba2465f2..","topics": ["0x68656c6c6f20776f726c64"],"payload":"0x68656c6c6f20776f726c64","ttl":0x64,"priority":0x64}],"id":73}'
// Result
{
"id":1,
"jsonrpc":"2.0",
"result": true
}