* Add rate limit to metrics
* Compliance with harmony's metrics specifications
* Improve rate limit metrics info
* minor: remove the redundancy of rpc metrics name
Signed-off-by: Leo Chen <leo@harmony.one>
* [rpc] set default rate limit to 1000
Signed-off-by: Leo Chen <leo@harmony.one>
* [rpc] fix test errors
Signed-off-by: Leo Chen <leo@harmony.one>
* [metrics] init rpc rate limiter
Signed-off-by: Leo Chen <leo@harmony.one>
Co-authored-by: Leo Chen <leo@harmony.one>
* [cmd] added --sync as the switch of stream sync protocol
* [cmd] minor formatting fix and optimization
* [cmd] add sanity fixes for compatible for last v2.0.0 config files
- Changed update config prompt to default to No
- Moved RosettaPort == 0 check to migration 1.0.4
- Refractored migrateConf to use separate func for the migration logic
- DNS port is substracted 3000 only if it is not eqal current
default(6000)
- Setting default value to ServerPort if field is missing from migrated conf
Fixes regarding config V2.0.0
The following fixes and improvements have been applied
- Added timeout to config update prompt. Prompt logic has been moved to
a separate func
- When updating config file, the original is saved to <config>.backup
- Added semantic version validation for the version found in config. Error is
returned if version is missing, not a valid sematic version or not
found in the migrations map
- Flags related to DNSSync has been moved to dnsSyncFlags flag array.
Also moved tests related to DNSSync flags to separate test func
- Added dns.server and dns.client flags and tests for them
- Added migration tests with dumps of versions 1.0.2, 1.0.3, 1.0.4
Inital commit
Removed lint warning
Fixed names, that have changed in dnsSync
Fixed some lint errors
Some functions were exported although no need to be and some test
variables were also renamed
Fixed 1.0.4 migration
- Tests in config_test.go expected wrong version since it was migrated to
2.0.0
- getDefaultHmyConfigCopy did not get DNSSync defaults
- Key for DNSPort for version prior to 1.0.4 was wrong - DNSSyncPort
Added default for DNSSync when creating default Config
Fixed empty string user input crash
Inputing empty string was causing out of bounds index to be read from
readStr
Fixed flags_test to work with config version 2.0.0
Changed DNSSync fields names
It seems that Enabled was not a good name, considering that actually did
the opposite. Also kept LegacyClient and LegacyServer names
Removed Legacy prefix from dnsSync fields
It seems Legacy prefix is obsolite since moving the fields to dsnSync
Fixes regarding config V2.0.0
The following fixes and improvements have been applied
- Added timeout to config update prompt. Prompt logic has been moved to
a separate func
- When updating config file, the original is saved to <config>.backup
- Added semantic version validation for the version found in config. Error is
returned if version is missing, not a valid sematic version or not
found in the migrations map
- Flags related to DNSSync has been moved to dnsSyncFlags flag array.
Also moved tests related to DNSSync flags to separate test func
- Added dns.server and dns.client flags and tests for them
- Added migration tests with dumps of versions 1.0.2, 1.0.3, 1.0.4
Fix for config_migrations_test
Added default value to serverPort during migration
1. Added some functionality to HostV2 for stream support.
2. Added new module discovery under p2p host to replace the networkInfo service.
3. Make dht datastore badger only active on bootstrap nodes. For normal nodes, badger is disabled by default. It can also be enabled by flags.
Co-authored-by: Rongjian Lan <rongjian.lan@gmail.com>
* add aggregateSig flag
* add flag to valid
* revert import change
* enable agg sig at epoch 233 for shard 3 in mainnet
* fix consensus nil
* revert agg sig epoch logic
* fix test
* [cmd] Add IsOffline flag
* Add IsOffline to node config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Disable syncing and p2p msgs if offline
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Clarify syncing status msg
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [internal/config] Add DefaultLocalListenIP & DefaultPublicListenIP
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add IP to p2p config
* Use default local listening ip for p2p hors if node is in offline
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [p2p] Use peer ip when creating listenAddr
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Fix unit tests & bump config version
* Fix TestAddPeer & TestConnectionToInvalidPeer p2p test
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Fix lint
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Address PR comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add server with example block & network services
* Update go.mod for rosetta SDK
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [internal/configs] Add RosettaServer to node config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add rosetta port flag
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Add rosetta server start & rename api.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Change server start to use nodeconfig of rosetta
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Cleanup debugging prints
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix stdout print & document placeholders
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix lint & make StartSevers more consistent
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Disable rosetta by default
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Make explorer deploy rosetta server
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Use direct http server for start
* Make go.mod changes minimal
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix fmt
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix fmt of go.mod
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Use port 9700 instead of 10000
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Bump config version
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add v1.0.0 config backwards compatibility test
* Included update message if old config is loaded
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Do not broadcast invalid tx on localnet
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Correct for invalid port when loading old config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Make rosetta variable names consistent
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>