Skip to content

Commit

Permalink
Merge pull request #7101 from brave/ipfs_enable_gc
Browse files Browse the repository at this point in the history
Enable IPFS repo gc with StorageMax = 1GB and GCPeriod = 1hr
  • Loading branch information
yrliou authored Nov 10, 2020
2 parents af9bb07 + fc86bb8 commit 98c8362
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/services/ipfs/ipfs_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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();

Expand Down

0 comments on commit 98c8362

Please sign in to comment.