Create a block from scratch

| ipfs block put

i could save & get text saved in this way on my local desktop.

This means it could only be accessed by the node which generated it? Other nodes won’t be able to read it?

These data blocks will be kept locally until i manually remove it?

Are there ways to make these data blocks public?

This will create a block with a CID etc and it will be public for anyone requesting that block. It is unpinned so it would be removed by GC or “block rm”.

but i tried to get it from another machine but couldn’t

seems like my node is not connected to the outside world :frowning: how can i be sure it’s properly connected?

i run ipfs daemon on a Terminal and use IPFS desktop as interface to upload files most of the time

Read this conversation I just had with someone else:

I’ve read the thread and it’s rich, and honestly i’m an idiot in networking.

i tried to modify some settings about Port forwarding (see attached file) and i’m not sure whether i’ve got it right.

Attached also check results from IPFS Check on Fleek as suggested. You should see my Peer ID in there

You may also see that my status of “DisableNatPortMap”: false (my ipfs config is also attached for your reference)

I wanted to try setting it to True as suggested, but how do i do it? Please advise. Many thanks in advance

(Attachment myipfsconf.txt is missing)

I couldn’t upload a txt file to you, so here it is: Results from ipfs config show
"
{
“API”: {
“HTTPHeaders”: {}
},
“Addresses”: {
“API”: “/ip4/127.0.0.1/tcp/5001”,
“Announce”: ,
“AppendAnnounce”: ,
“Gateway”: “/ip4/127.0.0.1/tcp/8080”,
“NoAnnounce”: ,
“Swarm”: [
“/ip4/0.0.0.0/tcp/4001”,
“/ip6/::/tcp/4001”,
“/ip4/0.0.0.0/udp/4001/quic”,
“/ip6/::/udp/4001/quic”
]
},
“AutoNAT”: {},
“Bootstrap”: [
“/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN”,
“/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa”,
“/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb”,
“/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt”,
“/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ”,
“/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
],
“DNS”: {
“Resolvers”: {}
},
“Datastore”: {
“BloomFilterSize”: 0,
“GCPeriod”: “1h”,
“HashOnRead”: false,
“Spec”: {
“mounts”: [
{
“child”: {
“path”: “blocks”,
“shardFunc”: “/repo/flatfs/shard/v1/next-to-last/2”,
“sync”: true,
“type”: “flatfs”
},
“mountpoint”: “/blocks”,
“prefix”: “flatfs.datastore”,
“type”: “measure”
},
{
“child”: {
“compression”: “none”,
“path”: “datastore”,
“type”: “levelds”
},
“mountpoint”: “/”,
“prefix”: “leveldb.datastore”,
“type”: “measure”
}
],
“type”: “mount”
},
“StorageGCWatermark”: 90,
“StorageMax”: “10GB”
},
“Discovery”: {
“MDNS”: {
“Enabled”: true,
“Interval”: 10
}
},
“Experimental”: {
“AcceleratedDHTClient”: false,
“FilestoreEnabled”: false,
“GraphsyncEnabled”: false,
“Libp2pStreamMounting”: false,
“P2pHttpProxy”: false,
“StrategicProviding”: false,
“UrlstoreEnabled”: false
},
“Gateway”: {
“APICommands”: ,
“HTTPHeaders”: {
“Access-Control-Allow-Headers”: [
“X-Requested-With”,
“Range”,
“User-Agent”
],
“Access-Control-Allow-Methods”: [
“GET”
],
“Access-Control-Allow-Origin”: [
“*”
]
},
“NoDNSLink”: false,
“NoFetch”: false,
“PathPrefixes”: ,
“PublicGateways”: null,
“RootRedirect”: “”,
“Writable”: false
},
“Identity”: {
“PeerID”: “12D3KooWK5GQfwTovUTHR8Ud2WG4fMWFx644w59g6YAoXvYA278y”
},
“Internal”: {},
“Ipns”: {
“RecordLifetime”: “”,
“RepublishPeriod”: “”,
“ResolveCacheSize”: 128
},
“Migration”: {
“DownloadSources”: ,
“Keep”: “”
},
“Mounts”: {
“FuseAllowOther”: false,
“IPFS”: “/ipfs”,
“IPNS”: “/ipns”
},
“Peering”: {
“Peers”: null
},
“Pinning”: {
“RemoteServices”: {}
},
“Plugins”: {
“Plugins”: null
},
“Provider”: {
“Strategy”: “”
},
“Pubsub”: {
“DisableSigning”: false,
“Router”: “”
},
“Reprovider”: {
“Interval”: “12h”,
“Strategy”: “all”
},
“Routing”: {
“Type”: “dht”
},
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: false,
“RelayClient”: {},
“RelayService”: {},
“Transports”: {
“Multiplexers”: {},
“Network”: {},
“Security”: {}
}
}
}

