Commit Graph

99 Commits

Author SHA1 Message Date
Jorge Hernandez 5ad3a36a28
check error returned from NewNode (#11624) 2022-04-13 10:17:38 +02:00
mergify[bot] 344fd73b0b
feat: grpc-only mode (backport #11430) (#11460) 2022-03-26 21:04:52 -04:00
mergify[bot] febcb92193
refactor: prune everything (backport #11177) (#11258)
* refactor: prune everything (#11177)

(cherry picked from commit 75bcf47f13)

# Conflicts:
#	CHANGELOG.md
#	server/config/toml.go
#	server/start.go
#	store/rootmulti/store.go
#	store/types/pruning.go
#	store/v2/multi/store_test.go

* updates

* updates

* updates

* updates

* updates

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
2022-02-23 23:22:10 +01:00
Ryan Christoffersen b372f4cae1
fix: minimum-gas-price warning (#10071) 2021-09-07 08:12:24 -07:00
mergify[bot] 0ab5726a7a
fix: start GRPCWebServer in goroutine (backport #9704) (#9719)
* fix: start GRPCWebServer in goroutine (#9704)

so it don't block other code from executing.

Closes #9703

<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

(cherry picked from commit d5674a5d3e)

# Conflicts:
#	CHANGELOG.md

* fix changelog

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2021-07-19 11:02:23 +02:00
Amaury 3a28c343dd
fix: Don't error on startup if min-gas-price is empty (#9621)
* fix: Don't error on startup if min-gas-price is empty

* remove test

* Update server/start.go

* Update server/start.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Switch to error

Co-authored-by: Aaron Craelius <aaron@regen.network>
2021-07-02 17:35:31 +02:00
Andrei Ivasko 3fd376bd56
feat: Non-zero Default Fees (#9371)
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰
v    Before smashing the submit button please review the checkboxes.
v    If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review.
-->

closes: #9106

---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md).
- [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`)
- [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code).
- [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [ ] Re-reviewed `Files changed` in the Github PR explorer
- [ ] Review `Codecov Report` in the comment section below once CI passes
2021-06-25 10:41:32 +00:00
Robert Zaremba 7bca49e2d2
refactor(client): add client/Context.Codec and deprecate JSONCodec (#9498)
* chore(types): add sdk.Context.Codec and deprecate JSONCodec

* Use clientContext.Codec rather than JSONCodec everywhere

* update tests to use clientContext.Codec

* added a note that EncodingConfig.Marshaler will be renamed to Codec

* update changelog

* fix tests to use clientCtx.WithCodec instead of WithJSONCodec

* fix genutil build

* Update simapp/params/encoding.go

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-06-11 11:49:39 +00:00
Andrea Giacobino 25ecec6c15
rosetta: upgrade to newest version (#9314)
* feat:  update rosetta sdk to v0.6.10 

embed from v1.0.0 release branch of the library: https://github.com/tendermint/cosmos-rosetta-gateway/tree/release/v1.0.0

closes:
https://github.com/cosmos/cosmos-sdk/issues/9300

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2021-05-15 00:18:59 +02:00
Amaury d19791be89
Rename clientCtx.JSONMarshaler to JSONCodec (#9251)
* Rename clientCtx.JSONMarshaler to JSONCodec

* change md files

* Fix lint
2021-05-03 14:45:47 +00:00
Amaury e306e5b6f5
Make gRPC requests go through tendermint Query (#8549)
* Make gRPC requests go through tendermint Query

* Remove commented code

* Dry run in InitChain?

* Save type of first run

* Add metadata in repsonse

* Factorize some code

* Fix lint

* Update comments

* Fix md test

* Fix test expected

* Don't put RunGRPCQuery as clientCtx method

* Update baseapp/grpcserver.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Address review comments

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2021-02-15 10:01:44 +00:00
Frojdi Dymylja 5ed11519e0
[appd] fix: gRPC web address default flag value (#8399)
* fix: flags grpc web default address

* chore: update CHANGELOG.md

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2021-01-22 04:12:22 +00:00
SaReN 57f5e96570
Rosetta API implementation (#7695)
Ref: #7492

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Frojdi Dymylja <33157909+fdymylja@users.noreply.github.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-01-21 09:33:02 +00:00
MD Aleem b771effc6c
gRPC-web proxy (#8077)
* init

* WIP config

* WIP add proxy server

* fmt

* WIP

* setup proxy server

* clean go.mod

* lint

* lint

* lint

* custom codec

* lint

* add comments

* change grpc-proxy port

* add grpc-web

* update server/start.go

* add tests

* add test with client

* Update server/start.go

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update server/start.go

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* Update server/start.go

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* review changes

* review changes

* Update server/start.go

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-18 18:25:22 +00:00
Robert Zaremba a3ae6e3704
Combine client.ReadTxCommandFlags with GetClientContextFromCmd (#8155)
* Update codebase to simplify clientCtx loading from cmd

* make ReadTxCommandFlags and ReadQueryCommandFlags private

* fix build error

* fix conflicts
2020-12-14 22:09:51 +00:00
Jonathan Gimeno c0f3039fc3
make it exit gracefully. (#8101)
* make it exit gracefully.

* add kig message

* git update error code

* exit with error code

* exit with 0

* Update server/start.go

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-12-10 11:37:57 +00:00
Aleksandr Bezobchuk 5291a8ff31
Refactor Logging using Zerolog (#8072)
* init commit

* server: use flags

* server: godoc++

* updates

* baseapp: update logging

* logging updates

* x/bank: update logging

* logging updates

* lint++

* logging updates

* logging updates

* logging updates

* logging updates

* cl++
2020-12-03 23:17:21 +00:00
MD Aleem c58a8923a0
gRPC-gateway routes as alternative to legacy tendermint REST endpoints (#7965)
* WIP

* WIP setup

* WIP setup testsuite

* add node_info

* add GetLatestBlock,GetBlockByHeight grpc endpoints

* add GetValidatorSetByHeight, GetLatestValidatorSet

* fix lint

* fix tests

* proto format

* Update Makefile

* review changes

* Makefile format

* handle nil pagination

* rename query.go to service.go

* format Makefile

* format Makefile

* review changes

* review changes

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-25 15:58:11 +00:00
Amaury Martiny 15b285dd0d
Fix creation of local RPC node in clientCtx (#7840)
* server: only register the Tx service if the API or gRPC are enabled

Only registers the Tx service on an app, if either API or gRPC are enabled.
This is because, enabling the service starts a local Tendermint node, which
is unnecessary and expensive, if neither of those operations are explicitly
enabled.

* Fix lint

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-11-10 13:01:55 +00:00
Robert Zaremba c201963e41
Update x/banking and x/crisis InitChain re slow Gaia startup (#7764)
* add more logs during the initialization process

* initializtion: move profiling to the top of the startProcess function

* x/bank InitGenesis: remove k.ValidateBalance

* debug: add logs and telemetry to x/bank and x/crisis

* make x/crisis AssertInvariants optional during InitGenesis

* Add module init flags mechanism

* update changelog

* remove debug fmt.Print

* fix testutil/network/

* fix log message

* update test NewApp calls

* review changes

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-11-02 19:10:14 +00:00
Amaury Martiny 1961935fc7
Add GetTx gRPC endpoint (#7688)
* Add empty TxByHash

* Fix search & replace

* Renname to GetTx

* Make getTx grpc work

* Hash as string

* Add todo comment

* /tx

* Make tests pass

* Put into function

* Add changelog

* Fix lint

* RegisterTxService in server

* Remove comment

* Update proto/cosmos/tx/v1beta1/service.proto

Co-authored-by: Cory <cjlevinson@gmail.com>

* Create new protoCdc

* Move tx service to x/auth

* Small tweaks

* Link gh issue

* Fix lint

* Update x/auth/tx/service.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

Co-authored-by: Cory <cjlevinson@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
2020-10-30 12:32:02 +00:00
yihuang f260ca4319
shutdown gracefully without os.Exit (#7480)
* shutdown gracefully without os.Exit

* Update server/util.go

Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-10-14 15:13:48 +00:00
Anil Kumar Kammari ca7b31dd5d
Register swagger API (#7246)
* init

* Fix statik gen

* Fix swagger

* Change swagger url

* Fix swagger serve

* remove ibc swagger from legacy docs

* Add old routes config

* Move swagger api to app.go

* add godoc

* Fix inputs

* Fix swagger dir

* Fix statik

* refactor

* fmt

* fix doc

* Fix swagger config check
2020-09-19 00:34:56 +00:00
Alexander Bezobchuk 7ae84898de
Merge PR #7265: Tendermint Block Pruning 2020-09-14 10:12:49 -04:00
Erik Grinaker 4faeefebd2
Add state sync support (#7166)
* Add state sync support

* fix incorrect test tempdir

* proto: move and update Protobuf schemas

* proto: lint fixes

* comment tweaks

* don't use type aliasing

* don't call .Error() when logging errors

* use create terminology instead of take for snapshots

* reuse chunk hasher

* simplify key encoding code

* track chunk index in Manager

* add restoreDone message for Manager

* add a ready channel to Snapshotter.Restore()

* add comment on streaming IO API

* use sdkerrors for error handling

* fix incorrect error

* tweak changelog

* syntax fix

* update test code after merge
2020-09-08 09:05:44 +00:00
Alexander Bezobchuk 4de5e28a3b
Merge PR #7191: Fix Legacy API Server Client Context 2020-08-28 13:25:10 -04:00
Marie 7f59723d88
Make JSONMarshaler methods require proto.Message (#7054)
* Make JSONMarshaler require proto.Message

* Use &msg with MarshalJSON

* Use *LegacyAmino in queriers instead of JSONMarshaler

* Revert ABCIMessageLogs String() and coins tests

* Use LegacyAmino in client/debug and fix subspace tests

* Use LegacyAmino in all legacy queriers and adapt simulation

* Make AminoCodec implement Marshaler and some godoc fixes

* Test fixes

* Remove unrelevant comment

* Use TxConfig.TxJSONEncoder

* Use encoding/json in genutil cli migrate/validate genesis cmds

* Address simulation related comments

* Use JSONMarshaler in cli tests

* Use proto.Message as respType in cli tests

* Use tmjson for tm GenesisDoc

* Update types/module/simulation.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update types/module/module_test.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Add godoc comments

* Remove unused InsertKeyJSON

* Fix tests

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-26 09:39:38 +00:00
atheeshp 78194e1cdd
gRPC gateway init (#7019)
* WIP: grpc server setup

* add register grpc routes

* updated go mod

* updated grpc for all modules

* added pb file for grpc gateway

* udpated gw file

* added a test for grpc route

* fixed conflicts

* added grpc server

* grpc tests added

* cleanup

* Fix gateway forward issue

* Add godoc

* updated tests

* fix lint

* fix tests

* fix tests

* fix tests

* fixed test

* Add grpc headers

* Fix error handling

* Fix tests - hacky

* Fix lint

* remove debug logs

* Fix review comments

* move grpc tests into a separate file

* Fix protobuf version

* Update x/capability/module.go

* Fix godoc

* Fix review suggestions

* Fix codec

* Add query params test for gateway request

* Fix gofmt

Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-25 15:44:13 +00:00
Alexander Bezobchuk f0d2c86f0b
Merge PR #7121: Support Event Indexing 2020-08-20 12:19:16 -04:00
Aaron Craelius 816c5a37bd
Enable proto JSON generally and remove HybridCodec (#6859)
* Remove HybridCodec

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* Test fixes

* Delete hybrid_codec.go

* Fixes

* Fixes

* Fixes

* Test fixes

* Test fixes

* Test fixes

* Lint

* Sim fixes

* Sim fixes

* Revert

* Remove vesting account JSON tests

* Update CHANGELOG.md

* Lint

* Sim fixes

* Sim fixes

* Docs

* Migrate more amino usages

* Remove custom VoteOption String() and json marshaling

* Fix tests

* Add comments, update CHANGELOG.md

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-13 13:20:02 +00:00
Amaury Martiny d2661a4692
Add flag & toml config for gRPC server (#6933)
* Enable gRPC by default

* Add grpc flags

* Consistent comments in toml

* Stop grpc in test network cleaup

* Expose ports on Docker

* Fix tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-08-05 15:45:22 +00:00
Aaron Craelius e9534b0935
Add gRPC server & reflection (#6463)
* Add gRPC proxy

* Make GRPC disabled by default

* WIP on integration tests

* WIP on integration tests

* Start setting up in process tests

* Start setting up in process tests

* Make it compile

* Add start server to network util

* Add Println

* Use go routine

* Fix scopelint

* Move to proxy_test

* Add response type cache

* Remove proxy

* Tweaks

* Use channel to handle error

* Use error chan

* Update server/start.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Use %w

* Add sdk.Context

* Add comments

* Fix lint

* Add header and tests

* Address comments

* Factorize some code

* Fix lint

* Add height and prove in req metadata

* Add reflection test

* Fix lint

* Put grpc test in server/grpc

* Update baseapp/grpcserver.go

* Update baseapp/grpcserver.go

* Remove proof header

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
2020-07-27 17:57:15 +00:00
Marko e6a56226a8
context: remove verifier & trust node (#6805)
* remove verifier

* more removal of trustnode flag

* add todo

* fix lint

* remove file

* remove viper and add link to issue

* remve mention of trustnode
2020-07-23 06:44:18 +00:00
David Ackerman 5d71020270
Merge PR #6810: Add transport flag to start command 2020-07-21 15:01:30 -04:00
Jonathan Gimeno 54141887b5
Add home default to other commands. (#6789)
* Add home default to other commands.

* add defaultNodeHome to rest of commands

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-20 15:12:33 +00:00
Alexander Bezobchuk 8670a10564
Merge PR #6595: Single Binary & Command Refactor 2020-07-07 11:40:46 -04:00
Alexander Bezobchuk 9ebda4edb9
Server/simd: Viper Removal (#6599)
* init commit

* remove viper from tm cmds

* updates

* Undo x/bank/client/cli/tx.go

* Fix unit tests

* lint++

* rename var

* Fix genutil test

* fix test

* prefer cmd.Flags() over direct viper usage

* update

* fix ABCI error tests

* fix integration tests

* Add viper to context

* fix build

* fix unit test

* Implement and use AppOptions

* Revert Redact godoc

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-07-05 16:56:17 +00:00
Alexander Bezobchuk 9bf3ff75f5
Merge PR #6489: Test Network Testing Framework 2020-06-26 12:30:49 -04:00
Alexander Bezobchuk 4716260a6e
Merge PR #6475: Pruning Refactor 2020-06-22 16:31:33 -04:00
Jonathan Gimeno 76ee9b29ac
Merge PR #6450: Some small improve on API server 2020-06-16 13:31:35 -04:00
Alexander Bezobchuk 8ee7d1f403
Merge PR #6399: SDK Telemetry 2020-06-16 11:11:02 -04:00
Alexander Bezobchuk 6a05b83069
Merge PR #6426: Migrate API Server 2020-06-15 13:39:09 -04:00
Marko 218ec99508
various linter fixes (#6106)
x/staking: Fix all linter warnings.

Fixed warnings across base packages.

New linters:
- unparam
- nolintlint

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-02 21:26:59 +02:00
Anton Kaliaev f0b72b93be
server: remove deprecated UpgradeOldPrivValFile (#6079)
* server: remove deprecated UpgradeOldPrivValFile

OldFilePV was deprecated in Tendermint Core v0.28 and will be removed in
upcoming v0.34.5 release.

* remove imports

* Add changelog entries

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-04-27 16:08:44 +00:00
Alessio Treglia aeee097b2f
spring cleanup (#5991)
* Make format

* Fix golangci-lint warnings

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-04-14 19:13:15 +00:00
Alessio Treglia e8cedf243f
fix all bits broken by viper API changes (#5982)
github.com/spf13/viper's recent releases introduced a semantic
change in some public API such as viper.IsSet(), which have
broken some of our flags checks. Instead of checking whether
users have changed a flag's default value we should rely on such
defaults and adjust runtime behaviour accordingly. In order to do
so, it's important that we pick sane defaults for all our flags.

The --pruning flag and configuration option now allow for a
fake custom strategy. When users elect custom, then the
pruning-{keep,snapshot}-every options are interpreted and
parsed; else they're ignored.
Zero is pruning-{keep,snapshot}-every default value. When
users choose to set a custom pruning strategy they are
signalling that they want more fine-grainted control, therefore
it's legitimate to expect them to know what they are doing and
enter valid values for both options.

Ref #5964
2020-04-14 17:24:27 +02:00
Jonathan Gimeno 60970baf20 update from PR comments 2020-02-28 10:53:56 +01:00
Jonathan Gimeno fa3572e300 update start cmd desc 2020-02-27 16:35:13 +01:00
Jonathan Gimeno 9aeefa77d3 update command doc 2020-02-27 16:05:10 +01:00
Jonathan Gimeno 93e3f33461 remove unused error 2020-02-27 16:02:29 +01:00