.do.node¶
.transfer¶
pruf.do.node.transfer(from, to, nodeId)
Transfer a node from a specified address.
Parameters¶
from
String | Address
Address currently holding the node
to
String | Address
Address which is to receive the node
nodeId
String | Uint32
ID used to reference the node to be transferred
Example usage¶
1//Example pruf-js code 2let _from = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049"; 3let _to = "0x9094CaDBF4d35ce5FeD92eb758909fB38F7fecb1"; 4let _nodeId = "10"; 5 6pruf.do.node.transfer 7( 8 _from, 9 _to, 10 _nodeId 11) 12.send({ from: props.addr }) 13.on("receipt"()=>{ 14 console.log(receipt.transactionHash); 15});
.setOperationCost¶
pruf.do.node.setOperationCost(nodeId, operationIndex, cost, beneficiary)
Sets the cost of a node operation in $PRUF.
Parameters¶
nodeId
String | Uint32
ID used to reference a node
operationIndex
String | Uint16
The index number of the operation cost to be modified
cost
String | Uint256
The desired amount to which the cost will be set
beneficiary
String | Address
The address to which revenue for this service should be sent
Example usage¶
1//Example pruf-js code 2let _nodeId = "10"; 3let _operationIndex = "1"; 4let _cost = "10000000000000000000"; 5let _beneficiary = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049"; 6 7pruf.do.node.setOperationCost 8( 9 _nodeId, 10 _serviceId, 11 _cost, 12 beneficiary 13) 14.send({ from: props.addr }) 15.on("receipt"()=>{ 16 console.log(receipt.transactionHash); 17});
.updateImportStatus¶
pruf.do.node.updateImportStatus(thisNodeId, otherNodeId, newStatus)
Change the one-way import relationship between nodes.
Parameters¶
thisNodeId
String | Uint32
ID of controlled node from which the status will change
otherNodeId
String | Uint32
ID of node to which the status will change
newStatus
String | Uint32
ID used to reference a node
Example usage¶
1//Example pruf-js code 2let _thisNodeId = "10"; 3let _otherNodeId = "11"; 4let _newStatus = "1"; 5 6pruf.do.node.updateImportStatus 7( 8 _thisNodeId, 9 _otherNodeId, 10 _newStatus 11) 12.send({ from: props.addr }) 13.on("receipt"()=>{ 14 console.log(receipt.transactionHash); 15});
.updateCAS¶
pruf.do.node.updateCAS(nodeId, CAS1, CAS2)
Update the content addressible storage attatched to a specified node.
Parameters¶
nodeId
String | Uint32
Address currently holding the node
CAS1/2
String | Bytes32
Key used to link node to off-chain storage, CAS2 must be set to bytes32(0) if it is not required.
Example usage¶
1//Example pruf-js code 2 3let _nodeId = "10"; 4let _CAS1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 5let _CAS2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 6 7pruf.do.node.updateCAS 8( 9 _nodeId, 10 _CAS1, 11 _CAS2 12) 13.send({ from: props.addr }) 14.on("receipt"()=>{ 15 console.log(receipt.transactionHash); 16});
.finalize¶
pruf.do.node.finalize(nodeId, managementType, storageProvider, refAddress, switches)
Sets non-mutable settings and activates node for use in asset creation and management.
Parameters¶
nodeId
String | Uint32
ID used to reference a node
managementType
String | Uint8
ID of the desired managent type setting
storageProvider
String | Uint8
ID of the desired storage provider
refAddress
String | Address
Address which permanently tied to the node for origin reference
switches
String | Uint8
Combination of numbers which are refernced by position for various node and asset management rules
Example usage¶
1//Example pruf-js code 2let _nodeId = "10"; 3let _managementType = "2"; 4let _storageProvider = "1"; 5let _refAddress = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049"; 6let _switches = "0201" 7 8pruf.do.node.transfer 9( 10 _nodeId, 11 _managementType, 12 _storageProvider, 13 _refAddress, 14 _switches 15) 16.send({ from: props.addr }) 17.on("receipt"()=>{ 18 console.log(receipt.transactionHash); 19});
.approve¶
pruf.do.node.approve(to, nodeId)
Approves an address to access ERC-721 functionality of a node.
Parameters¶
to
String | Address
Address to which user would like to grant approval
nodeId
String | Uint32
ID used to reference a node
Example usage¶
1//Example pruf-js code 2 3let _to = "0x0D15833D60F448487f157578F3e8c208AFCBa537" 4let _nodeId = "10" 5pruf.do.node.approve 6( 7 _to, 8 _nodeId 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.setApprovalForAll¶
pruf.do.node.setApprovalForAll(to, approved)
Approves an address to access ERC-721 functionality of all node.
Parameters¶
to
String | Address
Address to which user would like to grant approval
approved
Bool
Desired setting for approval
Example usage¶
1//Example pruf-js code 2 3let _to = "0x0D15833D60F448487f157578F3e8c208AFCBa537" 4let _approval = false 5pruf.do.node.setApprovalForAll 6( 7 _to, 8 _approval 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.enableDefaultContracts¶
pruf.do.node.enableDefaultContracts(nodeId)
Transfer a node from a specified address.
Parameters¶
nodeId
String | Uint32
ID used to reference a node
Example usage¶
1//Example pruf-js code 2let _nodeId = "10"; 3 4pruf.do.node.enableDefaultContracts 5( 6 _nodeId 7) 8.send({ from: props.addr }) 9.on("receipt"()=>{ 10 console.log(receipt.transactionHash); 11});
.enableContract¶
pruf.do.node.enableContract(name, nodeId, authLevel)
Transfer a node from a specified address.
Parameters¶
name
String
Name of contract to be added for name resolution
nodeId
String | Uint32
ID used to reference a node
authLevel
String | Uint8
ID of authority level for new contract
Example usage¶
1//Example pruf-js code 2let _name = "NEW_ESCROW"; 3let _nodeId = "10"; 4let _authLevel = "3"; 5 6pruf.do.node.enableContract 7( 8 _name, 9 _nodeId, 10 _authLevel 11) 12.send({ from: props.addr }) 13.on("receipt"()=>{ 14 console.log(receipt.transactionHash); 15});
.mint¶
pruf.do.node.mint(domain, tld, rootNode, custodyType, CAS1, CAS2)
Mint a new node using an unstoppable domain.
Parameters¶
domain
String
Name of domain from which to derive node info
tld
String
Top level domain of desired unstoppable domain held by caller
custodyType
String | Uint8
Indicates the desired custody type for assets minted using this node
CAS1/2
String
Key used to link node to off-chain storage, CAS2 must be set to bytes32(0) if it is not required.
Example usage¶
1//Example pruf-js code 2let _domain = "mytestdomain"; 3let _tld = ".crypto"; 4let _rootNode = "3"; 5let _custodyType = "2"; 6let _CAS1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 7let _CAS2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 8 9 10pruf.do.node.enableContract 11( 12 _domain, 13 _tld, 14 _rootNode, 15 _custodyType, 16 _CAS1, 17 _CAS2 18) 19.send({ from: props.addr }) 20.on("receipt"()=>{ 21 console.log(receipt.transactionHash); 22});