GithubHelp home page GithubHelp logo

Comments (4)

tomaka avatar tomaka commented on June 12, 2024 1

From the point of view of smoldot, the only JSON-RPC functions that it supports are:

Sorry for the bad experience, but I'm not in any way responsible for this shitshow and I'm closing as "not my problem"

from smoldot.

tomaka avatar tomaka commented on June 12, 2024

I have no idea what rpc.net.version is even supposed to be.
If PolkadotJS calls a function that isn't supported by smoldot, you'll see an error in the logs, and also an error will be returned to PolkadotJS indicating that it's not supported (making this a PolkadotJS no matter what).

from smoldot.

gluneau avatar gluneau commented on June 12, 2024

Thanks for looking into this Pierre, I've found the docs for net_version and it returns the protocol version and that is the same as eth_chainId

So I tried to use const rawNetworkPrefix = await api?.rpc.eth.chainId(); and got the same similar message TypeError: api.rpc.eth.chainId is not a function while using the light rpc service. (Works fine under wss rpc)

curl --request POST \
     --url https://shiden-rpc.dwellir.com \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
     "id": 1,
     "jsonrpc": "2.0",
     "method": "net_version"
}
'
{"jsonrpc":"2.0","result":"336","id":1}

curl --request POST \
     --url https://shiden-rpc.dwellir.com \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
     "id": 1,
     "jsonrpc": "2.0",
     "method": "eth_chainId"
}
'
{"jsonrpc":"2.0","result":"0x150","id":1}

Both provided the same answer. (0x150 === 336) under wss rpc, and both broke under light rpc

So is it smoldot? or substrate_connect that is not translating the requests?
Can I curl my local substrate_connect?

from smoldot.

tomaka avatar tomaka commented on June 12, 2024

I don't know how https://shiden-rpc.dwellir.com is working, but if I send the request to rpc.polkadot.io I get an error about the method not existing. I have no idea where these JSON-RPC functions come from. Substrate doesn't support them.

Are you trying to achieve something specific by calling rpc.net.version? This function seems utterly useless to me, and I'm not going to support random JSON-RPC functions just for the sake of returning a dummy "1".

from smoldot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.