Conversation
nategraf
left a comment
There was a problem hiding this comment.
Looks like you are also going to solve what I had in mind for celo-org/celo-monorepo#4439
This is super useful! 🙌
| noDiscovery: false, // --nodiscover / determines if the node will not participate in p2p discovery (v5) | ||
| syncMode: 5, // the number associated with a sync mode in `celo-blockchain/mobile/geth.go` | ||
| // HTTP RPC server - only intended for development & debugging | ||
| httpHost: '0.0.0.0', // host of the server |
There was a problem hiding this comment.
I don't think we should suggest opening RPC on 0.0.0.0:8545 because that could allow anyone on the local network to access the node and completely compromise the node, possible also attacking the device through the javascript execution features allowed by the debug API. Opening on 127.0.0.1:8545 is better. With this, we should definitely add a stronger warning here about only using this in debug mode because opening the network socket allows any app on the device to access the node with full permissions.
| nodeconfig.setValue(ipcPath, forKey: "IPCPath") | ||
| assert(nodeconfig.ipcPath == ipcPath) | ||
| } | ||
| if let logFile = config?["logFile"] as? String { |
There was a problem hiding this comment.
👍 I actually wanted to bring this up, I noticed it was happening only on android.
| networkID: networkID, // --networkid / Network identifier (integer, 0=Olympic (disused), 1=Frontier, 2=Morden (disused), 3=Ropsten) (default: 1) | ||
| maxPeers: 0, // --maxpeers / Maximum number of network peers (network disabled if set to 0) (default: 25) | ||
| genesis: genesis, // genesis.json file | ||
| nodeDir: '.private-ethereum', // --datadir / Data directory for the databases and keystore |
There was a problem hiding this comment.
Not a new change but at some point can update to celo
| "enode://YYYY@Y[::]:YYYY" | ||
| ], | ||
| "networkID": networkID, // --networkid / Network identifier (integer, 0=Olympic (disused), 1=Frontier, 2=Morden (disused), 3=Ropsten) (default: 1) | ||
| "networkID": networkID, // --networkid / Network identifier (integer, 42220=mainnet, 62320=baklava (testnet), 44787=alfajores (testnet)) (default: 1) |
| "maxPeers": 0, // --maxpeers / Maximum number of network peers (network disabled if set to 0) (default: 25) | ||
| "genesis": genesis, // genesis.json file | ||
| "nodeDir": ".private-ethereum", // --datadir / Data directory for the databases and keystore | ||
| "nodeDir": ".celo", // --datadir / Data directory for the databases and keystore |
There was a problem hiding this comment.
Thinking out loud, we'll want to make sure an update from Valora 1.0.1 to 1.1.0 with these changes doesn't throw errors due to the changed nodeDir. Agree we should make this change here though 👍
There was a problem hiding this comment.
Fwiw the approach the app does is specifying .${DEFAULT_TESTNET} as the nodeDir, I think (not totally sure) it tolerates a change well
### Description Should not be merged until valora-xyz/react-native-geth#28 is merged (which itself relies upon celo-org/celo-blockchain#1132), and then the react-native-geth version in this PR will be updated. This uses the enodes that are used for static nodes as bootnodes for discovery. The current bootnodes that are deployed do not support the type of discovery required by mobile clients (discovery v5), but the static nodes do. Having more nodes as bootnodes will also help with discovery speed & diversity of the nodes discovered. When testing on baklava with both static nodes and discovery enabled, peering was nearly immediate. When only testing with discovery enabled and no static nodes, peering was very quick (< a few seconds). A few times I found when only relying upon discovery that no peers would be found, so I recommend keeping static nodes & discovery for the time being. ### Other changes I added some instructions on how to attach to the geth instance on the app. ### Tested Ran a lot on android & iOS devices ### Related issues ### Backwards compatibility Requires updates from react-native-geth (valora-xyz/react-native-geth#28) and celo-blockchain (celo-org/celo-blockchain#1132) to work as intended
### Description Should not be merged until valora-xyz/react-native-geth#28 is merged (which itself relies upon celo-org/celo-blockchain#1132), and then the react-native-geth version in this PR will be updated. This uses the enodes that are used for static nodes as bootnodes for discovery. The current bootnodes that are deployed do not support the type of discovery required by mobile clients (discovery v5), but the static nodes do. Having more nodes as bootnodes will also help with discovery speed & diversity of the nodes discovered. When testing on baklava with both static nodes and discovery enabled, peering was nearly immediate. When only testing with discovery enabled and no static nodes, peering was very quick (< a few seconds). A few times I found when only relying upon discovery that no peers would be found, so I recommend keeping static nodes & discovery for the time being. ### Other changes I added some instructions on how to attach to the geth instance on the app. ### Tested Ran a lot on android & iOS devices ### Related issues ### Backwards compatibility Requires updates from react-native-geth (valora-xyz/react-native-geth#28) and celo-blockchain (celo-org/celo-blockchain#1132) to work as intended
This should be merged when celo-org/celo-blockchain#1132 is merged
noDiscoveryandbootnodeEnodesto enable discoverylogFileandlogFileLogLevelconfiguration for iOS, which did not exist previously