@zhenxi
2017-10-12T22:35:30.000000Z
字数 5167
阅读 2049
IPFS
ipfs diag SUBCOMMANDS
作用
生成诊断报告
root@asch-build:~# ipfs diag cmds
Command Active StartTime RunTime
swarm/peers false Oct 12 10:15:17 56.806878ms
diag/cmds true Oct 12 11:11:09 22.492793ms
root@asch-build:~# ipfs diag sys
{
"diskinfo": {
"free_space": 22549147648,
"fstype": "61267",
"total_space": 21190385664
},
"environment": {
"GOPATH": "/root/work",
"IPFS_PATH": ""
},
"ipfs_commit": "",
"ipfs_version": "0.4.11",
"memory": {
"swap": 0,
"virt": 988264000
},
"net": {
"interface_addresses": ["/ip4/127.0.0.1",
"/ip4/45.32.9.220",
"/ip6/::1",
"/ip6/fe80::5400:1ff:fe34:75b5"],
"online": true
},
"runtime": {
"arch": "amd64",
"compiler": "gc",
"gomaxprocs": 1,
"numcpu": 1,
"numgoroutines": 14173,
"os": "linux",
"version": "go1.9"
}
}
// 获取本地pin的所有类型的文件
root@asch-build:~# ipfs pin ls --type=all
QmbjMZqjKxhS24WsZiq798bTd4xbmDzNmBkVpXF7Jdxnqh recursive
QmdcYvbv8FSBfbq1VVSfbjLokVaBYRLKHShpnXu3crd3Gm recursive
QmeBpzHngbHes9hoPjfDCmpNHGztkmZFRX4Yp9ftKcXZDN indirect
QmejvEPop4D7YUadeGqYWmZxHhLc4JBUCzJJHWMzdcMe2y indirect
QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB indirect
QmQ5vhrL7uv6tuoN9KeVBwd4PwfQkXdVVmDLUZuTNxqgvm indirect
QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy recursive // 本地上传的
QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv recursive
QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o recursive
QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn recursive
QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR indirect
QmXgqKTbzdh83pQtKFb19SpMCpDDcKR2ujqk3pKph9aCNF indirect
QmY5heUM5qgRubMDD1og9fhCPA6QdkMp3QCwd4s7gJsyE7 indirect
QmYCvbfNbCwFR45HiNP45rwJgvatpiW38D961L5qAhUM5Y indirect
QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V indirect
root@asch-build:~# ipfs pin rm QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy // 不生效
unpinned QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy
root@asch-build:~# ipfs repo gc // 并没有回收任何东西
root@asch-build:~# ipfs cat QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy
ipfs rocks
root@asch-build:~# ipfs add foo
added QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy foo
root@asch-build:~# ipfs pin ls --type=all
QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy recursive
QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V indirect
QmdcYvbv8FSBfbq1VVSfbjLokVaBYRLKHShpnXu3crd3Gm recursive
QmejvEPop4D7YUadeGqYWmZxHhLc4JBUCzJJHWMzdcMe2y indirect
QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB indirect
QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn recursive
QmYCvbfNbCwFR45HiNP45rwJgvatpiW38D961L5qAhUM5Y indirect
QmQ5vhrL7uv6tuoN9KeVBwd4PwfQkXdVVmDLUZuTNxqgvm indirect
QmbjMZqjKxhS24WsZiq798bTd4xbmDzNmBkVpXF7Jdxnqh recursive
QmeBpzHngbHes9hoPjfDCmpNHGztkmZFRX4Yp9ftKcXZDN indirect
QmY5heUM5qgRubMDD1og9fhCPA6QdkMp3QCwd4s7gJsyE7 indirect
QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o recursive
QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR indirect
QmXgqKTbzdh83pQtKFb19SpMCpDDcKR2ujqk3pKph9aCNF indirect
QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv recursive
root@asch-build:~# ipfs pin rm -r QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy
unpinned QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy
root@asch-build:~# ipfs repo gc
removed QmNX1WDix4sunJnu3wc9aH3nLQhQQNR3pG3EmJkdnE3w1k
removed QmdQsTFQiuQdJ1nwWxcWSDzLbjouEUt1zZBK9kDr6Qm2y8
removed QmYRMUVULBfj7WrdPESnwnyZmtayN6Sdrwh1nKcQ9QgQeZ
removed QmdL9t1YP99v4a2wyXFYAQJtbD9zKnPrugFLQWXBXb82sn
removed QmZZRTyhDpL5Jgift1cHbAhexeE1m2Hw8x8g7rTcPahDvo
removed QmTVFSinqPuE63eJYqaUuRWTx7zjKoREwZee5ok3qdqWqB
removed QmcLwi5eu9xmKjrNxuTVfq2oGj2N88nRtx6LZXjX5RZKxg
removed QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy // 刚才我们add的内容hash
removed QmPhk6cJkRcFfZCdYam4c9MKYjFG9V29LswUnbrFNhtk2S
removed QmT8onRUfPgvkoPMdMvCHPYxh98iKCfFkBYM1ufYpnkHJn
removed QmYVMHnw3ZvJhqw32gbUoAeUVKMk8Cjw6yB53byEYnMiZM
removed QmbRcHgmNeW6ikXxrzEtjXgh5SojNWrCSHe6Z8prhSJi94
removed QmdxMF7iVtaDKbSjVfQ3FPokZr1iWeVygHiEnVfHAVabWZ
removed QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ
removed Qmb7oGTxge7amSArtJsGUAqswY8y1G7m5QNjV57Nj5sEHU
removed QmZuT3fhDEYoxsZhAw44Ke8oeyeHsxPjLw9JumWqVSiCb3
removed Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u
removed QmVQjvKzfVTTNFqrhiLiW1D6KCeTmqJx9k7CEy5jUpbiVd
removed QmPEKipMh6LsXzvtLxunSPP7ZsBM8y9xQ2SQQwBXy5UY6e
root@asch-build:~# ipfs cat QmRTV3h1jLcACW4FRfdisokkQAk4E4qDhUzGpgdrd4JAFy // 耗时很久,几分钟才返回了结果
// 按理说这里不应该有数据。。 ipfs上传只保存一份数据,本地被gc后应该消失了才对
ipfs rocks
root@asch-build:~# ipfs id
{
"ID": "QmTTpxE4Fq9LYfR8L5jbUtB4CrAtJdfQQAJSBmTkrpZwxC",
"PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDLVZUam2PzSoCxizQzG0PzTzc+QcjrMvocETHH3haiUyhxbA70ZiaaUR+NyMygMO8FkCRqZsLhaL0lKBiUVL3G6KbCnIglR2MnMH3T2OWpDYJzpD3mC1BXRbNrP0YdyVhD3l4ZDZNm/GQ+1DgeJ7ifKCUVJXPBgkEUXZP5vmKUoshx9oOMBku8KeErHfmKbzi4EPrwvXzIVvx1jADy9C6oPVF3VPEoFEbGVoQs0K0VVCKINLZPgInqoIRkQZFEyEw2vzvNZAkQWte2Wc/IkM5W//uXxdYJ41ufNTrihyqbCDJZtIl2t/ia3BG2/EHisaNfew/yVH85/RfvL5M3EIZTAgMBAAE=",
"Addresses": null,
"AgentVersion": "go-ipfs/0.4.11/",
"ProtocolVersion": "ipfs/0.1.0"
}
root@asch-build:~# ipfs version
ipfs version 0.4.11
root@asch-build:~# ipfs pin ls --type=all
Error: Failed to get block for QmbjMZqjKxhS24WsZiq798bTd4xbmDzNmBkVpXF7Jdxnqh: ran out of retries trying to get past temporary error: open /root/.ipfs/blocks/GV/CIQMN6HH2JAUIWSR2JRMTPGNOUSBFKRZYHD5HLBYLY7MDRSLH2PAGVA.data: too many open files
root@asch-build:~# ulimit -n 204800
root@asch-build:~# sudo echo 200000 > /proc/sys/fs/file-max