System and method to reach consensus in a multi-chain iot environment