-
Notifications
You must be signed in to change notification settings - Fork 36
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
[dont merge] feat: offchain vault instantiate/subscribe/redeem examples #154
base: master
Are you sure you want to change the base?
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.
There's no approval outside of the code needed to instantiate this vault in testnet right?
yes, fully permissionless on testnet |
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 have added some comments in the examples.
Besides the comments, I think we should be pointing this PR to the dev
branch, since we are going to release soon a new version compatible with chain 1.12. Merging this into master
would force us to sync again master
into dev
|
||
func main() { | ||
// network := common.LoadNetwork("mainnet", "k8s") | ||
network := common.LoadNetwork("testnet", "k8s") |
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.
k8s should no longer be used
chainClient, err := chainclient.NewChainClient( | ||
clientCtx, | ||
network.ChainGrpcEndpoint, | ||
common.OptionTLSCert(network.ChainTlsCert), | ||
common.OptionGasPrices("500000000inj"), | ||
) |
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.
NewChainClient
now should receive the network instance instead of only the endpoint. And the certs are taken from the network directly inside the ChainClient.
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network.ChainGrpcEndpoint, | |
common.OptionTLSCert(network.ChainTlsCert), | |
common.OptionGasPrices("500000000inj"), | |
) | |
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network, | |
common.OptionGasPrices("500000000inj"), | |
) |
|
||
func main() { | ||
// network := common.LoadNetwork("mainnet", "k8s") | ||
network := common.LoadNetwork("testnet", "k8s") |
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.
Same comment here
clientCtx = clientCtx.WithNodeURI(network.TmEndpoint).WithClient(tmRPC) | ||
chainClient, err := chainclient.NewChainClient( | ||
clientCtx, | ||
network.ChainGrpcEndpoint, | ||
common.OptionTLSCert(network.ChainTlsCert), | ||
common.OptionGasPrices("500000000inj"), | ||
) |
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.
Same comment here
clientCtx = clientCtx.WithNodeURI(network.TmEndpoint).WithClient(tmRPC) | |
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network.ChainGrpcEndpoint, | |
common.OptionTLSCert(network.ChainTlsCert), | |
common.OptionGasPrices("500000000inj"), | |
) | |
clientCtx = clientCtx.WithNodeURI(network.TmEndpoint).WithClient(tmRPC) | |
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network, | |
common.OptionGasPrices("500000000inj"), | |
) |
// network := common.LoadNetwork("mainnet", "k8s") | ||
network := common.LoadNetwork("testnet", "k8s") |
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.
Same comment here
chainClient, err := chainclient.NewChainClient( | ||
clientCtx, | ||
network.ChainGrpcEndpoint, | ||
common.OptionTLSCert(network.ChainTlsCert), | ||
common.OptionGasPrices("500000000inj"), | ||
) |
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.
Same comment here
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network.ChainGrpcEndpoint, | |
common.OptionTLSCert(network.ChainTlsCert), | |
common.OptionGasPrices("500000000inj"), | |
) | |
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network, | |
common.OptionGasPrices("500000000inj"), | |
) |
// network := common.LoadNetwork("mainnet", "k8s") | ||
network := common.LoadNetwork("testnet", "k8s") |
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.
Same comment here
chainClient, err := chainclient.NewChainClient( | ||
clientCtx, | ||
network.ChainGrpcEndpoint, | ||
common.OptionTLSCert(network.ChainTlsCert), | ||
common.OptionGasPrices("500000000inj"), | ||
) |
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.
Same comment here
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network.ChainGrpcEndpoint, | |
common.OptionTLSCert(network.ChainTlsCert), | |
common.OptionGasPrices("500000000inj"), | |
) | |
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network, | |
common.OptionGasPrices("500000000inj"), | |
) |
// network := common.LoadNetwork("mainnet", "k8s") | ||
network := common.LoadNetwork("testnet", "k8s") |
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.
Same comment here
chainClient, err := chainclient.NewChainClient( | ||
clientCtx, | ||
network.ChainGrpcEndpoint, | ||
common.OptionTLSCert(network.ChainTlsCert), | ||
common.OptionGasPrices("500000000inj"), | ||
) |
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.
Same comment here
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network.ChainGrpcEndpoint, | |
common.OptionTLSCert(network.ChainTlsCert), | |
common.OptionGasPrices("500000000inj"), | |
) | |
chainClient, err := chainclient.NewChainClient( | |
clientCtx, | |
network, | |
common.OptionGasPrices("500000000inj"), | |
) |
Test create vaults and other subscribe/redeem too