Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vinhphuctadang
Copy link
Contributor

@vinhphuctadang vinhphuctadang commented Sep 11, 2023

Test create vaults and other subscribe/redeem too
image

@vinhphuctadang vinhphuctadang changed the title feat: offchain vault instantiate example feat: offchain vault instantiate/subscribe/redeem examples Sep 11, 2023
Copy link
Contributor

@nicolasbaum nicolasbaum left a 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?

@vinhphuctadang
Copy link
Contributor Author

yes, fully permissionless on testnet

Copy link
Collaborator

@aarmoa aarmoa left a 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")
Copy link
Collaborator

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

Comment on lines +57 to +62
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
Copy link
Collaborator

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.

Suggested change
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Comment on lines +56 to +62
clientCtx = clientCtx.WithNodeURI(network.TmEndpoint).WithClient(tmRPC)
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Suggested change
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"),
)

Comment on lines +47 to +48
// network := common.LoadNetwork("mainnet", "k8s")
network := common.LoadNetwork("testnet", "k8s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Comment on lines +57 to +62
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Suggested change
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
chainClient, err := chainclient.NewChainClient(
clientCtx,
network,
common.OptionGasPrices("500000000inj"),
)

Comment on lines +26 to +27
// network := common.LoadNetwork("mainnet", "k8s")
network := common.LoadNetwork("testnet", "k8s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Comment on lines +57 to +62
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Suggested change
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
chainClient, err := chainclient.NewChainClient(
clientCtx,
network,
common.OptionGasPrices("500000000inj"),
)

Comment on lines +47 to +48
// network := common.LoadNetwork("mainnet", "k8s")
network := common.LoadNetwork("testnet", "k8s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Comment on lines +82 to +87
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Suggested change
chainClient, err := chainclient.NewChainClient(
clientCtx,
network.ChainGrpcEndpoint,
common.OptionTLSCert(network.ChainTlsCert),
common.OptionGasPrices("500000000inj"),
)
chainClient, err := chainclient.NewChainClient(
clientCtx,
network,
common.OptionGasPrices("500000000inj"),
)

@vinhphuctadang vinhphuctadang changed the title feat: offchain vault instantiate/subscribe/redeem examples [dont merge] feat: offchain vault instantiate/subscribe/redeem examples Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants