Ipfs init error, need help


After install.sh I see:

$ ./install.sh
Moved ./ipfs to /usr/local/bin

When I write

$ ipfs init
initializing IPFS node at /Users/darwin/.ipfs
Error: ipfs configuration file already exists!
Reinitializing would overwrite your keys.

How can I get smth like this?

> ipfs init
initializing ipfs node at /Users/jbenet/.go-ipfs
generating 2048-bit RSA keypair...done
peer identity: Qmcpo2iLBikrdf1d6QU6vXuNb6P7hwrbNPW9kLAH8eG67z
to get started, enter:

  ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

You’ve already initialized your node, so there may not be any need to do it again unless there’s something wrong with your existing repository.

However, if you really want to delete your old repository and start over you can delete the .ipfs directory in /home/darwin/ and then run ipfs init again.

1 Like

I just want to get peer identity, like this:

peer identity: Qmcpo2iLBikrdf1d6QU6vXuNb6P7hwrbNPW9kLAH8eG67z

How can I find it?

Run ipfs id (see the ID field).

1 Like

Now I see this:

$ ipfs id

Error: ipfs repo needs migration

Is my problem hard? Can anyone help newcomer? I like this tech, but without help I can not use it, and there is no help…

Try running ipfs daemon --migrate=true.

1 Like

Migration successful. From 5 to 6 then from 6 to 7. I see this

Swarm listening on /p2p-circuit/ipfs/QmXXfLvyxkqeCWzVWKh1yvQpXpyhdToenUXF23Pd7mTNqr
Swarm announcing /ip4/
Swarm announcing /ip4/xxx.150.xx.xx/tcp/30346
Swarm announcing /ip4/xx.150.xx.xx/tcp/38579
Swarm announcing /ip4/
Swarm announcing /ip6/::1/tcp/4001
Swarm announcing /ip6/xxx:20c3:19xxx43/tcp/4001
API server listening on /ip4/
Gateway (readonly) server listening on /ip4/
Daemon is ready

When I try in another terminal tab

ipfs cat /ipfs/QmXXfLvyxkqeCWzVWKh1yvQpXpyhdToenUXF23Pd7mTNqr/readme

Nothing happens…

How many peers are you connected to while the daemon is running?

ipfs swarm peers | wc -l

Can you also link to the instructions you’re following? Where did this hash come from that you’re trying to use?

ipfs cat /ipfs/QmXXfLvyxkqeCWzVWKh1yvQpXpyhdToenUXF23Pd7mTNqr/readme

I’d suggest trying ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme instead. This is from these instructions and is the hash for the readme from your original post.

1 Like

Peers 888
Link to instrucitons https://docs.ipfs.io/introduction/usage/
I guess I just misunderstood what I should do.
I tried your address and it worked! Thanks!

Can you please tell me why this page returns 404?

It’s missing the ipfs part of the path. The correct URL to access that path through the gateway would be https://cloudflare-ipfs.com/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

1 Like

Thanks! It worked. And is getting more interesting) I read basics, but can not understand, how can I post my content, so it can be viewed like example above?

I wrote hash=echo “Hello, Saburova!” | ipfs add -q`` but address, with my Peer ID do not work:


Your peer ID isn’t needed for you to manually look up the hash of the content. You look up the content using its hash, not your peer ID.

In your example, QmXXfLvyxkqeCWzVWKh1yvQpXpyhdToenUXF23Pd7mTNqr1 is not the hash of the content.

If you add the string,

hash=`echo 'Hello, Saburova!' | ./ipfs add -q`

Then, echo $hash gives you QmadWRPHJ9YmbgwQNSsR7FubFUvBpjgXfPFXEPcgtC7ccJ with the current defaults.

So the correct URL to access your string through cloudflare’s gateway is https://cloudflare-ipfs.com/ipfs/QmadWRPHJ9YmbgwQNSsR7FubFUvBpjgXfPFXEPcgtC7ccJ

1 Like

Thanks again! It worked. Where I can read this commands? Also about how to create say simple webpage in html and add it to IPFS?

Commands are documented here: https://docs.ipfs.io/reference/api/cli/

Here’s an example of uploading a simple static website to IPFS: https://medium.com/coinmonks/how-i-hosted-my-website-on-ipfs-431919d7440a

1 Like