Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Commit

Permalink
Added P2P demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
zsoltpardi committed Nov 6, 2015
1 parent 0131556 commit dba6405
Show file tree
Hide file tree
Showing 38 changed files with 2,667 additions and 497 deletions.
104 changes: 104 additions & 0 deletions data/dbs/file/db.js
Expand Up @@ -87,6 +87,110 @@ definitions.push(
);


definitions.push(
{
"name": "Toyota",
"model": {
"@events": {
"door_open": {
"type": "object",
"fields": {
"timestamp": {
"description": "The time of event",
"type": "numeric"
},
}
},
},
"@properties": {
"speed": {
"type": "object",
"fields": {
"unit": {
"description": "The unit identifier in KmH or MpH",
"type": "string"
},
"value": {
"description": "The speed value",
"type": "numeric"
}
}
},
"location": {
"type": "object",
"fields": {
"latitude": {
"description": "The latitude part of the location",
"type": "string"
},
"longitude": {
"description": "The longitude part of the location",
"type": "numeric"
}
}
}
},
"@actions": {
"unlock": null,
"lock": null
}
}
}
);


definitions.push(
{
"name": "Ford",
"model": {
"@events": {
"door_open": {
"type": "object",
"fields": {
"timestamp": {
"description": "The time of event",
"type": "numeric"
},
}
},
},
"@properties": {
"speed": {
"type": "object",
"fields": {
"unit": {
"description": "The unit identifier in KmH or MpH",
"type": "string"
},
"value": {
"description": "The speed value",
"type": "numeric"
}
}
},
"location": {
"type": "object",
"fields": {
"latitude": {
"description": "The latitude part of the location",
"type": "string"
},
"longitude": {
"description": "The longitude part of the location",
"type": "numeric"
}
}
}
},
"@actions": {
"unlock": null,
"lock": null
}
}
}
);


exports.find_thing = function find_thing(name, callback) {
var thing = null;
for (i = 0; i < definitions.length; i++) {
Expand Down
16 changes: 14 additions & 2 deletions examples/p2p_demo/config.js
Expand Up @@ -19,8 +19,20 @@ var config = {
},
servers: {
p2p: {
address: 'localhost',
port: 31300
nodes: [
{
address: 'localhost',
port: 31300,
nick: "wotseed01",
seeds: []
},
{
address: 'localhost',
port: 31301,
nick: "wotseed02",
seeds: [{ address: 'localhost', port: 31300 }]
}
]
}
},
// The application database configuration. The ./data/dbs directory includes the database implementations
Expand Down

0 comments on commit dba6405

Please sign in to comment.