mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
add other examples for finding contact
This commit is contained in:
parent
cd5bebc973
commit
1b399d1933
1 changed files with 4 additions and 1 deletions
|
|
@ -10,10 +10,13 @@ connection.on("connected", async () => {
|
|||
console.log("Connected");
|
||||
|
||||
// find contact
|
||||
// const contact = await connection.findContactByName("Liam's Solar Repeater");
|
||||
// const contact = await connection.findContactByPublicKeyPrefix([0x93, 0x5c, 0x6b, 0x69]);
|
||||
const contact = await connection.findContactByName("Liam's Solar Repeater");
|
||||
// const contact = await connection.findContactByPublicKeyPrefix(Buffer.from("935c6b69", "hex"));
|
||||
const contact = await connection.findContactByPublicKeyPrefix(Buffer.from("935c6b694200644710a374c250c76f7aed9ec2ff3e60261447d4eda7c246ce5d", "hex"));
|
||||
if(!contact){
|
||||
console.log("Contact not found");
|
||||
await connection.close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue