Skip to content

Commit

Permalink
removed cothorityd
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Jan 4, 2017
1 parent 9366f23 commit d55f4c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (

// DefaultConfig is the name of the binary we produce and is used to create a directory
// folder with this name
const DefaultConfig = "cothorityd"
const DefaultConfig = "cothority"

// CmdSetup is used to setup the cothority
var CmdSetup = cli.Command{
Name: "setup",
Aliases: []string{"s"},
Usage: "Setup the configuration for the server (interactive)",
Action: func(c *cli.Context) error {
InteractiveConfig("cothorityd")
InteractiveConfig("cothority")
return nil
},
}
Expand Down
16 changes: 8 additions & 8 deletions app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import (
"github.com/dedis/onet/network"
)

// CothoritydConfig is the configuration structure of the cothority daemon.
type CothoritydConfig struct {
// CothorityConfig is the configuration structure of the cothority daemon.
type CothorityConfig struct {
Public string
Private string
Address network.Address
Description string
}

// Save will save this CothoritydConfig to the given file name. It
// Save will save this CothorityConfig to the given file name. It
// will return an error if the file couldn't be created or if
// there is an error in the encoding.
func (hc *CothoritydConfig) Save(file string) error {
func (hc *CothorityConfig) Save(file string) error {
fd, err := os.Create(file)
if err != nil {
return err
Expand All @@ -37,11 +37,11 @@ func (hc *CothoritydConfig) Save(file string) error {
return nil
}

// ParseCothorityd parses the config file into a CothoritydConfig.
// It returns the CothoritydConfig, the Host so we can already use it, and an error if
// ParseCothority parses the config file into a CothorityConfig.
// It returns the CothorityConfig, the Host so we can already use it, and an error if
// the file is inaccessible or has wrong values in it.
func ParseCothorityd(file string) (*CothoritydConfig, *onet.Conode, error) {
hc := &CothoritydConfig{}
func ParseCothority(file string) (*CothorityConfig, *onet.Conode, error) {
hc := &CothorityConfig{}
_, err := toml.DecodeFile(file, hc)
if err != nil {
return nil, nil, err
Expand Down
8 changes: 4 additions & 4 deletions app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func InteractiveConfig(binaryName string) {

// create the keys
privStr, pubStr := createKeyPair()
conf := &CothoritydConfig{
conf := &CothorityConfig{
Public: pubStr,
Private: privStr,
Address: publicAddress,
Expand Down Expand Up @@ -219,10 +219,10 @@ func createKeyPair() (string, string) {
return privStr, pubStr
}

// saveFiles takes a CothoritydConfig and its filename, and a GroupToml and its filename,
// saveFiles takes a CothorityConfig and its filename, and a GroupToml and its filename,
// and saves the data to these files.
// In case of a failure it Fatals.
func saveFiles(conf *CothoritydConfig, fileConf string, group *GroupToml, fileGroup string) {
func saveFiles(conf *CothorityConfig, fileConf string, group *GroupToml, fileGroup string) {
if err := conf.Save(fileConf); err != nil {
log.Fatal("Unable to write the config to file:", err)
}
Expand Down Expand Up @@ -352,7 +352,7 @@ func RunServer(configFilename string) {
log.Fatalf("[-] Configuration file does not exists. %s", configFilename)
}
// Let's read the config
_, conode, err := ParseCothorityd(configFilename)
_, conode, err := ParseCothority(configFilename)
if err != nil {
log.Fatal("Couldn't parse config:", err)
}
Expand Down

0 comments on commit d55f4c7

Please sign in to comment.