BitSharp.Node.BitSharpNode.StartAsync C# (CSharp) Method

StartAsync() public method

public StartAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task StartAsync()
        {
            await Task.WhenAll(
                // start the blockchain daemon
                Task.Run(() => CoreDaemon.Start()),
                // start p2p client
                Task.Run(() => LocalClient.Start(nodeConfig.ConnectToPeers)));
        }
    }

Usage Example

Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            try
            {
                using (var bitSharpNode = new BitSharpNode(args, strictArgs: true))
                {
                    bitSharpNode.StartAsync().Forget();

                    Console.WriteLine("Press enter to exit node.");
                    Console.ReadLine();
                    Console.WriteLine("Shutting down.");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Environment.Exit(-1);
            }
        }
All Usage Examples Of BitSharp.Node.BitSharpNode::StartAsync