internal static void InitializeStore(JObj storecfg) { // create db source dbSource = new DbSource(storecfg); // create self peer info self = new Peer(storecfg) { }; // load peer connectors // using var dc = NewDbContext(); dc.Sql("SELECT ").collst(Peer.Empty).T(" FROM peers_ WHERE state > 0"); var arr = dc.Query <Peer>(); if (arr != null) { foreach (var peer in arr) { var cli = new FedClient(peer); okayed.TryAdd(cli.Key, cli); // init current block id // await o.PeekLastBlockAsync(dc); } } // start the puller thead puller = new Thread(Replicate) { Name = "Block Puller" }; puller.Start(); }
internal LdgrContext(FedClient connector) { this.connector = connector; }