Lottery by Ethereum Blockchain

Overview

Lottery by Ethereum Blockchain

Set your web3 provider url in .env

PROVIDER=https://mainnet.infura.io/v3/
   

   

Create your source file ./data/input.txt

For example:

lorem
ipsum
dolor
sit
amet
consectetur
adipiscing
elit
curabitur
curabitur
curabitur
curabitur
ornare
commodo
eros
sed
cursus

Run

$ lottery.py -n <block-number> -p <pick-out>

For example:

$ lottery.py -n 12345678 -p 10
#
# Read `input.txt`:
#  ... lorem
#  ... ipsum
#  ... dolor
#  ... sit
#  ... amet
#  ... consectetur
#  ... adipiscing
#  ... elit
#  ... curabitur
#  ... ornare
#  ... commodo
#  ... eros
#  ... sed
#  ... cursus
#
# --- Pick 10 from 14 ---
#
# Write `output.txt`:
#  #12345678 - 0xb2a8b39935a5eb4b7c9b0117bca06c8d2c0629e0937d20e62c44aace6f05bda3 % 14 =  9 :: ornare
#  #12345679 - 0xac7f164008dd1bdf29c6c8799cb737d41663fa7d3215b38dfee20135c87a12e4 % 14 =  4 :: amet
#  #12345680 - 0x189bad2344f34ac6332e522a2c3aceaa28b4eddee63f842109c67cb16360fc3f % 14 = 13 :: cursus
#  #12345681 - 0x7c9d621ef426c60824a7d5e9871cde3376bcb48f17d1c209d6a6f033f493a090 % 14 =  4
#  #12345682 - 0xb63493b5909cb9aebb7d7bc0078369aee6a8b4c4b6f928d15e6f101f8a8148e3 % 14 =  3 :: sit
#  #12345683 - 0xa22cc64c1bae76698b248b785f0aca52f6a4dc6731dc03c547e2092bfa359b91 % 14 = 11 :: eros
#  #12345684 - 0x5b1ba21686f1857970066a65f3f188c8b5b908c9abb786b5d69120c06f307f4f % 14 =  3
#  #12345685 - 0x8365b9c5db946eab0256bb222b1c8b9d2ff5b85cd43757dc14d45d5a52fc181c % 14 =  8 :: curabitur
#  #12345686 - 0xc013b70b96bc64f3cdcc14ce641889e48d4a24b1cb36afb5193521cf6a748e82 % 14 =  8
#  #12345687 - 0x7f5aead9d7bed1c727169eaefdf9f42f1364f3157b3a37d5b9509b3c8e9de3df % 14 =  3
#  #12345688 - 0xfd9e556381a0fb3b6334f0557bf63bd6255a8200839145686b49afc5148b45d7 % 14 =  1 :: ipsum
#  #12345689 - 0xb96530735699884090fbf9b52a12dd5db35fd26cc98c207a87b766b62ae39805 % 14 =  7 :: elit
#  #12345690 - 0x405ce038cd88d623ae37b788141b7ff598c1de2ee59884c647be467a0834c129 % 14 =  3
#  #12345691 - 0xff8792d8378fa1910fa543f467eaa6d00e6a662fcf11a061e30cb7c686967d02 % 14 =  2 :: dolor
#  #12345692 - 0x17884860627988547dc6d9d2789c4259df1cd9f12e30bb864fe525fbcde4852b % 14 =  7
#  #12345693 - 0x74778bb54485899a5aa3fad9f9f4f14290d02c9b84f137142e4c604310c4b156 % 14 =  4
#  #12345694 - 0x254ba055bd867281a872d4df639ef6af99671c0f7a430d3cdc972ae2954c8a5e % 14 =  6 :: adipiscing

Then

You will get a ./data/output.txt and a ./data/log.txt

./data/output.txt

amet
cursus
sit
eros
curabitur
ipsum
elit
dolor
adipiscing
commodo
You might also like...
Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) consensus algorithm.
Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) consensus algorithm.

Ceres Combine-Harvester Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) c

blockchain address database

