update to 1.0
This commit is contained in:
parent
72a94b72f7
commit
1cb1070d45
10 changed files with 2503 additions and 169 deletions
|
@ -40,18 +40,14 @@ class Wallet {
|
|||
return transaction;
|
||||
}
|
||||
|
||||
createMetadata(Name,Geo ,IP_URL , Topic_Token, Permission, RequestDetail, OrgOwner, DepOwner,
|
||||
PrsnOwner, PaymentPerKbyte, PaymentPerMinute, Protocol, MessageAttributes, Interval,
|
||||
FurtherDetails, SSNmetadata, transactionPool){
|
||||
createMetadata(SSNmetadata, transactionPool){
|
||||
//let metadata = transactionPool.existingMetadata(this.publicKey);
|
||||
|
||||
// if (metaData) {
|
||||
// metadata.update(this, Geo, Std, Name,MetaHash,file);
|
||||
// } else {*/
|
||||
|
||||
let metadata= Metadata.newMetadata(this, Name,Geo ,IP_URL , Topic_Token, Permission,
|
||||
RequestDetail, OrgOwner, DepOwner,PrsnOwner, PaymentPerKbyte, PaymentPerMinute,
|
||||
Protocol, MessageAttributes,Interval, FurtherDetails, SSNmetadata);
|
||||
let metadata= Metadata.newMetadata(this, SSNmetadata);
|
||||
transactionPool.AddMetadata(metadata);
|
||||
|
||||
//}
|
||||
|
@ -66,7 +62,7 @@ class Wallet {
|
|||
transactions.push(transaction);
|
||||
}));
|
||||
console.log("transactions of balance")
|
||||
console.log(transactions);
|
||||
console.log(transactions);
|
||||
const PaymentTransactions = transactions[0];
|
||||
console.log("Payment transactions ")
|
||||
console.log(PaymentTransactions);
|
||||
|
|
|
@ -4,65 +4,66 @@ class Metadata {
|
|||
constructor() {
|
||||
this.id = null;
|
||||
this.Signiture = null;
|
||||
this.Name = null;
|
||||
this.Geo = null;
|
||||
// this.Name = null;
|
||||
// this.Geo = null;
|
||||
|
||||
// this.GeospatialLocation = [];
|
||||
// this.Owenership = null;
|
||||
// this.Cost = null;
|
||||
// this.Identifications = null;
|
||||
// this.Integration = null;
|
||||
|
||||
this.IP_URL = null;
|
||||
this.Topic_Token = null;
|
||||
this.Permission = null;
|
||||
this.RequestDetail = null;
|
||||
this.OrgOwner = null;
|
||||
this.DepOwner = null;
|
||||
this.PrsnOwner = null;
|
||||
this.MetaHash = null;
|
||||
this.PaymentPerKbyte = null;
|
||||
this.PaymentPerMinute = null;
|
||||
this.Protocol = null;
|
||||
this.MessageAttributes= {};
|
||||
this.Interval = null;
|
||||
this.FurtherDetails = null;
|
||||
// this.IP_URL = null;
|
||||
// this.Topic_Token = null;
|
||||
// this.Permission = null;
|
||||
// this.RequestDetail = null;
|
||||
// this.OrgOwner = null;
|
||||
// this.DepOwner = null;
|
||||
// this.PrsnOwner = null;
|
||||
// this.MetaHash = null;
|
||||
// this.PaymentPerKbyte = null;
|
||||
// this.PaymentPerMinute = null;
|
||||
// this.Protocol = null;
|
||||
// this.MessageAttributes= {};
|
||||
// this.Interval = null;
|
||||
// this.FurtherDetails = null;
|
||||
this.SSNmetadata = null;
|
||||
}
|
||||
|
||||
static MetadataOfIoTDevice(senderWallet, Name,Geo ,IP_URL , Topic_Token, Permission, RequestDetail, OrgOwner, DepOwner,PrsnOwner, PaymentPerKbyte, PaymentPerMinute, Protocol, MessageAttributes, Intrval, FurtherDetails, SSNmetadata) {
|
||||
static MetadataOfIoTDevice(senderWallet, SSNmetadata) {
|
||||
const metadata = new this();
|
||||
metadata.id = ChainUtil.id();
|
||||
metadata.Name = Name;
|
||||
metadata.Geo = Geo;
|
||||
metadata.IP_URL = IP_URL;
|
||||
metadata.Topic_Token = Topic_Token;
|
||||
metadata.Permission = Permission;
|
||||
metadata.RequestDetail = RequestDetail
|
||||
metadata.OrgOwner = OrgOwner;
|
||||
metadata.DepOwner = DepOwner;
|
||||
metadata.PrsnOwner = PrsnOwner;
|
||||
metadata.PaymentPerKbyte = PaymentPerKbyte ;
|
||||
metadata.PaymentPerMinute = PaymentPerMinute;
|
||||
metadata.Protocol = Protocol;
|
||||
metadata.MessageAttributes = MessageAttributes;
|
||||
// metadata.Name = Name;
|
||||
// metadata.Geo = Geo;
|
||||
// metadata.IP_URL = IP_URL;
|
||||
// metadata.Topic_Token = Topic_Token;
|
||||
// metadata.Permission = Permission;
|
||||
// metadata.RequestDetail = RequestDetail
|
||||
// metadata.OrgOwner = OrgOwner;
|
||||
// metadata.DepOwner = DepOwner;
|
||||
// metadata.PrsnOwner = PrsnOwner;
|
||||
// metadata.PaymentPerKbyte = PaymentPerKbyte ;
|
||||
// metadata.PaymentPerMinute = PaymentPerMinute;
|
||||
// metadata.Protocol = Protocol;
|
||||
// metadata.MessageAttributes = MessageAttributes;
|
||||
|
||||
|
||||
// metadata.MessageAttributes['DeviceID'] = metadata.id;
|
||||
// metadata.MessageAttributes['DeviceName'] = Name;
|
||||
// metadata.MessageAttributes['Sensors'] =[{"SensorName":"","Value":"" , "Unit":""}];
|
||||
// metadata.MessageAttributes['TimeStamp'] = "";
|
||||
metadata.Interval = Intrval;
|
||||
metadata.FurtherDetails = FurtherDetails;
|
||||
|
||||
|
||||
// metadata.Interval = Intrval;
|
||||
// metadata.FurtherDetails = FurtherDetails;
|
||||
metadata.SSNmetadata = SSNmetadata;
|
||||
metadata.MetaHash = ChainUtil.hash(SSNmetadata);
|
||||
Metadata.signMetadata(metadata, senderWallet);
|
||||
return metadata;
|
||||
}
|
||||
|
||||
static newMetadata(senderWallet,Name,Geo ,IP_URL , Topic_Token, Permission, RequestDetail,
|
||||
OrgOwner, DepOwner,PrsnOwner, PaymentPerKbyte, PaymentPerMinute, Protocol, MessageAttributes,
|
||||
Interval, FurtherDetails, SSNmetadata){
|
||||
return Metadata.MetadataOfIoTDevice(senderWallet, Name,Geo ,IP_URL , Topic_Token, Permission,
|
||||
RequestDetail, OrgOwner, DepOwner,PrsnOwner, PaymentPerKbyte, PaymentPerMinute, Protocol,
|
||||
MessageAttributes, Interval, FurtherDetails, SSNmetadata
|
||||
static newMetadata(senderWallet,SSNmetadata){
|
||||
return Metadata.MetadataOfIoTDevice(senderWallet, SSNmetadata
|
||||
);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue