.do.node

.transfer

pruf.do.node.transfer(from, to, nodeId)

Transfer a node from a specified address.

Parameters

  1. from

    • String | Address

    • Address currently holding the node

  2. to

    • String | Address

    • Address which is to receive the node

  3. 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

  1. nodeId

    • String | Uint32

    • ID used to reference a node

  2. operationIndex

    • String | Uint16

    • The index number of the operation cost to be modified

  3. cost

    • String | Uint256

    • The desired amount to which the cost will be set

  4. 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

  1. thisNodeId

    • String | Uint32

    • ID of controlled node from which the status will change

  2. otherNodeId

    • String | Uint32

    • ID of node to which the status will change

  3. 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

  1. nodeId

    • String | Uint32

    • Address currently holding the node

  2. 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});

.authorizeUser

pruf.do.node.authorizeUser(nodeId, addressHash, userType)

Authorize a user for activity on a node.

Parameters

  1. nodeId

    • String | Uint32

    • ID used to reference a node

  2. addressHash

    • String | Address

    • Sha3 hash of the user’s address which is to be authorized

  3. userType

    • String | Uint8

    • Type of user to set, by type ID

Example usage

 1//Example pruf-js code
 2let _nodeId = "10";
 3let _addressHash = "0x5fdbd35e8da83ee755d5e62a539e5ed7f47126abede0b8b10f9ea43dc6eed07f";
 4let _userType = "1";
 5
 6
 7pruf.do.node.authorizeUser
 8(
 9   _nodeId,
10   _addressHash,
11   _userType
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

  1. nodeId

    • String | Uint32

    • ID used to reference a node

  2. managementType

    • String | Uint8

    • ID of the desired managent type setting

  3. storageProvider

    • String | Uint8

    • ID of the desired storage provider

  4. refAddress

    • String | Address

    • Address which permanently tied to the node for origin reference

  5. 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

  1. to

    • String | Address

    • Address to which user would like to grant approval

  2. 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

  1. to

    • String | Address

    • Address to which user would like to grant approval

  2. 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

  1. 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

  1. name

    • String

    • Name of contract to be added for name resolution

  2. nodeId

    • String | Uint32

    • ID used to reference a node

  3. 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

  1. domain

    • String

    • Name of domain from which to derive node info

  2. tld

    • String

    • Top level domain of desired unstoppable domain held by caller

  3. custodyType

    • String | Uint8

    • Indicates the desired custody type for assets minted using this node

  4. 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});