public void Should_start_and_stop()
 {
     for (int i = 0; i < 3; ++i)
     {
         var g = new GatewayHost(ipfs, "http://127.0.0.1:0");
         g.Dispose();
     }
 }
Ejemplo n.º 2
0
        static TestFixture()
        {
            Ipfs.Options.Repository.Folder       = Path.Combine(Path.GetTempPath(), "ipfs-test");
            Ipfs.Options.KeyChain.DefaultKeySize = 512;
            Ipfs.Config.SetAsync(
                "Addresses.Swarm",
                JToken.FromObject(new string[] { "/ip4/0.0.0.0/tcp/0" })
                ).Wait();
            Ipfs.Start();

            Gateway = new GatewayHost(Ipfs, "http://127.0.0.1:0");
        }
Ejemplo n.º 3
0
        /// <summary>
        ///   The main entry point of the program.
        /// </summary>
        /// <param name="args">TODO</param>
        public static void Main(string[] args)
        {
            IpfsEngine = new IpfsEngine(passphrase.ToCharArray());
            IpfsEngine.Start();

            try
            {
                using (var gateway = new GatewayHost(IpfsEngine))
                {
                    Thread.Sleep(Timeout.Infinite);
                }
            }
            finally
            {
                IpfsEngine.Stop();
            }
        }