https://github.com/bptlab/blockchain-deferred-choice
https://github.com/bptlab/blockchain-deferred-choice
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bptlab/blockchain-deferred-choice
- Owner: bptlab
- Created: 2020-06-25T16:48:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T15:49:28.000Z (over 5 years ago)
- Last Synced: 2025-09-09T19:01:38.292Z (9 months ago)
- Language: JavaScript
- Size: 2.06 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> Which Event Happened First? Deferred Choice on Blockchain Using Oracles
*This repository is part of a research paper and should be viewed in that context.*
# Blockchain Deferred Choice
An implementation and evaluation of the deferred choice workflow pattern on Ethereum, using various oracle architectures and designs to implement events contingent on external data variables.
## Repository Structure
The repository is structured as follows:
- `results`: Results of the simulations as used in the paper
- `scripts`: Helper scripts to start `geth`
- `solidity`: Solidity smart contracts
- `src`: Off-chain components and Node.js framework
- `/keys`: Private keys of all pre-funded accounts in the genesis block
- `/providers`: Off-chain oracle provider code
- `/simulation`: Simulation logic
## Running the Simulations
### Installation
To run the simulations, you will need to have the following packages installed:
- [Node.js](https://nodejs.org/en/download/), tested with version `v12.18.3` and npm `6.14.6`
- [Go Ethereum](https://geth.ethereum.org/downloads/) (`geth`), tested with version `1.9.21-stable`
Everything else is then installed via npm:
```bash
npm install
```
### Starting `geth`
The simulations require certain accounts to be pre-funded.
A custom genesis block and a helpful cleanup/startup script are located in the `scripts` folder:
```bash
cd scripts
./geth.sh
```
### Simulations
There are two simulations:
- `npm run correctness`: Starts the correctness simulation
- `npm run cost`: Starts the cost simulation
Both simulations will output information to the console and a CSV file.
Additionally, the CSV output of the cost simulation can be translated to custom LaTeX code for inclusion in a paper using the `heatmap` script.