I am currently experimenting with Geth on ios. I've imported Geth using cocoapods and trying to run the (light) node.
Config:
Geth version: 1.6.5 (but I have tried 1.6.1, 1.6.2, 1.6.3, 1.6.4 and 1.6.6-unstable)
OS & Version: OSX Sierra 10.12.5 / Xcode 8.3.2 (8E2002)
Language: Swift 3
Simply adding "import Geth" to my ViewController file crashes the LLBD RPC server on the simulator (or the app on a device). On the simulator it messes up the debugging tools of Xcode (break points, etc).
On the simulator the node seem to start but does not establish a connection with peers and does not synch.
The relevant code is as follows:
let bootstrap = GethNewEnodes(2)
do {
try bootstrap?.set(0,enode: GethNewEnode("enode://20c9ad97c081d63397d7b685a412227a40e23c8bdc6688c6f37e97cfbc22d2b4d1db1510d8f61e6a8866ad7f0e17c02b14182d37ea7c3c8b9c2683aeb6b733a1@52.169.14.227:30303", &error))
try bootstrap?.set(1, enode: GethNewEnode("enode://6ce05930c72abc632c58e2e4324f7c7ea478cec0ed4fa2528982cf34483094e9cbc9216e7aa349691242576d552a2a56aaeae426c5303ded677ce455ba1acd9d@13.84.180.240:30303"
, &error))
} catch let ee {
print(ee.localizedDescription)
}
// configuration of the nodes
let config = GethNewNodeConfig()
config?.setEthereumGenesis(GethTestnetGenesis())
config?.setEthereumNetworkID(3)
config?.setBootstrapNodes(bootstrap)
config?.setEthereumEnabled(true)
config?.setMaxPeers(25)
config?.setWhisperEnabled(false)
// create new node
node = GethNewNode(nodeDir.path, config, &error)
do {
try node?.start()
} catch let err {
print("error: \(err.localizedDescription)")
}
The node logs are:
WARN [06-14|11:33:30] Failed to start Ledger hub, disabling: unsupported platform
INFO [06-14|11:33:30] Starting peer-to-peer node instance=iGeth/v1.6.6-unstable/darwin-amd64/go1.8.3
INFO [06-14|11:33:30] Allocated cache and file handles database=/Users/XXXX/Library/Developer/CoreSimulator/Devices/D1F71E22-095A-4B7B-8007-012A38A136CB/data/Containers/Data/Application/7871D2F6-1A0E-45D9-A48E-4170DF187020/Documents/ethereum/iGeth/lightchaindata cache=16 handles=16
INFO [06-14|11:33:30] Initialised chain configuration config="{ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10 Metropolis: 9223372036854775807 Engine: ethash}"
INFO [06-14|11:33:30] Disk storage enabled for ethash caches dir=/Users/XXXX/Library/Developer/CoreSimulator/Devices/D1F71E22-095A-4B7B-8007-012A38A136CB/data/Containers/Data/Application/7871D2F6-1A0E-45D9-A48E-4170DF187020/Documents/ethereum/iGeth/ethash count=3
INFO [06-14|11:33:30] Disk storage enabled for ethash DAGs dir=/Users/XXXX/Library/Developer/CoreSimulator/Devices/D1F71E22-095A-4B7B-8007-012A38A136CB/data/Containers/Data/Application/7871D2F6-1A0E-45D9-A48E-4170DF187020/.ethash count=2
INFO [06-14|11:33:30] Loaded most recent local header number=0 hash=419410…ca4a2d td=1048576
INFO [06-14|11:33:30] Starting P2P networking
WARN [06-14|11:33:30] Light client mode is an experimental feature
INFO [06-14|11:33:30] RLPx listener up self="enode://d390f94b00eb9326089e903799607d4445472e0bb96fca4488c66a5dfeaa8b195b0681a3d867ad33c067303b29ee4296dee95e499dfe5a286dff1152328a2801@[::]:49771?discport=0"
Am I doing something wrong (in particular with the configuration of the node)?
Any help would be greatly appreciated.