Comments (2)
Hey @taramakage
If you got result with cli you should get with gRPC also because cli using same gRPC method for querying Denom
https://github.com/OmniFlix/onft/blob/onft-gon/client/cli/query.go#L218
https://github.com/OmniFlix/onft/blob/onft-gon/keeper/grpc_query.go#L146
Here I've updated above code snippet & it's working
package main
import (
"context"
"fmt"
nfttypes "github.com/OmniFlix/onft/types"
"google.golang.org/grpc"
)
type Omniflix struct {
conn *grpc.ClientConn
nftClient nfttypes.QueryClient
}
func NewOmniflix() *Omniflix {
conn, err := grpc.Dial(
"grpc.gon-flixnet.omniflix.io:9090",
grpc.WithInsecure(),
grpc.WithDefaultCallOptions(),
)
if err != nil {
panic(err)
}
return &Omniflix{
conn: conn,
nftClient: nfttypes.NewQueryClient(conn),
}
}
// Basiclly this method dosen't work as expection.
func (o *Omniflix) GetClass(classID string) (*nfttypes.Denom, error) {
req := &nfttypes.QueryDenomRequest{
DenomId: classID,
}
// Here i get the error: rpc error: code = Unimplemented desc = unknown service OmniFlix.onft.v1beta1.Query
res, err := o.nftClient.Denom(context.Background(), req)
if err != nil {
return nil, err
}
// res, ok := resi.(*nfttypes.QueryDenomResponse)
// if !ok {
// return nil, err
//}
return &nfttypes.Denom{
Id: res.Denom.Id,
Name: res.Denom.Name,
Schema: res.Denom.Schema,
Creator: res.Denom.Creator,
Uri: res.Denom.Uri,
UriHash: res.Denom.UriHash,
Data: res.Denom.Data,
}, nil
}
func main() {
omniflix := NewOmniflix()
class, err := omniflix.GetClass("ibc/B9C0497B80973FB67A3000836186317DA046574DEE98D938848C8620AEFE99DA")
if err != nil {
panic(err)
}
fmt.Println(class)
}
from omniflixhub.
Hey @harish551, thank you very much. I just compared two snippets and found that I accidentally used the Iris gRPC address. My God...
from omniflixhub.
Related Issues (20)
- add async-icq ibc app
- add ibc-fees application
- add nft-transfer module for interchain nft transfers
- Reporting a security issue HOT 3
- royalty splits config
- update marketplace sales royalty distribution
- fix update denom tx with <nil> royalty splits
- purgeDenom message to delete denoms without nfts HOT 1
- unable to create channel for cosmwasm contract HOT 1
- add ibc-hooks
- SECURITY ERROR HOT 1
- itc campaign claim gas issue
- add ibc packet forward middleware
- remove params module and migrate native modules away from x/params
- remove params module from x/alloc
- remove params module from x/marketplace
- remove params module from x/itc
- add globalfee module
- groups module
- add token-factory module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omniflixhub.