re-factor peer API

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