Esempio n. 1
0
        public static RPCArgs Parse(TextFileConfiguration confArgs, ChainInformation chainInfo)
        {
            var prefix = chainInfo.Names[0];

            try
            {
                var url = confArgs.GetOrDefault <string>(prefix + "rpc.url", chainInfo.DefaultRPCUrl.AbsoluteUri);
                return(new RPCArgs()
                {
                    User = confArgs.GetOrDefault <string>(prefix + "rpc.user", chainInfo.DefaultCredential?.UserName),
                    Password = confArgs.GetOrDefault <string>(prefix + "rpc.password", chainInfo.DefaultCredential?.Password),
                    CookieFile = confArgs.GetOrDefault <string>(prefix + "rpc.cookiefile", chainInfo.GetDefaultCookieFilePath()),
                    Url = url == null ? null : new Uri(url)
                });
            }
            catch (FormatException)
            {
                throw new ConfigException("rpc.url is not an url");
            }
        }
Esempio n. 2
0
 public SupportedChain(RPCArgs args, ChainInformation info)
 {
     this._Args  = args;
     Information = info;
 }