[pbsub] pub Error lstat no such file or directory

Hello everyone,

ipfs version 0.11.0
ipfs-cluster-ctl version 0.14.3

I am using ipfs as a mean to store some Postgresql WAL (binary files)

The files are added to ipfs using ipfs-cluster-ctl add <file> from the primary postgres (publisher node) and will need to be read from a secondary postgres (subscriber node).

And I thought about using ipfs pubsub as a mean to notify the subscriber with the hash of my recently added file on the publisher.

For example: ipfs pubsub pub demo QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHV

I have two nodes: publisher and subscriber,

On my suscriber node I executed this command:

$ ipfs pubsub sub demo

On my publisher I executed this command to check:

$ ipfs pubsub peers
Qm[subscriber]

The check is ok and I have the good subscriber peer id.

But when I execute this next command :

$ ipfs pubsub pub demo test

I get the following error:

Error: lstat test: no such file or directory

USAGE
  ipfs pubsub pub <topic> <data> - Publish data to a given pubsub topic.

  ipfs pubsub pub [--] <topic> <data>

  ipfs pubsub pub publishes a message to a specified topic.
  It reads binary data from stdin or a file.
  
  EXPERIMENTAL FEATURE
  
    It is not intended in its current state to be used in a production
    environment.  To use, the daemon must be run with
    '--enable-pubsub-experiment'.
  
  HTTP RPC ENCODING
  
    The data to be published is sent in HTTP request body as multipart/form-data.
  
    Topic names are binary data too. To ensure all bytes are transferred
    correctly via URL params, the RPC client and server will use multibase
    encoding behind the scenes.

  For more information about each command, use:
  'ipfs pubsub pub <subcmd> --help'

Do you have any idea on how to resolve this issue ?

echo "test" | ipfs pubsub pub demo. Or create a file named ‘test’.

1 Like

Thanks, it worked like a charm, I was to able to finish my POC

The project postgres using ipfs as log shipping: GitHub - robinportigliatti/vagrant-ipfs