Example #1
0
        public static List <IPool> ListPools()
        {
            List <IPool> pools = new List <IPool>();

            var poolArray = JArray.Parse(PoolAsync.ListPoolsAsync().Result);

            /*
             *   json will be like this: [{\"pool\":\"qPKbDswvLm\"},{\"pool\":\"m4f5A8ADMk\"}
             *   we want to convert those into IPool instances
             */
            foreach (var onePool in poolArray)
            {
                IPool pool = new PoolInstance()
                {
                    Name = onePool["pool"].ToString()
                };

                pools.Add(pool);
            }

            return(pools);
        }
Example #2
0
 public void Open()
 {
     _asyncHandle = PoolAsync.OpenPoolLedgerAsync(Name, CreateConfigJson()).Result;
     Handle       = _asyncHandle.Handle;
 }
Example #3
0
 public void Delete()
 {
     PoolAsync.DeletePoolLedgerConfigAsync(Name).Wait();
 }
Example #4
0
 public void Create()
 {
     PoolAsync.SetProtocolVersionAsync(ProtocolVersion).Wait();
     PoolAsync.CreatePoolLedgerConfigAsync(Name, CreateConfigJson()).Wait();
 }