named-data / python-ndn

An NDN client library with AsyncIO support in Python 3
https://python-ndn.readthedocs.io/en/latest
Apache License 2.0
24 stars 17 forks source link

Error encountered when using examples #28

Closed Miao-code closed 3 years ago

Miao-code commented 3 years ago

Hello I'm new to ndn and python-ndn and now I ran into some errors in producer.py and comsumer.py in examples.

After installed NFD and add no_signature=True in producer.py's put_data function(otherwise there's default identity error), producer can successfully send packages to NFD but consumer can't receive it and has timeout error.

Could you explain how to correctly use these example codes?

zjkmxy commented 3 years ago

Hello.

otherwise there's default identity error

You need to setup ndnsec. You can try to run

ndnsec-key-gen /localhost/operator

Could you explain how to correctly use these example codes?

This is because by default NFD drops DATA packets without a signature. You can try digest_sha256=True to use a SHA256 hash if you don't want to sign it with a key.