The Status module that consumes go-ethereum
https://status.im
a2ff03c79e
Extends wallet module with the history package with the following components: BalanceDB (balance_db.go) - Keeps track of balance information (token count, block, block timestamp) for a token identity (chain, address, currency) - The cached data is stored in `balance_history` table. - Uniqueness constrained is enforced by the `balance_history_identify_entry` UNIQUE index. - Optimal DB fetching is ensured by the `balance_history_filter_entries` index Balance (balance.go) - Provides two stages: - Fetch of balance history using RPC calls (Balance.update function) - Retrieving of cached balance data from the DB it exists (Balance.get function) - Fetching and retrieving of data is done for specific time intervals defined by TimeInterval "enumeration" - Update process is done for a token identity by the Balance.Update function - The granularity of data points returned is defined by the constant increment step define in `timeIntervalToStride` for each time interval. - The `blocksStride` values have a common divisor to have cache hit between time intervals. Service (service.go) - Main APIs - StartBalanceHistory: Regularly updates balance history for all enabled networks, available accounts and provided tokens. - GetBalanceHistory: retrieves cached token count for a token identity (chain, address, currency) for multiple chains - UpdateVisibleTokens: will set the list of tokens to have historical balance fetched. This is a simplification to limit tokens to a small list that make sense Fetch balance history for ECR20 tokens - Add token.Manager.GetTokenBalanceAt to fetch balance of a specific block number of ECR20. - Add tokenChainClientSource concrete implementation of DataSource to fetch balance of ECR20 tokens. - Chose the correct DataSource implementation based on the token "is native" property. Tests Tests are implemented using a mock of `DataSource` interface used to intercept the RPC calls. Notes: - the timestamp used for retrieving block balance is constant Closes status-desktop: #8175, #8226, #8862 |
||
---|---|---|
.dependabot | ||
.github | ||
.vscode | ||
_assets | ||
_docs | ||
_examples | ||
abi-spec | ||
account | ||
api | ||
appdatabase | ||
appmetrics | ||
build/bin | ||
cmd | ||
common | ||
config | ||
connection | ||
contracts | ||
db | ||
discovery | ||
eth-node | ||
exportlogs | ||
extkeys | ||
images | ||
ipfs | ||
logutils | ||
mailserver | ||
metrics | ||
mobile | ||
multiaccounts | ||
node | ||
nodecfg | ||
notifier | ||
params | ||
peers | ||
postgres | ||
profiling | ||
protocol | ||
rpc | ||
rtt | ||
server | ||
services | ||
signal | ||
sqlite | ||
static | ||
t | ||
telemetry | ||
timesource | ||
transactions | ||
vendor | ||
waku | ||
wakuv2 | ||
.codeclimate.yml | ||
.dockerignore | ||
.gitignore | ||
.golangci.yml | ||
.travis.yml | ||
BOOTNODE.md | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
LICENSE.md | ||
MAILSERVER.md | ||
Makefile | ||
README.md | ||
RELEASING.md | ||
VERSION | ||
WAKU.md | ||
go.mod | ||
go.sum | ||
nix.conf | ||
shell.nix |
README.md
Status bindings for go-ethereum
Docs
- How to Build
- How to Contribute
- How to Release
- How to run a Bootnode
- How to run a Mailserver
- How to run a Waku node
- How to configure status-go