#!/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/
cmdadd−−pin=false−q2>/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/
cmdadd−−pin=false−q2>/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/
cmdadd−−pin=false−q2>/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/profile∣ipfsadd−−pin=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/
cmdadd−−pin=false−q2>/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”