"

First, the good news, I’m able to connect to your node:

> ipfs dht findpeer 12D3KooWK5GQfwTovUTHR8Ud2WG4fMWFx644w59g6YAoXvYA278y
/ip6/::1/udp/4001/quic
/ip4/127.0.0.1/tcp/4001
/ip4/223.16.240.109/tcp/4001
/ip4/223.16.240.109/udp/4001/quic
/ip6/::1/tcp/4001
/ip4/127.0.0.1/udp/4001/quic

Now, the details:

  • You don’t need to forward to 192.168.33.135, just your own node’s address (that was the other guy’s address). And, actually, it appears that’s what you used as internet side, which is not correct. Your internet side should be 223.16.240.109:4001 and your lan side should be 192.168.11.4:4001 (for both TCP and UDP). You can let the router decide the internet side IP address for you (just provide the port number).
  • Make sure to specify the port number (4001) on both sides (protocol and lan side port).
  • Since you are using static mapping, you can set Swarm.DisableNatPortMap to true. Use the following command, then restart the daemon:
    ipfs config --json Swarm.DisableNatPortMap true
  • Your Swarm.GracePeriod is a bit low, I wouldn’t drop below 60s. You can reduce the high/low values if you judge that it’s keeping too many connections.

Everything else looks reasonable. Once the daemon is up again and has been running for a minute or 2, try the fleek test again, and see if it works better than before.

… then let me know how it went :slight_smile:

I’ve made some changes to my wifi router and here’s the latest:
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: true,
“RelayClient”: {},
“RelayService”: {},
“Transports”: {
“Multiplexers”: {},
“Network”: {},
“Security”: {}
}

i tried to access certain files using https://dweb.link/ and i can’t access my own file in my Brave browser. Always “504 Gateway Time-out”

Lastly, how do i change the Swarm.GracePeriod value. Tried ipfs config --json Swarm.GracePeriod 60 but got an error message

By the way, my desktop is connected to the modem with a cable, and wifi router via Windows WiFi.

I can’t reach your node anymore, so something is wrong. Make sure that the address you used in the lan side (192.168.11.4) is the actual address of your node (those can change over time, unless you instruct your router to always hand out the same one).

Here is the command you need to change the grace period (it’s not super intuitive):
ipfs config --json Swarm.ConnMgr.GracePeriod '"60s"'

  1. how can i get the actual address of my node? 192.168.11.4 is provided by the wifi router

  2. couldn’t change the Swarm.GracePeriod value
    C:\Users\User>ipfs config --json Swarm.ConnMgr.GracePeriod ‘“60s”’
    Error: failed to unmarshal json. invalid character ‘’’ looking for beginning of value

Could you please try to connect again as i’ve added a couple of values (223.16.240.109) to the wifi router earlier, now it’s removed

Ah, gotta love Windoze. The syntax I gave you is for Unix (Linux, BSD, macOS), try this (it’s a guess):
ipfs config --json Swarm.ConnMgr.GracePeriod "60s"
If that doesn’t fly, you can always edit the config file manually using a text editor (but you can really mess things up if you don’t know what you’re doing in there), or, if you are using IPFS Desktop, click on settings and edit it there (don’t remove the “s”).

As far as your node address, you get that from the windows network properties (sorry, not sure of the details there, not a windows user). On Unix, I’d just use “ifconfig” at the terminal, there’s probably an equivalent on windows.

Oh, and I still can’t reach your node.

P.S. Apparently, on windows, the equivalent to ifconfig -a is ipconfig /ALL

C:\Users\User>ipconfig

Windows IP Configuration

Ethernet adapter Ethernet:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::88e3:b584:4dae:16f5%18
IPv4 Address. . . . . . . . . . . : 223.16.240.109
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 223.16.240.1

