<jj>
I have a few questions regarding ifps pubsub if anyone wants to take a shot at it?
jj has quit [Client Quit]
jj has joined #ipfs
jj has quit [Client Quit]
jj_ has joined #ipfs
jj has joined #ipfs
jj_ has quit [Client Quit]
jj has quit [Client Quit]
warner has quit [Read error: Connection reset by peer]
warner has joined #ipfs
jj_ has joined #ipfs
jj has joined #ipfs
shizy has quit [Ping timeout: 268 seconds]
jj_ has quit [Client Quit]
jj has quit [Client Quit]
jj has joined #ipfs
<jj>
hello
<jj>
is anybody here?
<jj>
I'd like to ask a few questions about ipfs pubsub
kivutar has quit [Ping timeout: 264 seconds]
<jj>
how does one get it's output into a variable?
<TUSF>
If you're calling it through the command, you can run "ipfs pubsub sub <topic> --enc json"
<TUSF>
This will return the output as a JSON object that you can then parse as needed.
<jj>
omg!! thanks soo much! im going to try it out right now. literarly i got up this morning to tackle this problem. 12 hours later....
<jj>
kept trying to find how to suprocess.check_output() subprocess.Popen() etc,...
<TUSF>
It even tells you who sent the message and all
<TUSF>
Wait, I think "--enc json" should be before the <topic>, hah
<jj>
it works
<TUSF>
Gotcha
<jj>
but I guess my question would be how to get the output into a variable? when I call the command ipfs pubsub sub it never finishes the process
<TUSF>
Well, from where are you calling it?
<jj>
im using Python's ipfsapi to write a script that listens to a node publish
<jj>
so I've been tyring to do stuff liek this all day: proc = subprocess.Popen(["ipfs", "pubsub", "sub", "<topic>"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
<jj>
I never get any output
<TUSF>
Well, I don't know too much about python, but if you're piping stdout, is there a way to read from a pipe until a certain character?
<TUSF>
For example, at a new line?
kivutar has joined #ipfs
<jj>
....I dont know much aobut the subprocess modules, that's what Ive been tryignto research all day lol...stressed
<jj>
im sure there is an easy fix, I just haven't figured it out yet
<jj>
I didnt know that "--enc json" though, thanks for that, it will definlty come usefull
lord| has quit [Quit: WeeChat 2.1]
lord| has joined #ipfs
<TUSF>
Maybe try using open() on Popen.stdout? Should return a file object you can read from?
<jj>
im trying process = subprocess.Popen(["ipfs", "pubsub", "sub", "GofkZ9GO", "--enc json"], shell=True, stdout=subprocess.PIPE,
<jj>
it hangs on it. I never get any output to store in a variable
<jj>
it seems:$ipfs pubsub sub <topic> never ends the process
Sokol has joined #ipfs
ericxtang has quit [Remote host closed the connection]
pcardune has joined #ipfs
wolven has quit [Quit: Page closed]
ericxtang has joined #ipfs
<JCaesar>
Oooh. This is a python problem. There is no shell involved.
<jj>
well, then woudl you happen to know how I could achieve that through shell commands?
<JCaesar>
I'm not sure you mean by "shell comands" what I understand as "shell commands".
pcardune has quit [Ping timeout: 255 seconds]
<jj>
well, what Im trying to say is: when I run the command:$ipfs pubsub sub <topic> It will just hang there running the process if there is no subscription
<JCaesar>
That sounds either like a bug or like you don't understand what ipfs pubsub sub will do.
<JCaesar>
It is supposed to "hang".
<jj>
I'd like to store the output of $ipfs pubus sub <topic> somehow, but the process never ends for me to be able to "store" or get the result output
<JCaesar>
Well, that's the nature of a stream.
<JCaesar>
A stream never ends.
ericxtang has quit [Ping timeout: 265 seconds]
<jj>
yeah would you happend to know how to read the stream?
<JCaesar>
You can go ipfs pubsub sub $FOO >>pubsublog , for example.
<JCaesar>
What you have to ask yourself is: read it and then do what?
<jj>
ok! yeah ipfs pubsub sub $FOO >> pubsublog works!
<jj>
exactly what I needed. now I can read that pubsublog
<jj>
and parse it
<jj>
thanks
<jj>
well, read it and then idk. Im trying to make a folder syncing script with pubsub and ipfs
<jj>
my project is still in it's infancy. im learning all about IPFS as I go along, and just for the fun of it
<jj>
i still dont even know how to use pubsub to make it work into a file syncing program of sorts, still doing my research
<jj>
ill probably be on this chat node more often now
<JCaesar>
I mean, you can use pubsub to publish ipfs hashes. But if you want more than one entity to write to your synced folders, you're up for some fun with the CAP theorem and conflict resolution.
kaotisk has quit [Read error: Connection reset by peer]
kaotisk has joined #ipfs
<jj>
I'll just have it to have once central folder that publishes changes to all other nodes synching that folder
<jj>
i guess ill use pubsub to "git pull" the changes to the central folder
ralphtheninja2 has joined #ipfs
ynyounuo has joined #ipfs
ynyounuo has joined #ipfs
ynyounuo has quit [Changing host]
rendar has joined #ipfs
s4y has quit [Ping timeout: 264 seconds]
s4y has joined #ipfs
goiko_ has quit [Quit: ﴾͡๏̯͡๏﴿ O'RLY? Bye!]
pat36 has joined #ipfs
goiko has joined #ipfs
goiko has joined #ipfs
goiko has quit [Changing host]
SunflowerSociety has joined #ipfs
SunflowerSociety has quit [Changing host]
SunflowerSociety has joined #ipfs
fahrradflucht has quit [Quit: Connection closed for inactivity]
zautomata has quit [Ping timeout: 265 seconds]
lnostdal has joined #ipfs
clemo has joined #ipfs
tenchooo has quit [Remote host closed the connection]
tenchooo has joined #ipfs
trqx has quit [Remote host closed the connection]
trqx has joined #ipfs
mtodor has joined #ipfs
mtodor_ has joined #ipfs
mtodor_ has quit [Read error: Connection reset by peer]
mtodor has quit [Ping timeout: 265 seconds]
jj has quit [Remote host closed the connection]
mtodor has joined #ipfs
mtodor has quit [Remote host closed the connection]
mtodor has joined #ipfs
mtodor has quit [Ping timeout: 260 seconds]
ericxtang has joined #ipfs
scde_ has joined #ipfs
scde_ has quit [Remote host closed the connection]
chowie has quit [Ping timeout: 264 seconds]
ericxtang has quit [Ping timeout: 245 seconds]
lnostdal has quit [Ping timeout: 276 seconds]
zautomata has joined #ipfs
kivutar has quit [Ping timeout: 260 seconds]
kivutar has joined #ipfs
tpircs has joined #ipfs
espadrine_ has quit [Ping timeout: 260 seconds]
zautomata has quit [Ping timeout: 264 seconds]
joocain2 has quit [Ping timeout: 268 seconds]
joocain2 has joined #ipfs
lnostdal has joined #ipfs
kivutar has quit [Ping timeout: 264 seconds]
ejsf_ has quit [Quit: leaving]
ejsf has joined #ipfs
raynold has joined #ipfs
kivutar has joined #ipfs
zautomata has joined #ipfs
tpircs has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
zautomata has quit [Changing host]
zautomata has joined #ipfs
<mkg20001>
I made a (currently still broken and unfinished) web terminal with the IPFS CLI! https://ipfs-cli.mkg20001.io/ Could be useful for docs
dimitarvp has joined #ipfs
chriscool1 has quit [Quit: Leaving.]
Louiqa_ has joined #ipfs
zautomata has quit [Quit: WeeChat 1.9.1]
zautomata has joined #ipfs
seizo has joined #ipfs
smuten_ has joined #ipfs
plexigras has quit [Ping timeout: 256 seconds]
brabo has quit [Ping timeout: 255 seconds]
brabo has joined #ipfs
lnostdal has quit [Ping timeout: 256 seconds]
plexigras has joined #ipfs
kivutar has quit [Ping timeout: 240 seconds]
Kyung has joined #ipfs
Kyung has left #ipfs [#ipfs]
kivutar has joined #ipfs
<JCaesar>
mkg20001: Is that made with shellinabox?
<JCaesar>
Also, the newlines don't render correctly for me…
Louiqa_ has left #ipfs [#ipfs]
<JCaesar>
"render". The line feed works, but the return carriage doesn't.
<mkg20001>
No. It's using xterm.js for the terminal emulation. Yes, I already know about the newlines bug. Just don't know how to fix it.
tpircs has joined #ipfs
<mkg20001>
shellinabox seems to require a server. This thing runs completly in the browser