Example #1
0
 /// <summary>
 /// @dev responsible for setting up connection to the following
 /// @var rhodeITDB the RhodesIT Platforms Database
 /// @var rhodesDataBase represents Rhodes Universities DB
 /// @var web3 responsible for establishing a connection between RChain (Private Blockchain) and the Mobile App
 /// @var SmartContractFunctions responsible for allowing access to all smart contract functions
 /// </summary>
 public void SetupAsync()
 {
     BaseContract   = new RhodeITDeployment();
     rhodesDataBase = new RhodesDataBase();
     Account        = new ManagedAccount(Variables.adminAddress, Variables.Passwordd);
     web3           = new Web3Quorum(Variables.RPCAddressNodeGenesis);
     web3.TransactionManager.DefaultGas      = new System.Numerics.BigInteger(8000000);
     web3.TransactionManager.DefaultGasPrice = new System.Numerics.BigInteger(20000000000);
     SmartContractFunctions = new RhodeITService();
 }
Example #2
0
 public Task <string> DeployContractAsync(Web3 web3, RhodeITDeployment rhodeITDeployment)
 {
     return(web3.Eth.GetContractDeploymentHandler <RhodeITDeployment>().SendRequestAsync(rhodeITDeployment));
 }
Example #3
0
        public async Task <RhodeITService> DeployContractAndGetServiceAsync(Web3 web3, RhodeITDeployment rhodeITDeployment, CancellationTokenSource cancellationTokenSource = null)
        {
            var receipt = await DeployContractAndWaitForReceiptAsync(web3, rhodeITDeployment, cancellationTokenSource);

            return(new RhodeITService(web3, receipt.ContractAddress));
        }
Example #4
0
 public Task <TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3, RhodeITDeployment rhodeITDeployment, CancellationTokenSource cancellationTokenSource = null)
 {
     return(web3.Eth.GetContractDeploymentHandler <RhodeITDeployment>().SendRequestAndWaitForReceiptAsync(rhodeITDeployment, cancellationTokenSource));
 }