Skip to content

Commit

Permalink
add config and app skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanschalm committed Jun 8, 2017
1 parent b120ac0 commit c3c5195
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package app

import "github.com/ubclaunchpad/cumulus/conf"

var (
config *conf.Config
// TODO peer store once it's merged in
)

// Run sets up and starts a new Cumulus node with the
// given configuration.
func Run(c conf.Config) {
config = &c
// Create peer store
// Open listening port
// If target specified, try to open connection

// Ask target for its peers
// Connect to these peers until we have enough peers
}
17 changes: 17 additions & 0 deletions conf/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package conf

// Config contains all configuration options for a node.
type Config struct {
// The interface to listen on for new connections.
Interface string
// The port to listen on for new connections.
Port uint16
// The address of the ingress node we should use to connect
// to the network.
Target string

// Whether or not to enable verbose logging.
Verbose bool
// Whether or not to participate in mining new blocks.
Mine bool
}

0 comments on commit c3c5195

Please sign in to comment.