valora-inc / wallet

The official repository for the Valora mobile cryptocurrency wallet.
https://valora.xyz
Apache License 2.0
171 stars 81 forks source link

[Stretch] Test full node discovery in the wallet #809

Closed cmcewen closed 1 year ago

cmcewen commented 4 years ago

Expected Behavior

Ensure the wallet can connect to full nodes

jio-gl commented 4 years ago

@cmcewen

We need to add bootnodes on src/geth/networkConfig.ts like this:

"bootnodeEnodes": [ // --bootnodesv5 / Enodes of v5 bootnodes for p2p discovery
      "enode://XXXX@X[::]:XXXX",
      "enode://YYYY@Y[::]:YYYY"
    ],

Static nodes do not allow for network discovery but bootnodes yes. Discovery is turned on by default but without bootnodes there is not network discovery.

Based on: https://github.com/celo-org/react-native-geth/blob/6e28c21903ae16d815f8969d154b46c9d27088da/README.md

jio-gl commented 4 years ago

static_nodes has a JSON list but env_bootnodes has a character separated list.

static_nodes:

["enode://pubkey1@ip1:30303","enode://pubkey2@ip2:30303", ...]

env_bootnodes:

enode://somepubkey@someip:30303

I will assume they are separated by ;, same format as in geth parameters.

jio-gl commented 4 years ago

I have an issued building contractkit:

src/geth/networkConfig.ts:1:10 - error TS2305: Module '"../../../../../../../../Users/jose/celo/celo-monorepo/packages/contractkit/lib"' has no exported member 'BootnodeUtils'.

1 import { BootnodeUtils } from '@celo/contractkit'
           ~~~~~~~~~~~~~
jio-gl commented 4 years ago

Configuration was plugged, not sure how to see geth logs now to see any diff with static nodes:

[Wed Jun 03 2020 21:20:33.504]  DEBUG    geth/saga@gethSagaIfNecessary/Starting geth saga...
[Wed Jun 03 2020 21:20:33.505]  DEBUG    geth/saga/Initializing Geth
[Wed Jun 03 2020 21:20:33.507]  DEBUG    Geth@getGeth/Getting Geth Instance
[Wed Jun 03 2020 21:20:33.508]  INFO     Geth@init/Create a new Geth instance
[Wed Jun 03 2020 21:20:33.509]  LOG      Running "celo" with {"rootTag":31,"initialProps":{"isHeadless":false}}
[Wed Jun 03 2020 21:20:33.510]  INFO     CeloAnalytics/Analytics is disabled, not tracking event APP_LOADED
[Wed Jun 03 2020 21:20:33.512]  LOG      socket-0 ["closing"]
[Wed Jun 03 2020 21:20:33.514]  LOG      socket-0 ["closed"]
[Wed Jun 03 2020 21:20:33.515]  DEBUG    Geth@ensureGenesisBlockWritten/genesis block already written
[Wed Jun 03 2020 21:20:33.516]  DEBUG    Geth@maybeInitStaticNodes/static nodes already initialized
[Wed Jun 03 2020 21:20:33.518]  DEBUG    Geth@newGeth/Configure and create new Geth
[Wed Jun 03 2020 21:20:33.586]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.597]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.605]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.611]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.615]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.621]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.625]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.635]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.641]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.679]  DEBUG    sentry/Sentry/initializeSentryUserContext, Setting Sentry user context to account "0xeb370de7971347cecc338d64047198b427ae5e17"
[Wed Jun 03 2020 21:20:33.686]  DEBUG    home/saga/Fetching all balances
[Wed Jun 03 2020 21:20:33.718]  INFO     %s: Calling `getNode()` on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release. ["ReactNativeFiberHostComponent"]
[Wed Jun 03 2020 21:20:33.726]  DEBUG    Geth@newGeth/Network ID is 44786, syncMode is 5
[Wed Jun 03 2020 21:20:33.800]  DEBUG    app/saga/App version is valid
[Wed Jun 03 2020 21:20:33.804]  DEBUG    i18n/Skipping user language cache en-US
[Wed Jun 03 2020 21:20:33.807]  LOG      i18next: languageChanged ["en-US"]
[Wed Jun 03 2020 21:20:33.823]  INFO     clockInSync/Local time: 6/3/2020, 9:20:33 PM Remote time: 6/3/2020, 9:20:33 PM drift: 72 milliseconds
[Wed Jun 03 2020 21:20:33.832]  INFO     firebase/firebase/Firebase Auth initialized successfully
[Wed Jun 03 2020 21:20:33.833]  INFO     firebase/firebase/Setting language selection for user 0xeb370de7971347cecc338d64047198b427ae5e17
[Wed Jun 03 2020 21:20:33.835]  INFO     firebase/firebase/Initializing Firebase Cloud Messaging
[Wed Jun 03 2020 21:20:33.953]  INFO     CommentEncryption/Could not decrypt: Buffer length too short
[Wed Jun 03 2020 21:20:33.977]  INFO     firebase/firebase/Registering Firebase client FCM token
[Wed Jun 03 2020 21:20:34.350]  INFO     firebase/firebase/User Language synced successfully, en-US
[Wed Jun 03 2020 21:20:34.540]  DEBUG    Geth@newGeth/Bootnodes!!!! =  enode://e99a883d0b7d0bacb84cde98c4729933b49adbc94e718b77fdb31779c7ed9da6c49236330a9ae096f42bcbf6e803394229120201704b7a4a3ae8004993fa0876@35.247.115.108:30303
jio-gl commented 4 years ago

Commented out static nodes and is not working with the bootnodes available on alfajores:

2020-06-04 12:35:52.463 [info][tid:com.facebook.react.JavaScript] geth/saga@monitorGeth/Did not receive a block in 30000 milliseconds:
tarikbellamine commented 3 years ago

@nityas this epic is over but should this still be open?