-
Notifications
You must be signed in to change notification settings - Fork 563
feat(module): bandchain oracle support #1343
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
Conversation
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.
Haven't tested anything since it's still in progress, just had a look and this is pretty good so far 👍
starport/templates/module/create/oracle/proto/{{moduleName}}/oracle.proto.plush
Outdated
Show resolved
Hide resolved
8000
starport/templates/module/create/oracle/x/{{moduleName}}/client/cli/tx_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/client/cli/tx_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/oracle.go.plush
Outdated
Show resolved
Hide resolved
a5637a4
to
ac881b8
Compare
@fadeev still not working: How to test:
$ starport relayer configure -a \
--source-rpc "http://rpc-laozi-testnet2.bandchain.org:26657" \
--source-faucet "https://laozi-testnet2.bandchain.org/faucet/request" \
--source-port "oracle" \
--source-gasprice "0uband" \
--source-prefix "band" \
--source-version "bandchain-1" \
--target-rpc "http://localhost:26657" \
--target-faucet "http://localhost:4500" \
--target-port "consuming" \
--target-gasprice "0.0stake" \
--target-prefix "cosmos" \
--target-version "bandchain-1"
$ starport relayer connect
$ bandchaind tx consuming oracle-data 37 4 3 --channel channel-0 --symbols "BTC,ETH,XRP,BCH" --multiplier 1000000 --fee-limit 30uband --request-key "random_string" --prepare-gas 200000 --execute-gas 200000 --from alice --chain-id bandchain I'm using this consumer app: |
Have we tried doing this? |
@fadeev, is this should be done into the TS relayer? |
95e0948
to
7f7aa86
Compare
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.
I'm still testing the feature but from the code I thing we are on a good track👍
A general feedback is that we should document all generated methods for the user, even the internal ones that begin with a lower case
Also, didn't you mentioned you wanted to go with a model where we don't have a --oracle
flag but you scaffold a module with ibc
and then you have a command to scaffold queries into this module?
starport/templates/module/create/oracle/x/{{moduleName}}/client/cli/query_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/client/cli/query_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/client/cli/query_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/client/cli/tx_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/keeper/grpc_query_oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/oracle.go.plush
Outdated
Show resolved
Hide resolved
starport/templates/module/create/oracle/x/{{moduleName}}/oracle.go.plush
Outdated
Show resolved
Hide resolved
30f2f97
to
13e77ed
Compare
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.
👍
Looks very good! Still doing some tests
Let's replace the command in the docs with:
So that it works out of the box with most terminals (including mine 🙂). And rename |
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.
Looks great! 🙌
There is one issue when you want to scaffold different queries. Since the dispatch of the result is based on the format of the result response, if you scaffold a second query and you don't change the data format and the script ID, then results for the 1st scaffolded are always stored in the list of results for the second scaffolded query
If I run later:
I will get the result for the 2nd one:
This makes sense if I look at
The last scaffolded query result is parsed first |
However it may be the case that for the response from the oracle, there is no way to differentiate two different queries outside the format of the response. The issue would be only solved if the developer manually change the format of the queries. Maybe it would be better to only allow for a single query for this first version? In the future we could maybe think about a command where you provide the kind of data format you want and you can only scaffold one query with this format:
|
Well it seems many script use this |
It should be fixed now. We are using the client id to parse the message types |
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.
This looks legit to me
Awesome work @Pantani 👍
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.
Woohoo! 🦸
closes #1344
closes #1334
What does this MR does?
Add possibility to request data from the Bandchain oracle.
Changes
band
CLI command;How to test?
$ starport s chain github.com/tendermint/bandchain $ cd bandchain $ starport module create consuming --ibc $ starport s band bandoracle --module consuming