コード例 #1
0
        public void Initialize()
        {
            string file = PoolUtils.GenerateGenesisFile();

            _filesCreated.Add(file);

            _pool = IndyDotNet.Pool.Factory.GetPool("AllCryptoTestsPool", file);
            _pool.Create();
            _pool.Open();

            WalletConfig config = new WalletConfig()
            {
                Id = "AllCryptoTestsWalletId"
            };

            WalletCredentials credentials = new WalletCredentials()
            {
                Key = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY",
                KeyDerivationMethod = KeyDerivationMethod.RAW
            };

            _wallet = IndyDotNet.Wallet.Factory.GetWallet(config, credentials);
            _wallet.Create();
            _wallet.Open();

            IdentitySeed seed = new IdentitySeed()
            {
                Seed = "00000000000000000000000000000My1"
            };

            _senderDid = IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed);
        }
コード例 #2
0
        public void Initialize()
        {
            string file = Environment.GetEnvironmentVariable("POOL_GENESIS_FILE");

            if (string.IsNullOrEmpty(file))
            {
                file = PoolUtils.GenerateGenesisFile();
                _filesCreated.Add(file);
            }

            _pool = IndyDotNet.Pool.Factory.GetPool("WriteDidAndQueryVeryKeyDemoPool", file);
            _pool.Create();
            _pool.Open();

            WalletConfig config = new WalletConfig()
            {
                Id = "WriteDidAndQueryVeryKeyDemoWalletId"
            };

            WalletCredentials credentials = new WalletCredentials()
            {
                Key = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY",
                KeyDerivationMethod = KeyDerivationMethod.RAW
            };

            _wallet = IndyDotNet.Wallet.Factory.GetWallet(config, credentials);
            _wallet.Create();
            _wallet.Open();
        }
コード例 #3
0
        public void Initialize()
        {
            string file = PoolUtils.GenerateGenesisFile();

            _filesCreated.Add(file);

            _pool = IndyDotNet.Pool.Factory.GetPool("AllPaymentsTestsPool", file);
            _pool.Create();
            _pool.Open();

            WalletConfig config = new WalletConfig()
            {
                Id = "AllPaymentsTestWalletId"
            };

            WalletCredentials credentials = new WalletCredentials()
            {
                Key = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY",
                KeyDerivationMethod = KeyDerivationMethod.RAW
            };

            _wallet = IndyDotNet.Wallet.Factory.GetWallet(config, credentials);
            _wallet.Create();
            _wallet.Open();
        }
コード例 #4
0
        public void OpenCreatedWalletSuccessfully()
        {
            IPool pool = IndyDotNet.Pool.Factory.GetPool("OpenCreatedWalletPool", _genesisFileName);

            pool.Create();
            pool.Open();

            _poolsCreated.Add(pool);

            WalletConfig config = new WalletConfig()
            {
                Id = "OpenCreateWalletID"
            };

            WalletCredentials credentials = new WalletCredentials()
            {
                Key = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY",
                KeyDerivationMethod = KeyDerivationMethod.RAW
            };

            IWallet wallet = IndyDotNet.Wallet.Factory.GetWallet(config, credentials);

            wallet.Create();
            _walletsCreated.Add(wallet);

            wallet.Open();
        }
コード例 #5
0
        public void Initialize()
        {
            string file = Environment.GetEnvironmentVariable("POOL_GENESIS_FILE");

            // throw new Exception($"environment variable POOL_GENESIS_FILE is {file}");

            if (string.IsNullOrEmpty(file))
            {
                file = PoolUtils.GenerateGenesisFile();
                _filesCreated.Add(file);
            }

            _pool = IndyDotNet.Pool.Factory.GetPool("IssueCredentialDemoPool", file);
            _pool.Create();
            _pool.Open();

            WalletConfig config = new WalletConfig()
            {
                Id = "IssueCredentialDemoWalletId"
            };

            _wallet = IndyDotNet.Wallet.Factory.GetWallet(config, _credentials);
            _wallet.Create();
            _wallet.Open();
        }
コード例 #6
0
        public void CreatePoolWithNoGenesisFileSpecified()
        {
            IPool pool = Factory.GetPool("CreatePool");

            // because genesis transaction file of name "CreatePool.txn" does not
            // exist in the application working directory, this call will fail
            Assert.ThrowsException <System.AggregateException>(() => pool.Create());
        }
コード例 #7
0
        public void CreatePoolWithValidGenesisFile()
        {
            string file = PoolUtils.GenerateGenesisFile();

            IPool pool = Factory.GetPool("CreatePool", file);

            pool.Create();

            Assert.IsTrue(System.IO.File.Exists(file), "expected to find genesis file created.");

            pool.Delete();
        }
コード例 #8
0
        public void ListPoolTest()
        {
            string file = PoolUtils.GenerateGenesisFile();

            IPool pool = Factory.GetPool("ListPool", file);

            pool.Create();

            List <IPool> pools = Factory.ListPools();

            Assert.IsNotNull(pools);
            pool.Delete();

            Assert.IsTrue(0 < pools.Count, "expected to find at least one pool");
        }
コード例 #9
0
ファイル: PoolHandler.cs プロジェクト: tatmanblue/IndyDotNet
 private void CreatePool()
 {
     try
     {
         EditDialog dlg        = new EditDialog("Create Pool", "Enter pool name:");
         var        dlgResults = dlg.Show();
         if (DialogConstants.OK == dlgResults.Item1)
         {
             IPool pool = Factory.GetPool($"{dlgResults.Item2}");
             pool.Create();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Query(70, 7, "Pool Create Failed", $"Error: {ex.Message}", "Ok");
     }
 }
コード例 #10
0
        public void ExportWalletSuccessfully()
        {
            IPool pool = IndyDotNet.Pool.Factory.GetPool("DeleteCreatedWalletPool", _genesisFileName);

            pool.Create();
            pool.Open();

            _poolsCreated.Add(pool);

            WalletConfig config = new WalletConfig()
            {
                Id = "DeleteCreateWalletID"
            };

            WalletCredentials credentials = new WalletCredentials()
            {
                Key = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY",
                KeyDerivationMethod = KeyDerivationMethod.RAW
            };

            IWallet wallet = IndyDotNet.Wallet.Factory.GetWallet(config, credentials);

            wallet.Create();
            wallet.Open();
            _walletsCreated.Add(wallet);

            WalletImportExportConfig exportConfig = new WalletImportExportConfig()
            {
                Key  = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY",
                Path = System.IO.Path.GetTempFileName()
            };

            wallet.Export(exportConfig);
            _filesCreated.Add(exportConfig.Path);

            Assert.IsTrue(System.IO.File.Exists(exportConfig.Path));
        }
コード例 #11
0
        public void CreatePoolWithInvalidGenesisFile()
        {
            IPool pool = Factory.GetPool("CreatePool", "Bob.txn");

            Assert.ThrowsException <System.AggregateException> (() => pool.Create());
        }
コード例 #12
0
        public static IBindingCondition ToPool(this IBindingContract contract, IPool pool)
        {
            Assert.IsTrue(pool.Type.Is(contract.ContractType));

            return(contract.ToMethod(c => pool.Create()).AsTransient());
        }
コード例 #13
0
 public Entity Create(IEntityId _id = null) => new Entity(entityManager, _id == null ? entityIdPool.Create() : _id);