celestiaorg / go-cnc

celestia-node REST client in Go.
Apache License 2.0
15 stars 8 forks source link

Add sample usage of libarary to README.md #10

Open tzdybal opened 2 years ago

tzdybal commented 2 years ago

Simple, runnable example showing how to create and use Client should be added into README.md.

nikbhintade commented 2 years ago

I can create an example for Client.

nikbhintade commented 2 years ago

Hey @tzdybal, I was just trying to run the example which uses CNC but I got an error saying:

"transport: Error while dialing dial tcp: address http://rpc-1.celestia.nodes.guru:9090: too many colons in address"

I know this is not the CNC error but I am not sure where this error is occuring. more details about this are here: https://gist.github.com/nikbhintade/7b30df06d07077addaffe020aa7fb354

tzdybal commented 2 years ago

celestia-node instance you're connecting to is configured incorrectly. --core.grpc rpc-1.celestia.nodes.guru:9090 is the right option (without the http:// part).

See also: https://github.com/celestiaorg/celestia-node/issues/766 This is already fixed on main in celestia-node, so updating node to latest version should also resolve the issue.

nikbhintade commented 2 years ago

Got it thanks for the help.

nikbhintade commented 2 years ago

@tzdybal shouldn't docs be changed correct to config? https://docs.celestia.org/developers/node-tutorial#connect-to-a-public-core-endpoint

should I create PR for that?

tzdybal commented 2 years ago

@YazzyYaz what do you thing? Should we update docs, or encourage developers to use latest (main branch) celestia-node, which supports http:// prefix?

@Wondertan maybe you can draft v0.3.0-rc2 from current main, or soon?

nikbhintade commented 2 years ago

I also encountered one more problem (I tried asking it on discord but didn't get enough details to solve it). Thrown error is error: RPC error: code = Unknown desc = invalid Bech32 prefix; expected cosmos, got celestia

I am not running two nodes on the same machine or nodes for cosmos on the same machine. The machine is solely dedicated to Celestia light node.

YazzyYaz commented 2 years ago

@tzdybal @nikbhintade docs have been updated to reflect the new changes of http:// fixes added by celestia-node but I see the installation page is using v0.3.0-rc1: https://docs.celestia.org/developers/celestia-node

Ideally there's a new release by celestia-node that has the changes already on the main branch.

tzdybal commented 2 years ago

error: RPC error: code = Unknown desc = invalid Bech32 prefix; expected cosmos, got celestia

I am not running two nodes on the same machine or nodes for cosmos on the same machine. The machine is solely dedicated to Celestia light node.

It seems like key (celestia-node key, used for signing), was copied or generated improperly. Can you double check that your keys are generated as described in docs?

nikbhintade commented 2 years ago

Yep. I shut down the previous node started a new one.

tzdybal commented 2 years ago

@nikbhintade this is a great catch! The issue is on the rpc-1.celestia.nodes.guru side. I tried to use this node with my light node, and error is reproduced. After switching back to my own celestia-app instance, I'm able to submit blocks again.

CC: @YazzyYaz

nikbhintade commented 2 years ago

Also, one of the endpoints you sent grpc-1.celestia.nodes.guru:10790 works too.

tzdybal commented 2 years ago

Ref: https://github.com/celestiaorg/docs/pull/144/files

YazzyYaz commented 2 years ago

@nikbhintade @tzdybal it's been merged