コード例 #1
0
ファイル: CliGenerator.cs プロジェクト: uzbekdev1/nethermind
        public void Generate()
        {
            string      docsDir  = DocsDirFinder.FindCli();
            List <Type> cliTypes = GetCliModules();

            foreach (Type cliType in cliTypes)
            {
                GenerateDocFileContent(cliType, docsDir);
            }
        }
コード例 #2
0
        public void Generate()
        {
            string      docsDir  = DocsDirFinder.FindJsonRpc();
            List <Type> rpcTypes = GetRpcModules();

            foreach (Type rpcType in rpcTypes)
            {
                GenerateDocFileContent(rpcType, docsDir);
            }
        }
コード例 #3
0
        public void Generate()
        {
            string      docsDir     = DocsDirFinder.FindDocsDir();
            List <Type> configTypes = GetConfigModules();

            foreach (Type configType in configTypes)
            {
                GenerateDocFileContent(configType, docsDir);
            }
        }
コード例 #4
0
        public void Generate()
        {
            string docsDir    = DocsDirFinder.FindDocsDir();
            string runnerDir  = DocsDirFinder.FindRunnerDir();
            string moduleName = "sample-configuration";

            string[] configs = { "mainnet.cfg", "goerli.cfg", "rinkeby.cfg", "ropsten.cfg" };

            StringBuilder docBuilder = new StringBuilder();

            docBuilder.AppendLine("---");
            docBuilder.AppendLine("description: Sample Fast Sync configurations for Nethermind");
            docBuilder.AppendLine("---");
            docBuilder.AppendLine();
            docBuilder.AppendLine("# Sample configuration");
            docBuilder.AppendLine();
            _markdownGenerator.OpenTabs(docBuilder);

            foreach (string config in configs)
            {
                _markdownGenerator.CreateTab(docBuilder, config);
                docBuilder.AppendLine("```yaml");
                string[] configData = File.ReadAllLines($"{runnerDir}/configs/{config}");

                foreach (string line in configData)
                {
                    docBuilder.AppendLine(line);
                }
                docBuilder.AppendLine("```");
                _markdownGenerator.CloseTab(docBuilder);
            }

            // Write sample docker-compose .env file
            var env = "mainnet_env";

            _markdownGenerator.CreateTab(docBuilder, env);
            docBuilder.AppendLine("```yaml");
            string[] envData = File.ReadAllLines($"./envs/{env}");

            foreach (string line in envData)
            {
                docBuilder.AppendLine(line);
            }
            docBuilder.AppendLine("```");
            _markdownGenerator.CloseTab(docBuilder);

            _markdownGenerator.CloseTabs(docBuilder);

            string path = string.Concat(docsDir, "/ethereum-client/configuration");

            _sharedContent.Save(moduleName, path, docBuilder);
        }
コード例 #5
0
        public void Generate()
        {
            string docsDir = DocsDirFinder.FindDocsDir();
            RpcAndCliDataProvider rpcAndCliDataProvider = new RpcAndCliDataProvider();

            Dictionary <string, Dictionary <string, MethodData> > modulesData =
                rpcAndCliDataProvider.GetRpcAndCliData();

            foreach (string moduleName in modulesData.Keys)
            {
                modulesData.TryGetValue(moduleName, out var moduleMethods);
                GenerateDocFileContent(moduleName, moduleMethods, docsDir);
            }
        }
コード例 #6
0
ファイル: MetricsGenerator.cs プロジェクト: oozan/nethermind
        public void Generate()
        {
            string docsDir = DocsDirFinder.FindDocsDir();

            //ToFix: Create MetricsCategoryAttribute and add MetricsCategory attribute to every "Metrics" class and load Metrics automatically instead of manually
            Type metricsType = Assembly.Load("Nethermind.Blockchain").GetTypes()
                               .First(t => typeof(Blockchain.Metrics).IsAssignableFrom(t));

            GenerateDocFileContent(metricsType, "Blockchain", docsDir);

            metricsType = Assembly.Load("Nethermind.Evm").GetTypes()
                          .First(t => typeof(Evm.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Evm", docsDir);

            metricsType = Assembly.Load("Nethermind.JsonRpc").GetTypes()
                          .First(t => typeof(JsonRpc.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "JsonRpc", docsDir);

            metricsType = Assembly.Load("Nethermind.Network").GetTypes()
                          .First(t => typeof(Network.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Network", docsDir);

            metricsType = Assembly.Load("Nethermind.Db").GetTypes()
                          .First(t => typeof(Db.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Store", docsDir);

            metricsType = Assembly.Load("Nethermind.Consensus.AuRa").GetTypes()
                          .First(t => typeof(Consensus.AuRa.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Consensus.Aura", docsDir);

            metricsType = Assembly.Load("Nethermind.Runner").GetTypes()
                          .First(t => typeof(Runner.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Runner", docsDir);

            metricsType = Assembly.Load("Nethermind.Synchronization").GetTypes()
                          .First(t => typeof(Synchronization.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Synchronization", docsDir);

            metricsType = Assembly.Load("Nethermind.Trie").GetTypes()
                          .First(t => typeof(Trie.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "Trie", docsDir);

            metricsType = Assembly.Load("Nethermind.TxPool").GetTypes()
                          .First(t => typeof(TxPool.Metrics).IsAssignableFrom(t));
            GenerateDocFileContent(metricsType, "TxPool", docsDir);
        }
コード例 #7
0
        public void Generate()
        {
            string docsDir = DocsDirFinder.FindDocsDir();

            string[] dlls = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "Nethermind.*.dll")
                            .OrderBy(n => n).ToArray();

            foreach (string dll in dlls)
            {
                Assembly assembly = Assembly.LoadFile(dll);
                Type[]   modules  = assembly.GetExportedTypes().Where(t => typeof(IConfig).IsAssignableFrom(t) && t.IsInterface).ToArray();

                foreach (Type module in modules)
                {
                    GenerateDocFileContent(module, docsDir);
                }
            }
        }