Skip to content

Feature load environment config#851

Merged
erikzhang merged 11 commits intoneo-project:masterfrom
Ashuaidehao:feature-load_environment_config
Jun 22, 2019
Merged

Feature load environment config#851
erikzhang merged 11 commits intoneo-project:masterfrom
Ashuaidehao:feature-load_environment_config

Conversation

@Ashuaidehao
Copy link
Copy Markdown
Contributor

load environmental config filles for NEO3 .

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 21, 2019

Codecov Report

Merging #851 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #851      +/-   ##
==========================================
+ Coverage    38.7%   38.73%   +0.03%     
==========================================
  Files         176      176              
  Lines       12482    12489       +7     
==========================================
+ Hits         4831     4838       +7     
  Misses       7651     7651
Impacted Files Coverage Δ
neo/ProtocolSettings.cs 94% <100%> (ø) ⬆️
neo/Helper.cs 47.05% <100%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfed8ba...1ce3f1e. Read the comment docs.

neo/Helper.cs Outdated
{
var env = Environment.GetEnvironmentVariable("NEO_NETWORK");
var configFile = string.IsNullOrWhiteSpace(env) ? $"{config}.json" : $"{config}.{env}.json";
Plugin.Log(nameof(LoadConfig), LogLevel.Info, $"Config loading:{configFile}");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to remove this line. Because this is a common method, this can cause the logs to become confusing. The caller should log by itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure,I've removed it.

Copy link
Copy Markdown
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even protocol.json would be loadded like this, right?

Is this in connection with #845?
Can you provide more details about the design, @Ashuaidehao. I did not understand it very well.

@Ashuaidehao
Copy link
Copy Markdown
Contributor Author

@vncoelho ,it use a enviroment variable to control which config file should be used .
I has write a simple program to show how it works:
Neo_Network

It would be useful to use this feature load both "config.json" and "protocol.json" .

@erikzhang erikzhang merged commit 87ea7c6 into neo-project:master Jun 22, 2019
Tommo-L pushed a commit to Tommo-L/neo that referenced this pull request Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants