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

[WIP] support for Config files #14

Closed
wants to merge 1 commit into from
Closed

Conversation

procrypt
Copy link

@procrypt procrypt commented Jun 13, 2018

Fixes #13 I don't yet what all config options we are supporting yet so for now its is a WIP.
@arcolife @samikshan

@@ -41,10 +42,21 @@ type Config struct {
NumKeys int // NumKeys is the count of IP addresses (BFT nodes) participating
}

// LoadConfig ini file
func LoadConfig() (configData *ini.File, err error) {
configData, err = ini.Load("/home/abhishek/truechain/cfg.ini")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sure you're already working on eliminating this hardcoded path to the cfg.ini file.

Copy link
Author

Choose a reason for hiding this comment

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

@samikshan yes.

Copy link
Author

Choose a reason for hiding this comment

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

@samikshan I have updated the PR.

src/cmds/main.go Outdated
@@ -28,7 +28,7 @@ import (
func main() {

cfg := pbft.Config{}
cfg.HostsFile = path.Join(os.Getenv("HOME"), "hosts") // TODO: read from config.yaml in future.
cfg.HostsFile = path.Join(os.Getenv("PWD"), "hosts") // TODO: read from config.yaml in future.
Copy link
Collaborator

Choose a reason for hiding this comment

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

hey, change this just like you did here? https://github.com/truechain/truechain-consensus-core/pull/14/files#diff-7bde18e8151279ab2e05cde5897db6f8R1220
I could be running from anywhere, conf resides in /etc/truechain/ (or something like that as default) and then change-able.

Copy link
Author

Choose a reason for hiding this comment

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

It can be ran from anywhere, log_folder is just one of the field in the cnf.ini file. The path defined on cfg.ini can be anything like

[keys]
pem_keys = /tmp/truechain/keys
[log]
logs = /tmp/truechain/logs

or

[keys]
pem_keys = /etc/truechain/keys
[log]
logs = /etc/truechain/logs

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, but it's not reading that from conf. Add an additional check (if not found in config, then read from PWD) ?

@procrypt
Copy link
Author

@arcolife made the changes.

@arcolife arcolife mentioned this pull request Jul 13, 2018
@arcolife
Copy link
Collaborator

@procrypt some conflicts here.. also we have a config system now. Might wanna revisit this? Whaazzup

@procrypt
Copy link
Author

@arcolife I'll update it as per the new config system 👍

@procrypt
Copy link
Author

@arcolife can you please point me to the new config system we have now.

@arcolife
Copy link
Collaborator

arcolife commented Jul 23, 2018

covering this in #57 (comment) (will wrap any commits in there so as to not loose the author. Example grafana/grafana@2fdda79)

@arcolife arcolife closed this Jul 23, 2018
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.

None yet

3 participants