1

I have some IoT(Internet of things) nodes sharing the received data from sensors with each others. I partitioned them to 2 private(permissioned) networks:

Network 1 includes: X,Y,Z nodes trusting each other. Network 2 includes: M,N,O nodes trusting each other,for example.

In addition to overall smart contract for each network,

Can I write an individual contract which is special for each node of network( a smart contract for each node) for doing particular act in special time, such as sending data to the another node of another network in special time?

For instance, a particular smart contract for node X of network 1 that in special time is triggered to send data to node M of network 2.

Regards,

0

For instance, a particular smart contract for node X of network 1 that in special time is triggered to send data to node M of network 2.

I don't think it's possible for a contract function to be directly triggered by a time event. Instead you would need an external application to call the contract's function at the specified time. Check out this question for more info.

I also don't think it's possible for a contract to send data to a different network without an external application.

  • I would like to store an dynamic array including a number of times such as 8 am and 2 pm in a smart contract (each node has its own separate smart contract). At these times, smart contract itself or call a component of node for reading some data from blockchain and then send to a node in second network. 2) while updating an array of a smart contract later, whether smart contract is able to check the identity(PK) of a person or machine with right to update the times of array before updating? – Siamak Oct 17 '18 at 22:16
  • Can I also define an overall smart contract including an array containing the PK of nodes wich are the member of permissioned network. Each node can read these PKs from smart contract and then store in its own storage and accept only data sent by a node of this PK list. This array will be updated later that announces to aIl member nodes for updating their PK list from smart contract since a new node might be added or eliminated to/from network. ethereum.stackexchange.com/questions/60462/… – Siamak Oct 17 '18 at 22:36
  • It's common for a contract to have an owner account with permission to call admin functions. For your contract I imagine the owner would add PK accounts to the contract and assign permissions to each PK. Check out this section on restricting access for an example. – sfmiller940 Oct 18 '18 at 17:28
  • Thank you for your great response. Would you answer my first comment(I would like to store an dynamic array including a number of times such as 8 am and 2 pm in a smart contract (each node has its own separate smart contract). At these times,....)? – Siamak Oct 18 '18 at 21:58
  • I don't understand why each node has its own contract... But this question gives an example of how a contract could assign arrays to each PK account. You'll probably want to restrict the append function to the owner and/or the PK accounts (as described in my previous comment). Also it might be useful to add an address parameter to the append function, rather than automatically using the sender's address. – sfmiller940 Oct 18 '18 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.