Wireless LAN adapter Local Area Connection* 1:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Local Area Connection* 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::e0ee:930e:b7f2:1252%14
IPv4 Address. . . . . . . . . . . : 192.168.11.4
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.11.1

Ethernet adapter Bluetooth Network Connection:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

i’ve changed the Swarm.GracePeriod to 60s using a text editor and it’s confirmed by ipfs config show

It seems to me that things are normal now on my node (but not to the outside world):

  • i can access my files in a browser
  • i can access my IPNS files again

But IPFS Check results:

:x: Could not connect to multiaddr: context deadline exceeded
:heavy_check_mark: Found multiaddrs advertised in the DHT:
/ip4/127.0.0.1/tcp/4001
/ip4/127.0.0.1/udp/4001/quic
/ip4/223.16.240.109/tcp/4001
/ip4/223.16.240.109/udp/4001/quic
/ip6/::1/tcp/4001
/ip6/::1/udp/4001/quic
:x: Could not find the multihash in the dht
:x: There was an error downloading the CID from the peer: could not connect to peer

What should i do next?

On Fri, Feb 25, 2022 at 7:11 AM Yves Lempereur via discuss.ipfs.io <ipfs1@discoursemail.com> wrote:

Whoa, something is kinda weird in that network layout.

Normally, a home type network goes from the ISP to a modem to a router to your computer (often, the modem and router are just 1 device). However, your computer seems to have an Ethernet connection directly to the modem, as well as a wifi connection to a router (which I can only assume is itself connected to the modem). This is highly unusual, as it’s receiving a public IP address from the modem and a private IP address from the wifi router.

So, the private IP comes from NAT, but the public IP is directly useable (but is probably behind a firewall). I have no idea how you ended up with such a layout, but that gives you 2 options:

  • use the public IP directly, but you need to adjust the firewall to let you in
  • use the private IP, but you need to set up port forwarding (what we’ve been doing)

You need to confirm I’m reading this right, and then you need to pick one (using the public IP directly is more efficient).

it’s just an arbitrary setup, this could be changed.

Shall i do the following setup?

  • ISP modem to wifi router by cable
  • wifi router to desktop by cable
    Is this the thing i’m supposed to do? Sorry to take up so much of your time!

Uh, yep. It’s a miracle your setup works, cuz your computer and the wifi router are fighting over ownership of the public IP address.

So, cable from modem to WAN port on router, cable from a LAN port on the router to the computer. Reboot computer. Get me another reading from ipconfig.

C:\Users\User>ipconfig

Windows IP Configuration

Wireless LAN adapter Local Area Connection* 1:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Local Area Connection* 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Ethernet adapter Ethernet:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::88e3:b584:4dae:16f5%18
IPv4 Address. . . . . . . . . . . : 192.168.11.10
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.11.1

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::e0ee:930e:b7f2:1252%14
IPv4 Address. . . . . . . . . . . : 192.168.11.4
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.11.1

Ethernet adapter Bluetooth Network Connection:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Progress!

Now, change your port forwarding to 192.168.11.10:4001 for both TCP and UDP.

Then restart your daemon. Wait a couple mins, try the fleek test again.

still, IPFS check produced the same results:

:x: Could not connect to multiaddr: context deadline exceeded
:heavy_check_mark: Found multiaddrs advertised in the DHT:
/ip4/127.0.0.1/tcp/4001
/ip4/127.0.0.1/udp/4001/quic
/ip4/192.168.11.10/tcp/4001
/ip4/192.168.11.10/udp/4001/quic
/ip4/223.16.253.161/tcp/4001
/ip4/223.16.253.161/udp/1024/quic
/ip4/223.16.253.161/udp/4001/quic
/ip6/::1/tcp/4001
/ip6/::1/udp/4001/quic
:x: Could not find the multihash in the dht
:x: There was an error downloading the CID from the peer: could not connect to peer

Use your browser to go to an IP address checker (like typing “my ip” in Google), and write down what your IPv4 address is. Then, type “ipfs id” in your terminal, and check that it advertises the same address with port 4001 (the screenshot you sent seems to think it’s 223.16.253.161).

could not set to 192.168.11.10
ERROR: Internet Side IP Address
description: IP Address in the LAN side network address range cannot be used