From fc86bb82fcded223979fee8de7bc7d9ded615358 Mon Sep 17 00:00:00 2001 From: Jocelyn Liu Date: Mon, 9 Nov 2020 14:24:35 -0800 Subject: [PATCH] Enable IPFS repo gc with StorageMax = 1GB and GCPeriod = 1hr --- components/services/ipfs/ipfs_service_impl.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/services/ipfs/ipfs_service_impl.cc b/components/services/ipfs/ipfs_service_impl.cc index faead33609a..6b611e57d0d 100644 --- a/components/services/ipfs/ipfs_service_impl.cc +++ b/components/services/ipfs/ipfs_service_impl.cc @@ -182,7 +182,9 @@ void IpfsServiceImpl::Launch(mojom::IpfsConfigPtr config, {"config", "Addresses.API", "/ip4/127.0.0.1/tcp/45001"}, {"config", "Addresses.Gateway", "/ip4/127.0.0.1/tcp/48080"}, {"config", "--json", "Addresses.Swarm", - "[\"/ip4/0.0.0.0/tcp/44001\", \"/ip6/::/tcp/44001\"]"}}; + "[\"/ip4/0.0.0.0/tcp/44001\", \"/ip6/::/tcp/44001\"]"}, + {"config", "Datastore.GCPeriod", "1h"}, + {"config", "Datastore.StorageMax", "1GB"}}; for (auto args : config_args) { if (!LaunchProcessAndExit(config->binary_path, args, options)) { @@ -201,6 +203,8 @@ void IpfsServiceImpl::Launch(mojom::IpfsConfigPtr config, base::CommandLine args(config->binary_path); args.AppendArg("daemon"); args.AppendArg("--migrate=true"); + args.AppendArg("--enable-gc"); + args.AppendArg("--routing=dhtclient"); ipfs_process_ = base::LaunchProcess(args, options); bool result = ipfs_process_.IsValid();