-
Notifications
You must be signed in to change notification settings - Fork 68
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
PubSub #55
Comments
I guess this is in base64 because the answer is returned in JSON, and that can't handle arbitrary binary data? |
edit: I'm blind... I tried decoding the data value with multibase and it failed so IDK... Also, notice the = sign at the end, no multibase base have that char in their alphabet. |
Ok I was wrong there's no bug... I decoded the string but had to add a 'm' at the start to signify to multibase that it was base64 string. |
I don't know... I think base64 is part of the format of the request, maybe the library should decode it. |
The docs tell us that it should be base64. In reality it's base64 with padding. I used multibase crate with Base64Pad as setting. +1 for having the lib decode it, it's a little confusing right now. |
I had trouble here too, as did this StackOverflow poster. I was confused too. I started trying to decode the 'from' field but it kept failing. Until I realized that the decoded 'from' result is actually binary, and that the 'data' and 'seqno' were fine. This worked for me: String::from_utf8(multibase::decode(format!("M{}", s)).unwrap().1) |
I use this for the from field
and this for message
I hope it helps! |
Does anyone know what the |
Test it but I'm pretty sure it's the topic the message was send on. |
Hello!
I tried to send and receive messages locally but sending "hello world" I received "aGVsbG8gd29ybGQ=".
If I use the CLI ipfs pubsub sub It work as expected which makes me thing there's a bug somewhere.
I'll look around and see if I can fix it.
Otherwise great API!
The text was updated successfully, but these errors were encountered: