public IpfsInstance(IpfsInstanceContext context) { Context = context; ExecutingDirectory = new FileInfo(GetType().Assembly.Location).Directory; WorkspaceDirectory = context.WorkspaceDirectory; Platform = context.Platform; if (!context.WorkspaceDirectory.Exists) { context.WorkspaceDirectory.Create(); } if (!IsInstalled()) { context.Platform.Install(this); } Messenger = new IpfsMessenger(this); Daemon.StateChangedAction = m => { Messenger.SendIpfsStatus(); }; }
public void Main(ServerContext context) { var ctx = new IpfsInstanceContext(context, GetPlatformBase()); var ipfs = new IpfsInstance(ctx); Messenger = new IpfsMessenger(context, ipfs); }