Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A critical bug in IpfsClient.id() #143

Open
Ayana-chan opened this issue Jan 13, 2024 · 2 comments
Open

A critical bug in IpfsClient.id() #143

Ayana-chan opened this issue Jan 13, 2024 · 2 comments

Comments

@Ayana-chan
Copy link

I got a trouble when I want to obtain IPFS node's information. I use IpfsClient like:

let client = IpfsClient::from_ipv4(
    "http".parse().unwrap(),
    SocketAddrV4::new(Ipv4Addr::new(192, 168, 177, 134), 5001),
).unwrap();
let data = Cursor::new("Hello World!");

match client.add(data).await {
    Ok(res) => println!("{}", res.hash),
    Err(e) => eprintln!("error adding file: {:?}", e)
}

match client.id(None).await {
    Ok(res) => println!("{:?}", res),
    Err(e) => eprintln!("error search id: {:?}", e)
}

log in console:

2024-01-13T04:28:28.215302Z DEBUG hyper::client::connect::http: connecting to 192.168.177.134:5001
2024-01-13T04:28:28.218332Z DEBUG hyper::client::connect::http: connected to 192.168.177.134:5001
2024-01-13T04:28:28.219355Z DEBUG hyper::proto::h1::io: flushed 282 bytes
2024-01-13T04:28:28.221537Z DEBUG hyper::proto::h1::io: parsed 9 headers
2024-01-13T04:28:28.221562Z DEBUG hyper::proto::h1::conn: incoming body is chunked encoding
2024-01-13T04:28:28.221658Z DEBUG hyper::proto::h1::decode: incoming chunked header: 0x7E (126 bytes)
2024-01-13T04:28:28.221807Z DEBUG hyper::proto::h1::conn: incoming body completed
2024-01-13T04:28:28.222229Z DEBUG hyper::client::connect::http: connecting to 192.168.177.134:5001
2024-01-13T04:28:28.242367Z DEBUG hyper::client::connect::http: connected to 192.168.177.134:5001
2024-01-13T04:28:28.242886Z DEBUG hyper::proto::h1::io: flushed 57 bytes
2024-01-13T04:28:28.244702Z DEBUG hyper::proto::h1::io: parsed 8 headers
2024-01-13T04:28:28.244722Z DEBUG hyper::proto::h1::conn: incoming body is chunked encoding
2024-01-13T04:28:28.244754Z DEBUG hyper::proto::h1::decode: incoming chunked header: 0x87E (2174 bytes)
2024-01-13T04:28:28.244846Z DEBUG hyper::proto::h1::conn: incoming body completed
Qmf1rtki74jvYmGeqaaV51hzeiaa6DyWc98fzDiuPatzyy
error search id: IpfsClientError(Parse(Error("missing field `ProtocolVersion`", line: 1, column: 2173)))

I can't find where the ProtocolVersion is needed, while there are no any problem in add() or log_ls(). Very confused.

In addition, the 192.168.177.134:5001 is on my Ubuntu 22.04 in Vmware, and the IPFS node is Kubo in Docker.

@Ayana-chan
Copy link
Author

I found the reason. IdResponse should be updated. The "protocol_version" is not responded now. Instead, a array "Protocols" is responded.

@ehsan6sha
Copy link

I found the reason. IdResponse should be updated. The "protocol_version" is not responded now. Instead, a array "Protocols" is responded.

Could you get around the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants