예제 #1
0
        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();
            };
        }
예제 #2
0
        public void Main(ServerContext context)
        {
            var ctx  = new IpfsInstanceContext(context, GetPlatformBase());
            var ipfs = new IpfsInstance(ctx);

            Messenger = new IpfsMessenger(context, ipfs);
        }