Blockchain Address Ownership Database The database is in data/addresses.db This is a SQLite database of addresses from several blockchains. It's obtai

A repository for Algogenous Smart Contracts created on the Algorand Blockchain.

Smart Contacts Alogrand Smart Contracts using Choice Coin. Read Docs for how to implement Algogenous Smart Contracts for your own applications. Smart

A repository for Algogenous Smart Contracts created on the Algorand Blockchain.

Smart Contacts This Repository is dedicated to code for Alogrand Smart Contracts using Choice Coin. Read Docs for how to implement Algogenous Smart Co

High Performance Blockchain Deserializer

bitcoin_explorer is an efficient library for reading bitcoin-core binary blockchain file as a database (utilising multi-threading).

Python implementation of a blockchain.

The goal of this project is to explain and to make clearer how is a blockchain structured at the very core. It's not built with the intention to replicate an advanced blockchain like Bitcoin or Ethereum

An BlockChain Based solution for storing the medical records

Blockchain-based Medical Records 📄 Abstract Blockchain has the ability to keep an incorruptible, decentralized, and transparent log of all patient da

A little side-project API for me to learn about Blockchain and Tokens

BlockChain API I built this little side project to learn more about Blockchain and Tokens. It might be maintained and implemented to other projects bu

A workshop to build an NFT smart contract on the polygon blockchain
A workshop to build an NFT smart contract on the polygon blockchain

Polygon NFT Workshop This is an interactive workshop that guides you through the steps to deploy an NFT smart contract on the Polygon blockchain. By t

Comments
  • Environment requirement Issue

    Environment requirement Issue

    First, you gotta need python 3.0+ Second, you need to install python-dotenv with command pip install python-dotenv. Then, you need to install python-dotenv with command pip install web3.

    Please update these env requirement into your README.md john.

    opened by YixuanFranco 0
Owner
John Torres
John Torres
Ethereum ETL lets you convert blockchain data into convenient formats like CSVs and relational databases.

Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions.

Blockchain ETL 2.3k Jan 1, 2023
Bridge between L1 (Ethereum) and L2 (cheapETH)

The ETH chain and the cheapETH chain. We can assume the ETH chain has ~1000x more value than the cheapETH chain.

null 107 Oct 12, 2022
A simple Ethereum mining pool

A simple getWork pool for ethereum mining Payouts are still manual. TODO: write payouts when someone mines 10 blocks. Also, make the submit actually

null 93 Oct 5, 2022
A simple Ethereum mining pool

A simple getWork pool for ethereum mining

null 93 Oct 5, 2022
How to setup a multi-client ethereum Eth1-Eth2 merge testnet

Mergenet tutorial Let's set up a local eth1-eth2 merge testnet! Preparing the setup environment In this tutorial, we use a series of scripts to genera

Diederik Loerakker 24 Jun 17, 2022
Basic Ethereum Miner Lib

EthMine ⛏ Basic Ethereum Miner Library. Developers can integrate this algorithm to mine blocks from their ethereum supported chain efficiently. Instal

Jaival Patel 1 Oct 30, 2021
Tutela: an Ethereum and Tornado Cash Anonymity Tool

Tutela: an Ethereum and Tornado Cash Anonymity Tool The repo contains open-source code for Tutela, an anonymity tool for Ethereum and Tornado Cash use

TutelaLabs 96 Dec 5, 2022
Learn Blockchains by Building One, A simple Blockchain in Python using Flask as a micro web framework.

Blockchain ✨ Learn Blockchains by Building One Yourself Installation Make sure Python 3.6+ is installed. Install Flask Web Framework. Clone this repos

Vaibhaw 46 Jan 5, 2023
Tools for running airdrop and token distribution campaigns on the Solana blockchain.

Overview This repository contains some of the scripts we have used for running our airdrop campaigns and other distributions. Initially, all of these

null 147 Nov 17, 2022
seno-blockchain is just a fork of Chia, designed to be efficient, decentralized, and secure

seno-blockchain https://seno.uno Seno is just a fork of Chia, designed to be efficient, decentralized, and secure. Here are some of the features and b

Denis Erygin 27 Jul 2, 2022