|
|
@ -6,14 +6,17 @@ import ( |
|
|
|
"github.com/vocdoni/dvote-relay/batch" |
|
|
|
"github.com/vocdoni/dvote-relay/types" |
|
|
|
"github.com/vocdoni/dvote-relay/data" |
|
|
|
shell "github.com/ipfs/go-ipfs-api" |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func Sub(topic string) error { |
|
|
|
subscription := data.PsSubscribe(topic) |
|
|
|
fmt.Println("Subscribed > " + topic) |
|
|
|
var msg shell.PubSubRecord |
|
|
|
var err error |
|
|
|
for { |
|
|
|
msg, err := subscription.Next() |
|
|
|
msg, err = subscription.Next() |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|