Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REM-1366: Integrate configuration file reading to the commands #21

Merged
merged 7 commits into from
Apr 24, 2019

Conversation

anastasiia-bilova
Copy link
Contributor

@anastasiia-bilova anastasiia-bilova commented Apr 22, 2019

Jira references

Description

Using the command line interface, you will have an option to declare the node URL to send commands to as illustrated below:

$ remme account get-balance \
      --address=1120076ecf036e857f42129b58303bcf1e03723764a1702cbe98529802aad8514ee3cf \
      --node-url=node-genesis-testnet.remme.io

You shouldn't declare node URL every time when you execute a command, use configuration file instead. Configuration file is required to be named .remme-core-cli.yml and located in the home directory (~/).

The configuration file have an optional section to declare node URL to send commands to:

node-url: node-genesis-testnet.remme.io

Try it out by downloading the example of the configuration file to the home directory.

$ curl -L https://git.io/fj3Mi > ~/.remme-core-cli.yml

The node URL will be read every time from the configuration file (.remme-core-cli.yml) unless you provide it in the command line interface:

$ remme account get-balance \
      --address=1120076ecf036e857f42129b58303bcf1e03723764a1702cbe98529802aad8514ee3cf

If you do not provide the node URL neither in the command line interface nor in the configuration file, node URL will be equal to localhost by default.

@codecov-io
Copy link

codecov-io commented Apr 22, 2019

Codecov Report

Merging #21 into develop will decrease coverage by 0.42%.
The diff coverage is 90%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #21      +/-   ##
===========================================
- Coverage    95.45%   95.03%   -0.43%     
===========================================
  Files           10       10              
  Lines          154      161       +7     
===========================================
+ Hits           147      153       +6     
- Misses           7        8       +1
Impacted Files Coverage Δ
cli/config.py 100% <100%> (ø) ⬆️
cli/utils.py 87.5% <80%> (-4.17%) ⬇️

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 0278639...a33e93d. Read the comment docs.

@anastasiia-bilova anastasiia-bilova force-pushed the integrate-config-file-reading-to-commands branch from f51d2b5 to 6d5bed5 Compare April 23, 2019 16:25
@@ -44,8 +44,12 @@ def read(self, name):

Return dictionary.
"""
with open(self.path + '/.' + name + '.yml') as config_file:
return yaml.safe_load(config_file)
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Return dictionary > Return dictionary if configurations are presented, else None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anastasiia-bilova anastasiia-bilova force-pushed the integrate-config-file-reading-to-commands branch from eae70f2 to a33e93d Compare April 24, 2019 11:45
@anastasiia-bilova anastasiia-bilova merged commit 850d3a3 into develop Apr 24, 2019
@delete-merged-branch delete-merged-branch bot deleted the integrate-config-file-reading-to-commands branch April 24, 2019 11:58
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.

4 participants