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

basic pubsub commands #2599

Closed
wants to merge 3 commits into from
Closed

basic pubsub commands #2599

wants to merge 3 commits into from

Conversation

whyrusleeping
Copy link
Member

@whyrusleeping whyrusleeping commented Apr 22, 2016

This is still a WIP. To build and try it out you need to grab the go-libp2p-pubsub dep manually:

go get -d github.com/ipfs/go-libp2p-pubsub
cd $GOPATH/src/github.com/ipfs/go-libp2p-pubsub
gx install --global
gx-go rewrite

The command here is ipfs torch.

License: MIT
Signed-off-by: Jeromy [email protected]

@haadcode
Copy link
Member

haadcode commented May 3, 2016

@whyrusleeping updated your comment to fix gx-go install --global --> gx install --global

@haadcode
Copy link
Member

Sorry for the delay. Notes and feedback:

haad:~/go$ IPFS_PATH=/tmp/pubsub2 ./bin/ipfs torch watch QmP72NBkivfBdyAmUTZExGBTMLt5AGmorQvybsphNQbYSi

Just dies silently. We should probably give an error: "Topic required, eg. 'Qm...abc/topic1'" or something.

haad:~/go$ IPFS_PATH=/tmp/pubsub2 ./bin/ipfs torch watch QmP72NBkivfBdyAmUTZExGBTMLt5AGmorQvybsphNQbYSi/topic1
Error: protocol mismatch in lazy handshake ( na !=
                                                    ^
�����~Y|��,�[���1xչ%�n�/topic1 )

Happens when the topic doesn't exist.

ipfs torch watch <id>     - watch for content from a given publisher

I think this would be clearer if the help text said:
ipfs torch sub <id/topic> - subscribe to a topic from a id

haad:~/go$ IPFS_PATH=/tmp/pubsub1 ./bin/ipfs torch pub --help

    ipfs torch pub <data> - publish some content to watchers

ARGUMENTS:

    <data> - thing to publish

OPTIONS:

    -t, --topic string - topic to publish to.

-t is not optional, it's required. We should change the api or the docs to reflect that. See suggestion below.

ipfs torch pub <data>     - publish some content to watchers

Can we make this ipfs torch pub <topic> <data> - publish some content to a topic?

haad:~/go$ IPFS_PATH=/tmp/pubsub1 ./bin/ipfs torch pub -t topic2 hi
Error: no such topic topic2

Can we do automatic topic creation? Not sure of the security implications, but it'd be required one way or the other I think. If you think of chat rooms, it'd be good to have the possibility to "claim" a channel, ie. create a topic in pubsub.

haad:~/go$ IPFS_PATH=/tmp/pubsub1 ./bin/ipfs torch pub -t topic1 data1111 data2222

Would be cool if I could publish several "chunks" at a time

Noticed also that unix pipes don't work yet. It'd be cool to be able to do something like echo '{Data:"hi"}' | ipfs object put | ipfs torch pub topci1

@whyrusleeping whyrusleeping added the need/author-input Needs input from the original author label May 14, 2016
whyrusleeping and others added 3 commits July 26, 2016 05:37
License: MIT
Signed-off-by: Jeromy <[email protected]>
License: MIT
Signed-off-by: Jeromy <[email protected]>
License: MIT
Signed-off-by: Jeromy <[email protected]>
@whyrusleeping
Copy link
Member Author

going to close this for now, but keeping the branch around. (do not delete the branch pls)

@whyrusleeping whyrusleeping deleted the feat/pubsub branch September 11, 2016 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/author-input Needs input from the original author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants