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

Talking to js-ipfs #19

Open
richardschneider opened this issue Nov 10, 2017 · 17 comments
Open

Talking to js-ipfs #19

richardschneider opened this issue Nov 10, 2017 · 17 comments

Comments

@richardschneider
Copy link
Owner

richardschneider commented Nov 10, 2017

All testing has been done against go-ipfs. js-ipfs is a new javasvript implementation of the IPFS server. Let's see how we play with it.

The code is being pushed to the js-ipfs branch.

@richardschneider
Copy link
Owner Author

js-ipfs server listens on port 5002 not 5001

richardschneider added a commit that referenced this issue Nov 10, 2017
@richardschneider
Copy link
Owner Author

richardschneider commented Nov 10, 2017

Need to recognize new network protocols

Message: Test method Ipfs.Api.GenericApiTest.Mars_Node_Info threw exception: 
System.AggregateException: One or more errors occurred. 
---> Newtonsoft.Json.JsonSerializationException: Error converting value "/p2p-circuit/ip4/0.0.0.0/tcp/4002/ipfs/QmV7Nosg5JQPSunFLc2NR4RKRkNzFmMXPw9VtHUx4qsz7i" to type 'Ipfs.MultiAddress'. Path 'Addresses[3]', line 1, position 812. 
---> System.FormatException: The IPFS network protocol 'p2p-circuit' is unknown.

@richardschneider
Copy link
Owner Author

richardschneider commented Nov 11, 2017

Added the new network protocols to net-ipfs-core v0.10.0

@richardschneider
Copy link
Owner Author

richardschneider commented Nov 11, 2017

Latency can have a value of "unknown". It was "n/a" on go-ipfs.

richardschneider added a commit that referenced this issue Nov 11, 2017
richardschneider added a commit that referenced this issue Nov 11, 2017
@richardschneider
Copy link
Owner Author

richardschneider commented Nov 11, 2017

54 tests are green and 15 red; not bad for alpha software. Many of the failed tests can be attributed to the following issues

  • pin add/ls NYI
  • file ls NYI
  • dht findprovs NYI
  • pubsub failures

@diasdavid FYI

@richardschneider
Copy link
Owner Author

richardschneider commented Nov 11, 2017

An interesting test failure is FindPeer. It appears that the mars node likes to change it's ID.

The requested peer ID is QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3. But the returned ID is QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv.

Test Name:	FindPeer
Test Outcome:	Failed
Result Message:	Assert.AreEqual failed. Expected:<QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3>. Actual:<QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv>.
Result StandardOutput:	
2017/11/11 14:49:45:425 [DEBUG] Ipfs.Api.IpfsClient - GET http://localhost:5002/api/v0/id?arg=QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3
2017/11/11 14:49:45:428 [DEBUG] Ipfs.Api.IpfsClient - RSP {"ID":"QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv","PublicKey":"CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCwb1DldHz0lJM6ox/l7ISPeNaf0s61kH+l2CwH2WY8x2oJm56pA4Big9SSx6YDW8nJU44tnlSo4E7KJvmpMEE4DQkatZcRLjxi2ujTEAx21CRSJIcBgbSAaB/ofo1UdIyGjaoUO7U8a8pAC1yJE9sh0MebOXgI8EMY5uKfyTCAUsznQdz+JN4AI4xP+Dv9ruLQuioJYpti2DeSrW+TIUFWW1Y4HSsT9Pv7ars0davPqXEmnAE633vnepe+K9MUJxqakgnHMEpq5w2HOW5kznSBAzhutMUHfa16Ky02slY0JgxOoLa9fr/YSsRlJMsrMoLZA2b8r+8kaimyMVtT/Uv3AgMBAAE=","Addresses":["/ip4/127.0.0.1/tcp/4002/ipfs/QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv","/ip4/127.0.0.1/tcp/4003/ws/ipfs/QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv","/ip4/192.168.178.21/tcp/4002/ipfs/QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv","/p2p-circuit/ip4/0.0.0.0/tcp/4002/ipfs/QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv","/p2p-circuit/ip4/127.0.0.1/tcp/4003/ws/ipfs/QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv","/p2p-circuit/ipfs/QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv"],"AgentVersion":"js-ipfs","ProtocolVersion":"9000"}

@daviddias
Copy link

Woot! Nice report @richardschneider, thank you for sharing this. Some of the failures will be fixed with:

I'm intrigued why PubSub failed, it should work the same way, unless your PubSub tests rely on the DHT.

As for:

The requested peer ID is QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3. But the returned ID is QmZLWJesud9er9iQZuJiitsDN2fTLKLn4pWwpkKk4CFYmv.

This is because the way a DHT works is by giving you the closest peers and since it doesn't find Mars, it gives you something different

@richardschneider
Copy link
Owner Author

Getting files ls working is high on my list. With this, I should be able to mount IPFS on a windows machine with js-ipfs, see net-ipfs-mount.

@richardschneider
Copy link
Owner Author

Cool DHT feature, will change my test case.

Learn something new every day.

@daviddias
Copy link

@pgte is almost finishing files ls ipfs-inactive/js-ipfs-unixfs-engine#197 \o/

Wanna help finish the Pin API? The PR is pretty advanced ipfs/js-ipfs#1045 and we already have interface tests https://github.com/ipfs/interface-ipfs-core/blob/master/src/pin.js that are used to test js-ipfs-api with go-ipfs too

@richardschneider
Copy link
Owner Author

I forgot to run js-ipfs with --enable-pubsub-experiment. But still getting some test failures,

@richardschneider
Copy link
Owner Author

richardschneider commented Nov 11, 2017

There are differences in the PublishedMessage from go and js; see ipfs/js-ipfs#1068.

@richardschneider
Copy link
Owner Author

Port 5001 vs 5002 is getting annoying. Let's make IpfsClient use environment variable IpfsHttpApi which contains the URL to server.

@richardschneider
Copy link
Owner Author

PublishedMessage differences are being resolved in ipfs/js-ipfs#1068

@richardschneider
Copy link
Owner Author

@diasdavid I'm looking for support of file ls

NOT files ls

@richardschneider
Copy link
Owner Author

ipfs/js-ipfs#1078 implements files ls API

richardschneider added a commit that referenced this issue Nov 16, 2017
js-ipfs #19 expects a link size for a directory. go-ipfs is happy either way,
@richardschneider
Copy link
Owner Author

The Pin API and DHT FindProviders are the only tests failing. All are returning Invalid IPFS command, which mean the API is not implemented.

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