The Status module that consumes go-ethereum https://status.im
Go to file
Dmitry Shulyak 707221954f
Make whisper tolerant to local time skews (#864)
This change adds adds an ability to use different source of time for whisper:

when envelope is created it is used to set expiry
to track when envelope needs to be expired
This time is then used to check validity of the envelope when it is received. Currently If we receive an envelope that is sent from future - peer will get disconnected. If envelope that was received has an expiry less then now it will be simply dropped, if expiry is less than now + 10*2 seconds peer will get dropped.

So, it is clear that whisper depends on time. And any time we get a skew with peers that is > 20s reliability will be grealy reduced.

In this change another source of time for whisper will be used. This time source will use ntp servers from pool.ntp.org to compute offset. When whisper queries time - this offset will be added/substracted from current time.

Query is executed every 2 mins, queries 5 different servers, cut offs min and max and the computes mean value. pool.ntp.org is resolved to different servers and according to documentation you will rarely hit the same.

Closes: #687
2018-05-04 11:23:38 +03:00
.github Move CONTRIBUTING.md to top level (#798) 2018-04-04 12:51:05 +02:00
.vscode Add config required to debug statusd on VS Code 2018-05-01 14:15:43 +02:00
_assets Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
cmd Remove mention of DevMode (#869) 2018-04-26 19:59:57 +02:00
extkeys use iota to define entropy strengths 2018-03-15 00:29:56 +01:00
geth Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
lib Move signal logic into signal package 2018-05-03 09:35:58 +02:00
logutils Add LogEnabled attribute to NodeConfig to, used in the call from status-react (#866) 2018-04-26 18:28:42 +02:00
metrics Move status-go over to go-ethereum/log #717 (#727) 2018-03-20 19:35:28 +01:00
profiling Add profiling with pprof (#754) 2018-03-23 14:58:40 +01:00
services Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
sign Move signal logic into signal package 2018-05-03 09:35:58 +02:00
signal Move signal logic into signal package 2018-05-03 09:35:58 +02:00
static Update bindata 2018-04-09 15:42:36 +02:00
t Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
timesource Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
vendor Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
.codeclimate.yml #759 Codeclimate config (#843) 2018-04-23 15:55:21 +02:00
.dockerignore Ignore *.test files from all folders (#635) 2018-02-08 14:23:08 +02:00
.gitignore Add config required to debug statusd on VS Code 2018-05-01 14:15:43 +02:00
.gometalinter.json Disable unparam linter 2018-02-19 11:40:08 +01:00
.travis.yml Increase timeout for Rinkeby sync on Travis CI. 2018-05-03 13:16:56 +02:00
CONTRIBUTING.md Move CONTRIBUTING.md to top level (#798) 2018-04-04 12:51:05 +02:00
Gopkg.lock Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
Gopkg.toml Make whisper tolerant to local time skews (#864) 2018-05-04 11:23:38 +03:00
LICENSE.md Create LICENSE.md 2016-09-21 10:00:29 +08:00
Makefile Expose status specific methods (login/signup/joinpublicchannel) through the RPC api (#877) 2018-05-03 12:36:56 +02:00
README.md Add config required to debug statusd on VS Code 2018-05-01 14:15:43 +02:00

README.md

Status bindings for go-ethereum

TravisCI Builds GoDoc Master Build Status Develop Build Status

Docs

Intro

status-go is an underlying part of Status - a browser, messenger, and gateway to a decentralized world.

It's written in Go and requires Go 1.8 or above.

It uses Makefile to do most common actions. See make help output for available commands.

status-go uses go-ethereum with some patches applied in it, located under vendor/ directory. See geth patches README for more info.

Build

There are two main modes status-go can be built:

  • standalone server
  • library to link for Android or iOS

Use following Makefile commands:

  • make statusgo (builds binary into build/bin/statusd)
  • make statusgo-android (builds .aar file build/android-16/aar)
  • make statusgo-ios and make statusgo-ios-simulator (builds iOS related artifacts in build/os-9.3/framework)

In order to build and use status-go directly from status-react, follow the instructions in https://wiki.status.im/Building_Status, under the 'Building Status with the checked-out version of status-go' section.

Debugging

In order to see the log files while debugging on an Android device, do the following:

  • Ensure that the app can write to disk by granting it file permissions. For that, you can for instance set your avatar from a file on disk.
  • Connect a USB cable to your phone and make sure you can use adb.

Run

adb shell tail -f sdcard/Download/geth.log

IDE Debugging

If you're using Visual Studio Code, you can rename the .vscode/launch.example.json file to launch.json so that you can run the app with the debugger attached.

Testing

To setup accounts passphrase you need to setup an environment variable: export ACCOUNT_PASSWORD="secret_pass_phrase".

Make sure the dependencies are installed first by running:

make lint-install
make mock-install

To test fully statusgo, use:

make ci

To test statusgo using a given network by name, use:

make ci networkid=rinkeby

To test statusgo using a given network by number ID, use:

make ci networkid=3

If you have problems running tests on public network we suggest reading e2e guide.

If you want to launch specific test, for instance RPCSendTransactions, use the following command:

go test -v ./geth/api/ -testify.m ^RPCSendTransaction$

Note -testify.m as testify/suite is used to group individual tests.

Licence

Mozilla Public License 2.0