IPFS Debug Script

#!/usr/bin/env bash

set -eo pipefail; [[ $SCRIPT_TRACE ]] && set -x

cmd=“ 1 " [ " 1" [ " 1"["cmd” ] || cmd=“docker exec -i ipfs ipfs”

echo “curl localhost:5001/debug/pprof/goroutine?debug=2 | ipfs add --pin=false”
hash1=$(curl -s ‘localhost:5001/debug/pprof/goroutine?debug=2’ | c m d a d d − − p i n = f a l s e − q 2 > / d e v / n u l l ) e c h o " = = > h t t p s : / / i p f s . i o / i p f s / cmd add --pin=false -q 2>/dev/null) echo "==> https://ipfs.io/ipfs/ cmdaddpin=falseq2>/dev/null)echo"==>https://ipfs.io/ipfs/hash1"
echo
echo “curl localhost:5001/debug/pprof/heap | ipfs add --pin=false”
hash2=$(curl -s ‘localhost:5001/debug/pprof/heap’ | c m d a d d − − p i n = f a l s e − q 2 > / d e v / n u l l ) e c h o " = = > h t t p s : / / i p f s . i o / i p f s / cmd add --pin=false -q 2>/dev/null) echo "==> https://ipfs.io/ipfs/ cmdaddpin=falseq2>/dev/null)echo"==>https://ipfs.io/ipfs/hash2"
echo
echo “curl localhost:5001/api/v0/diag/sys | ipfs add --pin=false”
hash3=$(curl -s ‘localhost:5001/api/v0/diag/sys’ | jq . | c m d a d d − − p i n = f a l s e − q 2 > / d e v / n u l l ) e c h o " = = > h t t p s : / / i p f s . i o / i p f s / cmd add --pin=false -q 2>/dev/null) echo "==> https://ipfs.io/ipfs/ cmdaddpin=falseq2>/dev/null)echo"==>https://ipfs.io/ipfs/hash3"
echo
echo “cat /usr/local/bin/ipfs | ipfs add --pin=false”
hash4= ( ( (cmd add --pin=false -q /usr/local/bin/ipfs 2>/dev/null)
echo “==> https://ipfs.io/ipfs/ h a s h 4 " e c h o e c h o " c u r l l o c a l h o s t : 5001 / d e b u g / p p r o f / p r o f i l e ∣ i p f s a d d − − p i n = f a l s e " h a s h 5 = hash4" echo echo "curl localhost:5001/debug/pprof/profile | ipfs add --pin=false" hash5= hash4"echoecho"curllocalhost:5001/debug/pprof/profileipfsaddpin=false"hash5=(curl -s ‘localhost:5001/debug/pprof/profile’ | c m d a d d − − p i n = f a l s e − q 2 > / d e v / n u l l ) e c h o " = = > h t t p s : / / i p f s . i o / i p f s / cmd add --pin=false -q 2>/dev/null) echo "==> https://ipfs.io/ipfs/ cmdaddpin=falseq2>/dev/null)echo"==>https://ipfs.io/ipfs/hash5”
echo

dir0=“QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn”
dir1= ( ( (cmd object patch add-link “ d i r 0 " i p f s . s t a c k s " dir0" ipfs.stacks " dir0"ipfs.stacks"hash1” 2>/dev/null)
dir2= ( ( (cmd object patch add-link “ d i r 1 " i p f s . h e a p " dir1" ipfs.heap " dir1"ipfs.heap"hash2” 2>/dev/null)
dir3= ( ( (cmd object patch add-link “ d i r 2 " i p f s . s y s i n f o " dir2" ipfs.sysinfo " dir2"ipfs.sysinfo"hash3” 2>/dev/null)
dir4= ( ( (cmd object patch add-link “ d i r 3 " i p f s " dir3" ipfs " dir3"ipfs"hash4” 2>/dev/null)
dir5= ( ( (cmd object patch add-link “ d i r 4 " i p f s . c p u p r o f " dir4" ipfs.cpuprof " dir4"ipfs.cpuprof"hash5” 2>/dev/null)

echo “http://localhost:8080/ipfs/ d i r 5 " e c h o " h t t p s : / / i p f s . i o / i p f s / dir5" echo "https://ipfs.io/ipfs/ dir5"echo"https://ipfs.io/ipfs/dir5”
echo “fs:/ipfs/$dir5”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值