all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Björn Höfling" <bjoern.hoefling@bjoernhoefling.de>
To: Laura Lazzati <laura.lazzati.15@gmail.com>,
	guix-devel <guix-devel@gnu.org>
Subject: IPFS trouble
Date: Tue, 18 Dec 2018 14:00:30 +0100	[thread overview]
Message-ID: <20181218140030.3545935e@alma-ubu> (raw)

[-- Attachment #1: Type: text/plain, Size: 5050 bytes --]

Hi Laura,

I'm sending this also to guix-devel [and sorry for the previous, empty,
private mail, I was too fast on the sending button].


Note: I'm also new to IPFS, so I hope everything is correct here, if
someone knows better, please reply.

On Tue, 18 Dec 2018 00:04:56 -0300
Laura Lazzati <laura.lazzati.15@gmail.com> wrote:


> > A good guide is:
> > https://medium.com/textileio/the-definitive-guide-to-publishing-content-on-ipfs-ipns-dfe751f1e8d0.  

> Sorry, I read the documentation, but I am mixed up.
> I have my peer identity, and my /ipfs/hash...
> And I find confusing several things:
> If I run ipfs add myfile, using my command line, I cannot find myfile
> in my node. even the add command returns a hash for that file I guess.
> And if I run ipfs ls or cat that hash, the file is shown.

I don't get what you mean with "I cannot find my file". Where are you
looking for it?

> I found useful for instance the webui, but when running ipfs add, my
> files don't appear there if I open it and the other way around either:
> the files are there if I upload them in the webui, and they have a
> hash. I can copy the hash from the webui, but it doesn't work if I run
> ipfs ls on that hash. And the files added with ipfs add myfile do not
> appear in the webui. The webui however has an option to share your
> file, I don't know if that is useful.



You have in IPFS file-objects and directory-objects. The command 'ipfs
ls' is for listing the contents of directory-objects (i.e. list the
files in that directory). If you use it on file-objects (that exit in
the store), the command just returns with no output.


This works for me:

I have the daemon down, i.e. no 'ipfs daemon' started.

Then I can still add things to my local IPFS-store:

```
mkdir baz
echo "foo" > baz/foo.txt
echo "bar" > baz/bar.txt
echo "Hello World, now it is $(date -u -Ins)" > baz/hello.txt
cat baz/hello.txt 

Hello World, now it is 2018-12-18T12:08:57,304514914+00:00


ipfs add -r baz/
added QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM baz/bar.txt
added QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6 baz/foo.txt
added QmXXZWRsLhFAHNWW6tH4TJVB2UiUPsUX8TZhYavqTne6RH baz/hello.txt
added QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg baz
 67 B / 67 B
[=========================================================] 100.00%


Now I can open the web-browser:

localhost:9090/ipfs/QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6

--> (Note:I changed my port from default 8080 to 9090, on 8080 is
already something listening) Unable to connect, I don't have the daemon
up yet.

https://ipfs.io/ipfs/QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6

--> Shows "foo", as this Hash is already uploaded in the global network
by someone else.

https://ipfs.io/ipfs/QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg

--> That is with the hash of the directory. Times out, this is not found
on the global network.


Starting daemon:

ipfs daemon

Browser:

localhost:5001/webui

Redirects:

http://localhost:5001/ipfs/QmSDgpiHco5yXdyVTfhKxr3aiJ82ynz8V14QcGKicM3rVh/#/

Entering hash of "foo" in the "Explore" tab:

QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6

Finds it, I can view it.

Entering hash of "baz" directory:

http://localhost:9090/ipfs/QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg

Yes, it lists the directory.

Globally available:

https://ipfs.io/ipfs/QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg

I can see the directory structure. And I can see the files foo.txt,
bar.txt and hello.txt listed:
https://ipfs.io/ipfs/QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg/bar.txt


But, the "hello.txt" takes its time to download, until now I still
don't see it:

https://ipfs.io/ipfs/QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg/hello.txt

Probably that's because it first needs to search the network and find
my little local host for that file. Hm. Strange.

Ah, after 5 minutes, it's there! Maybe that's also your problem?

Going to my server, daemon is down by default:

myserver$ ipfs ls QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6
Error: merkledag: not found

myserver$ echo "foo" > foo.txt
myserver$ ipfs add foo.txt 
added QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6 foo.txt
 4 B / 4 B
[===========================================================] 100.00%
myserver$ ipfs ls QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6
myserver$

(i.e., no error, no output)



myserver$ ipfs daemon &

Looking for the directory:

myserver$ ipfs ls QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg
[Waiting 3 minutes nothing happens, then:]
QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM 12 bar.txt
QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6 12 foo.txt
QmXXZWRsLhFAHNWW6tH4TJVB2UiUPsUX8TZhYavqTne6RH 67 hello.txt

myserver$ ipfs cat
QmZ9iMU1iKRpAs7dR7XTLGaYtkcYFn6EiMXRhqpk5jaeNg/hello.txt Hello World,
now it is 2018-12-18T12:08:57,304514914+00:00

(instantly!)

Hope this helps a bit,

Björn

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

             reply	other threads:[~2018-12-18 14:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 13:00 Björn Höfling [this message]
2018-12-18 13:07 ` IPFS trouble Laura Lazzati
2018-12-18 15:56   ` Laura Lazzati
2018-12-18 16:02   ` Ricardo Wurmus
2018-12-18 16:10   ` Hector Sanjuan
2018-12-19  8:37     ` Pierre Neidhardt
2018-12-19  9:57       ` Gábor Boskovits
2018-12-19 15:47         ` swedebugia
2018-12-19 15:08     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181218140030.3545935e@alma-ubu \
    --to=bjoern.hoefling@bjoernhoefling.de \
    --cc=guix-devel@gnu.org \
    --cc=laura.lazzati.15@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.