Example #1
0
        public void Execute()
        {
            // Create a repository with a single node and with PoW
            var repository = IotaRepositoryFactory.Create("http://somenode.uri:12345");

            // Create a repository with a single node with PoW on the node
            repository = IotaRepositoryFactory.Create("http://somenode.uri:12345", PoWType.Remote);

            // Create a repository with a single node with PoW done by PoWSrv
            repository = IotaRepositoryFactory.Create("http://somenode.uri:12345", PoWType.PoWSrv);

            // Create a repository with multiple circuited nodes with local PoW
            repository = IotaRepositoryFactory.CreateWithFallback(new List <string> {
                "http://somenode.uri:12345", "http://someothernode.uri:12345"
            });

            // Create a repository with multiple circuited nodes with PoW on the nodes
            repository = IotaRepositoryFactory.CreateWithFallback(new List <string> {
                "http://somenode.uri:12345", "http://someothernode.uri:12345"
            }, PoWType.Remote);

            // Create a repository with multiple circuited nodes with PoW done by PoWSrv
            repository = IotaRepositoryFactory.CreateWithFallback(new List <string> {
                "http://somenode.uri:12345", "http://someothernode.uri:12345"
            }, PoWType.PoWSrv);
        }
        public void TestPoWSrvPoWTypeMultiNode()
        {
            var repository = IotaRepositoryFactory.CreateWithFallback(new List <string> {
                "http://somenode.uri:1234"
            }, PoWType.PoWSrv);
            var powService = repository.GetType().GetProperty("PoWService", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(repository);

            Assert.IsInstanceOfType(powService, typeof(PoWSrvService));
        }
 public void TestIncorrectUrisShouldThrowException()
 {
     IotaRepositoryFactory.CreateWithFallback(new List <string> {
         "asasfaf", "hasafafa"
     });
 }