Bitcore-p2p messages

Hi All.
I update my bitcore-p2p module, after it following code don`t works.
what is problem?

    var p2p = require('bitcore-p2p')
var Peer = p2p.Peer;
var Messages = p2p.Messages;
var peer = new Peer({host: '127.0.0.1'});

peer.on('ready', function() {
    console.log(peer.version, peer.subversion, peer.bestHeight);
    var message = new Messages.GetAddresses();
    peer.sendMessage(message);
});

peer.on('addr', function(message) {
    message.addresses.forEach(function(address) {
        peer.sendMessage(message);
        console.log(address)
    });
});

peer.connect();

print this error `

TypeError: Messages.GetAddresses is not a function
    at Peer.<anonymous> (/root/newBitcore/main.js:47:19)
    at emitNone (events.js:67:13)
    at Peer.emit (events.js:166:7)
    at Peer.<anonymous> (/root/newBitcore/node_modules/bitcore-p2p/lib/peer.js:85:10)
    at emitOne (events.js:77:13)
    at Peer.emit (events.js:169:7)
    at Peer._readMessage (/root/newBitcore/node_modules/bitcore-p2p/lib/peer.js:221:10)
    at Peer._readMessage (/root/newBitcore/node_modules/bitcore-p2p/lib/peer.js:222:10)
    at Socket.<anonymous> (/root/newBitcore/node_modules/bitcore-p2p/lib/peer.js:167:10)
    at emitOne (events.js:77:13)

Looks like you need to instantiate messages:

var messages = new Messages();

it not helps

Looks like the API doc might need a bit of updating. https://bitcore.io/api/p2p/peer has the command listed as

Messages.GetAddresses();

but I believe it should be

Messages.GetAddr();

The following code snippet works for me.

var p2p = require('bitcore-p2p')
var Peer = p2p.Peer;
var Messages = p2p.Messages;
var peer = new Peer({host: '127.0.0.1'});

peer.on('ready', function() {
    console.log(peer.version, peer.subversion, peer.bestHeight);
    var messages = new Messages();
    var getAddrMessage =  messages.GetAddr();
    peer.sendMessage(getAddrMessage);
});

peer.on('addr', function(message) {
    message.addresses.forEach(function(address) {
        peer.sendMessage(message);
        console.log(address)
    });
});

peer.connect();

thanks, it works
You can chenge document in Peer-to-Peer Messages https://bitcore.io/api/p2p/messages