Skip to content

Instantly share code, notes, and snippets.

View a-deal's full-sized avatar

Andrew Deal a-deal

  • San Francisco
View GitHub Profile

What are the parameters R, W, and N?

  • R | Minimum number of nodes that must participate in a successful read operation
  • W | Minimum number of nodes that must participate in a successful write operation
  • N | Number of replicas nodes that retain copies of a system's data (or partition thereof)

How many node failures can the system tolerate while still guaranteeing that read operations will return up-to-date values?

  • Given that R is the minimum number of replicas to be read from for a read operation to be successful, it stands that N, where N equals the number of healthy replica nodes, must be at least equal to R for an up-to-date read operation to succeed. Failures can affect up until where the remaining healthy nodes is at least R.
pragma solidity ^0.5.0;
import "./provableAPI_0.5.sol";
import "./SafeMath.sol";
/// @title A simulated coin flipper with rewards for winners!
/// @author Andrew Deal
/// @notice You can use this contract to win ETH if you guess heads or tails correctly!
contract ChainFlipper is usingProvable {
Verifying my Blockstack ID is secured with the address 1F7rqBkEUnukZanjyTjGCKLEVMC38RX4F4 https://explorer.blockstack.org/address/1F7rqBkEUnukZanjyTjGCKLEVMC38RX4F4
/*
Problem Description:
Given an array of integers AND/OR arbitrarily nested
arrays, return a single array of integers values only.
Input: <array>
Output: <array>