re-implement peer API

Signed-off-by: Manson Li <lijinsong@intfhink.com>