Comments (4)
From the point of view of smoldot, the only JSON-RPC functions that it supports are:
- The ones that Substrate supports, and they should be considered deprecated.
- https://paritytech.github.io/json-rpc-interface-spec/, which are correctly designed and should be preferred.
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.
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.
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.
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)
- Remove multistream-select extra roundtrip
- setTimeout has a minimum delay of 1 second (or 15mn on mobile) in inactive tabs HOT 2
- Refactor WebSocket handling by using a separate `SingleStreamHandshakeKind`
- Data inconsistency between Light Client connection and WSS connection HOT 1
- Smoldot should return runtime logs on call error through RPC layer HOT 1
- Warp sync progress report isn't working correctly
- Rococo warp syncing seems to take forever HOT 3
- Remove usage of `tracing` from full node HOT 1
- The `trie::node_value` and `trie::proof_node_codec` modules are kind of redundant
- An empty Merkle proof should probably be considered valid
- The network key should periodically change
- Allow requests with omitted `params` field
- Spelling relayChain and paraId not accepted by smoldot
- Remove uncles-related code
- Repo migration? HOT 1
- RUSTSEC-2020-0168: mach is unmaintained
- Transfer issues/PRs to new repo, archive this repo
- assertion failed: self.tx_buffer_encrypted.as_slices().1.is_empty()
- Deprecate this repo HOT 2
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 smoldot.