-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: gRPC server #8
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e73d7a1
go gRPC + connection
Reecepbcups 07caec6
gRPC: rust client example w/ tonic
Reecepbcups 36e533e
Revert "gRPC: rust client example w/ tonic"
Reecepbcups 7ddf4a2
chore: cleanup (mark's req. changes)
Reecepbcups 93d77a4
feat: GRPC config & GetValidators endpoint
Reecepbcups c148faf
migrate: txbuf to `internal/txmanager`
Reecepbcups ba6fea0
grpc: QueryAccountBalance
Reecepbcups 8876f05
feat: working gRPC Transaction endpoints
Reecepbcups 7d4206f
chore: minor nits
Reecepbcups d7d3fd7
nit: cleanups (comments, script, proto)
Reecepbcups 180ffd2
feat: `TxResultResponse` direct values
Reecepbcups 39edef3
nit: last stale
Reecepbcups 9b42df7
fix: EOL at EOF
Reecepbcups 939d712
fix: add mis-deleted code snippet
Reecepbcups a01a380
revert: `internal/txmanager` from `gsi`
Reecepbcups b369490
chore: comments & GOBIN installer for grpcurl
Reecepbcups 22fed16
fix(macos); remove -w flag and pipe to tr newlines
Reecepbcups 34b6f52
refactor: log location, Start -> serve(), grpc err handle
Reecepbcups 4ccc16b
refactor: set validators at specific indexes
Reecepbcups 8953c7f
refactor: user facing gRPC error handling
Reecepbcups b934e2b
refactor: direct copy over SDK TxResult -> Gordian
Reecepbcups ce439ab
fix: remove BUG prefix for user facing issue
Reecepbcups 63816ab
fix: cover rest of wrapped errors
Reecepbcups 32a59be
fix: `g.grpcServer.Stop()`
Reecepbcups File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,42 @@ but sometimes a local patch makes more sense. | |
Begin running the updated siampp commands from the `gcosmos` directory. | ||
|
||
```bash | ||
go run . init moniker | ||
echo -n "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" > $HOME/.simappv2/mnemonic.txt | ||
rm -rf ~/.simappv2/ | ||
go build -o gcosmos . | ||
|
||
go run . keys add val --recover --source $HOME/.simappv2/mnemonic.txt | ||
./gcosmos init moniker | ||
|
||
go run . genesis add-genesis-account val 1000000stake --keyring-backend=test | ||
go run . genesis gentx val 1000000stake --keyring-backend=test --chain-id=gcosmos | ||
go run . genesis collect-gentxs | ||
# example-mnemonic address: cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl | ||
echo -n "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" > example-mnemonic.txt | ||
|
||
go run . start | ||
./gcosmos keys add val --recover --source example-mnemonic.txt | ||
./gcosmos genesis add-genesis-account val 10000000stake --keyring-backend=test | ||
./gcosmos genesis gentx val 1000000stake --keyring-backend=test --chain-id=gcosmos | ||
./gcosmos genesis collect-gentxs | ||
|
||
# rm -rf ~/.simappv2/data/application.db/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Help the reader out -- why is this commented code here? Would they want to run it? If so, when? Same on the next section at L60. |
||
./gcosmos start --g-http-addr 127.0.0.1:26657 --g-grpc-addr 127.0.0.1:9092 | ||
``` | ||
|
||
# Interact | ||
```bash | ||
# GOBIN="$PWD" go install github.com/fullstorydev/grpcurl/cmd/grpcurl@v1 | ||
|
||
./grpcurl -plaintext localhost:9092 list | ||
./grpcurl -plaintext localhost:9092 server.GordianGRPC/GetBlocksWatermark | ||
./grpcurl -plaintext localhost:9092 server.GordianGRPC/GetValidators | ||
|
||
./grpcurl -plaintext -d '{"address":"cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl","denom":"stake"}' localhost:9092 server.GordianGRPC/QueryAccountBalance | ||
``` | ||
|
||
# Transaction Testing | ||
```bash | ||
./gcosmos tx bank send val cosmos10r39fueph9fq7a6lgswu4zdsg8t3gxlqvvvyvn 1stake --chain-id=TODO:TEMPORARY_CHAIN_ID --generate-only > example-tx.json | ||
|
||
# TODO: get account number | ||
./gcosmos tx sign ./example-tx.json --offline --from=val --sequence=1 --account-number=1 --chain-id=TODO:TEMPORARY_CHAIN_ID --keyring-backend=test > example-tx-signed.json | ||
|
||
./grpcurl -plaintext -emit-defaults -d '{"tx":"'$(cat example-tx-signed.json | base64 | tr -d '\n')'"}' localhost:9092 server.GordianGRPC/SimulateTransaction | ||
|
||
./grpcurl -plaintext -emit-defaults -d '{"tx":"'$(cat example-tx-signed.json | base64 | tr -d '\n')'"}' localhost:9092 server.GordianGRPC/SubmitTransaction | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a comment noting what this is and why it's ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added context b369490