remote ipfs support & automatic env

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
Ignacio Hagopian
2020-05-26 14:52:51 -03:00
parent 9089aadbbf
commit d5346f8326
8 changed files with 53 additions and 3 deletions
+6
View File
@@ -378,11 +378,17 @@ func ConfigFullNode(c interface{}) Option {
return Error(xerrors.Errorf("invalid config from repo, got: %T", c))
}
remoteIpfsMaddrNotEmpty := func(s *Settings) bool {
return len(cfg.Client.RemoteIpfsMAddr) > 0
}
return Options(
ConfigCommon(&cfg.Common),
If(cfg.Client.UseIpfs,
Override(new(dtypes.ClientBlockstore), modules.IpfsClientBlockstore),
),
ApplyIf(remoteIpfsMaddrNotEmpty,
Override(new(dtypes.ClientBlockstore), modules.IpfsRemoteClientBlockstore(cfg.Client.RemoteIpfsMAddr))),
If(cfg.Metrics.HeadNotifs,
Override(HeadMetricsKey, metrics.SendHeadNotifs(cfg.Metrics.Nickname)),