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

Expose mobile http server #2

Merged
merged 19 commits into from
Jul 6, 2018
Merged
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ build/_vendor/pkg

# used by the Makefile
/build/_workspace/
/build/bin/
/build/bin/*
!/build/bin/geth.aar
/geth*.zip

# travis
Expand All @@ -45,3 +46,5 @@ profile.cov
/dashboard/assets/package-lock.json

**/yarn-error.log


Binary file added build/bin/geth.aar
Binary file not shown.
Binary file added geth-sources.jar
Binary file not shown.
17 changes: 13 additions & 4 deletions mobile/geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ type NodeConfig struct {

// Listening address of pprof server.
PprofAddress string

// Host of the http server
Copy link
Member

Choose a reason for hiding this comment

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

Delete before merging?

// HTTPHost string

// // Port the http server is listening on
// HTTPPort int
}

// defaultNodeConfig contains the default node configuration values to use if all
Expand Down Expand Up @@ -118,10 +124,13 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {

// Create the empty networking stack
nodeConf := &node.Config{
Name: clientIdentifier,
Version: params.Version,
DataDir: datadir,
KeyStoreDir: filepath.Join(datadir, "keystore"), // Mobile should never use internal keystores!
Name: clientIdentifier,
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing this line is showing ups as different because of whitespaces changes. Consider running gofmt.

Copy link
Member

Choose a reason for hiding this comment

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

Let's also add a TODO here to revisit this to explore using IPC instead of a websocket.

Version: params.Version,
DataDir: datadir,
KeyStoreDir: filepath.Join(datadir, "keystore"), // Mobile should never use internal keystores!
HTTPHost: "localhost",
HTTPPort: 8545,
HTTPVirtualHosts: []string{"localhost"},
P2P: p2p.Config{
NoDiscovery: true,
DiscoveryV5: true,
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@celo/geth",
"version": "0.0.1",
"description": "celo geth"
}