Closed ltfschoen closed 2 months ago
Hey Luke
It's easier that you use the reconnecting-client from subxt (enable it with --feature unstable-reconnecting-rpc-client) otherwise you have to implement RpcClientT trait from subxt for the reconnecting client.
To elaborate if you depend directly on the reconnecting-rpc-client, you need this impl
you need this impl
thanks, i believe i did that in this commit https://github.com/ltfschoen/subxt/pull/1/commits/ae2272f3d2a50feada491d5a76a358defe78362b, but i still get the same error, where i ran it with:
RUST_LOG="jsonrpsee=trace,reconnecting_jsonrpsee_ws_client=trace" cargo run --bin substrate-node-example --features unstable-reconnecting-rpc-client
@ltfschoen Try to add 'unstable-light-client' and 'jsonrpsee' features to your subxt package.
subxt = { version = "0.35.2", features = ["unstable-light-client", "jsonrpsee"] }
I added some comments to your branch how to fix the compilation errors you got. You need to add the following to your Cargo.toml in your branch:
subxt = { path = "../subxt", features = ["unstable-reconnecting-rpc-client"] }
# remove the reconnecting-rpc-client dependency and use it from subxt
As this works in the subxt example, it should work Re-open the issue if it doesn't work...
ltfschoen#1 (comment)
thanks, yes it worked using your suggestion in this commit https://github.com/ltfschoen/subxt/pull/1/commits/e12183fa7c1f3db3c3e410e9341244524d3ea42e, so we can close the issue.
first i ran the polkadot-sdk node with:
cargo build
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/substrate-node \
--dev \
--validator \
--alice \
--name "Substrate Clawbird-dev" \
--base-path "/tmp/substrate" \
--port 30333 \
--rpc-port 9944 \
--rpc-cors=all \
--rpc-methods=Unsafe \
--rpc-external \
--unsafe-rpc-external \
--node-key 0000000000000000000000000000000000000000000000000000000000000001 \
--log debug,sync=debug,grandpa=debug \
--detailed-log-output \
--enable-log-reloading \
--prometheus-external \
--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' \
-lruntime=debug
then ran the example with
RUST_LOG="jsonrpsee=trace,reconnecting_rpc_client=trace" cargo run --bin substrate-node-example
which outputs
Connected via RPC
XXX Creating bounded vec
thread 'main' panicked at src/main.rs:120:56:
called `Result::unwrap()` on an `Err` value: [115, 112, 101, 99, 105, 97, 108, 49]
where [115, 112, 101, 99, 105, 97, 108, 49]
corresponds to b"special1"
on this line of code.
but i don't understand why that errors, since the value is less than 32 chars long, which i thought would be allowable.
i can only overcome that error if i change Lines 119 to 122 shown below
(
Data::Raw0(b"special1".to_vec().try_into().unwrap()),
Data::Raw0(b"special2".to_vec().try_into().unwrap()),
),
to instead just use Data::None
as shown below:
(Data::None, Data::None),
so if i do that it'll run past line 127 and out put "XXX Creating identity info"
but then it outputs the following error:
XXX Creating identity info
thread 'main' panicked at src/main.rs:136:57:
called `Result::unwrap()` on an `Err` value: [110, 97, 109, 101]
where [110, 97, 109, 101]
corresponds to name
on the line 136
display: Data::Raw0(b"name".to_vec().try_into().unwrap()),
https://github.com/ltfschoen/subxt/pull/1/commits/e12183fa7c1f3db3c3e410e9341244524d3ea42e#diff-2383e11ebe67e1cad1eb504eae6fd615c67f90a72a920ede03d8340516acdacbR136.
but again i don't understand why that happens either, since it is also a value less than 32 characters long, which i thought would be allowable.
Why do I get the following error in this PR https://github.com/ltfschoen/subxt/pull/1#issue-2229557186 when i run the following, which generates the metadata associated with a Polkadot SDK Substrate Node that i'm running locally and then runs the example in ./examples/substrate-node-example/src/main.rs? i've tried to use the "newtype pattern"...
error: