public static async Task <string> DeployContract(Account account, string _clientUrl)
        {
            Console.WriteLine("Deploying...");
            var web3       = new Web3(account, _clientUrl);
            var deployment = new PatientsFactoryDeployment();
            var receipt    = await PatientsFactoryService.DeployContractAndWaitForReceiptAsync(web3, deployment);

            clientUrl       = _clientUrl;
            contractAddress = receipt.ContractAddress;

            Console.WriteLine($"Contract Address: {contractAddress}");
            Console.WriteLine("");
            return(contractAddress);
        }
Example #2
0
        public static async Task <PatientsFactoryService> DeployContractAndGetServiceAsync(Nethereum.Web3.Web3 web3, PatientsFactoryDeployment patientsFactoryDeployment, CancellationTokenSource cancellationTokenSource = null)
        {
            var receipt = await DeployContractAndWaitForReceiptAsync(web3, patientsFactoryDeployment, cancellationTokenSource);

            return(new PatientsFactoryService(web3, receipt.ContractAddress));
        }
Example #3
0
 public static Task <string> DeployContractAsync(Nethereum.Web3.Web3 web3, PatientsFactoryDeployment patientsFactoryDeployment)
 {
     return(web3.Eth.GetContractDeploymentHandler <PatientsFactoryDeployment>().SendRequestAsync(patientsFactoryDeployment));
 }
Example #4
0
 public static Task <TransactionReceipt> DeployContractAndWaitForReceiptAsync(Nethereum.Web3.Web3 web3, PatientsFactoryDeployment patientsFactoryDeployment, CancellationTokenSource cancellationTokenSource = null)
 {
     return(web3.Eth.GetContractDeploymentHandler <PatientsFactoryDeployment>().SendRequestAndWaitForReceiptAsync(patientsFactoryDeployment, cancellationTokenSource));
 }