#tc qdisc add dev eth0 root netem delay 100ms rate 8192kbit
tc qdisc add dev eth0 root netem delay $DELAY rate $RATE
#tc qdisc add dev eth0 root netem delay 200ms
tc qdisc show dev eth0

ping -c 10 172.17.0.1
#wondershaper eth0 $LIMIT $LIMIT
#wondershaper eth0

mkdir /ipfs
ipfs init --config /ipfs --profile local-discovery
ipfs config --config /ipfs Addresses.Gateway /ip4/0.0.0.0/tcp/8080
ipfs config --config /ipfs Addresses.Swarm --json '["/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/tcp/4002/ws", "/ip6/::/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic", "/ip6/::/udp/4001/quic"]'
ipfs bootstrap add --config /ipfs "/ip4/172.18.0.1/tcp/4001/p2p/12D3KooWBSRuJhj9zikv2UMvsRFyRPBQM5ftKAF1cQsYzQc1t7ax"
rm -r /ipfs/blocks /ipfs/datastore /ipfs/datastore_spec /ipfs/keystore /ipfs/version
ln -s /ipfs-mount/blocks /ipfs/blocks
ln -s /ipfs-mount/datastore /ipfs/datastore
ln -s /ipfs-mount/datastore_spec /ipfs/datastore_spec
ln -s /ipfs-mount/keystore /ipfs/keystore
ln -s /ipfs-mount/version /ipfs/version
ipfs id --config /ipfs

supervisord -c /supervisord.conf
