/// <summary> /// Initialization of the wallet connection. /// </summary> /// <param name="walletPhase"></param> /// <param name="walletAddress"></param> /// <param name="walletPublicKey"></param> /// <param name="walletPassword"></param> /// <returns></returns> public async Task <bool> InitlizationWalletConnectionAsync(string walletPhase, string walletPassword) { if (SeedNodeConnector == null) { SeedNodeConnector = new ClassSeedNodeConnector(); } if (!await SeedNodeConnector.StartConnectToSeedAsync(string.Empty, ClassConnectorSetting.SeedNodePort)) { WalletCreateResult = ClassWalletCreatorEnumeration.WalletCreatorError; return(false); } WalletConnector = new ClassWalletConnect(SeedNodeConnector) { WalletPassword = walletPassword, WalletPhase = walletPhase }; return(true); }
/// <summary> /// Connect to the network of blockchain. /// </summary> /// <returns></returns> public static async Task <bool> ConnectToBlockchainAsync() { classSeedNodeConnector?.DisconnectToSeed(); classSeedNodeConnector = null; classSeedNodeConnector = new ClassSeedNodeConnector(); ListOfMiningMethodName?.Clear(); ListOfMiningMethodContent?.Clear(); if (!await classSeedNodeConnector.StartConnectToSeedAsync(string.Empty)) { IsConnected = false; return(false); } if (!FirstStart) { FirstStart = true; CheckBlockchainConnection(); } IsConnected = true; return(true); }