mediachain / concat

Mediachain daemons
MIT License
42 stars 13 forks source link

Push Publishing #82

Closed vyzo closed 7 years ago

vyzo commented 7 years ago

Implement the /mediachain/node/push protocol for accepting pushes from authorized peers. Semantics are those of an inverted merge: the source pushes statements, and the receiver merges them and requests objects by reusing the merge protocol implementation.

Closes #23

Implementation:

Also: changes mc/nat public ip detection service to ifconfig.co, as ifconfig.me appears to be busted.

Examples

$ curl http://127.0.0.1:9002/auth {}

Authorize a peer (just self here)

$ curl -H "Content-Type: application/text" -d '' http://127.0.0.1:9002/auth/QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa OK $ curl http://127.0.0.1:9002/auth {"QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa":[""]} $ curl -H "Content-Type: application/text" -d ',foo.,bar.baz' http://127.0.0.1:9002/auth/QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa OK $ curl http://127.0.0.1:9002/auth {"QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa":["","foo.","bar.baz"]} $ curl http://127.0.0.1:9002/auth/QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa ,foo.,bar.baz

revoke authorization

$ curl -H "Content-Type: application/text" -d '' http://127.0.0.1:9002/auth/QmeBkfxcaBfA9pvzivRwhF2PM7sXpp4HHQbp7jfTkRCWEa OK $ curl http://127.0.0.1:9002/auth {}

parkan commented 7 years ago

Looking good so far