Basic Ethereum Miner Lib

Overview

EthMine

Basic Ethereum Miner Library.

Developers can integrate this algorithm to mine blocks from their ethereum supported chain efficiently.

Installation ⬇️

This Algorithm can be implemented for EthTrade for more functionality and interaction with the live Ethereum Chain. The link can be found under the "More Information" section.

This algorithm works for all versions of Python, but is recommended to run on Python3 due to functionalities of external libraries.

Installation Command: pip install ethminer

Note: Use pip3 if running on Python3.

Integrating the Library to the Project: from etherminer import EtherMine

Functionality ⚙️

EtherMine can be named into a separate object variable, but for example cases, EtherMine will be used for reference.

There are a few functions and commands that help users and developers interact with the chain right from their local host. Do note however, it is required to have an infura url that is live in order to interact with the chain. If you don't know what infura url is, or do not know how to use infura url, click on the link of their documentation unde the "More Information" section.

Connecting to the Chain 🔧

As stated above, to connect to the chain, users must have an infura url ready to be inputted. This infura url is a link that connects to their project on infura itself.

To connect to the chain: EtherMine.connect_chain()

Note: For the rest of the commands to work, users must be connected to the chain in order for full functionality.

Getting Latest Block 💡

Users can view and mine the latest block of the Ethereum chain in real time. However, there may be some latency depending on the connection of the chain to the user's network.

To get the latest block: EtherMine.get_top_block()

This command will return the latest block in constant time. Moreover, all the blocks viewed will be added to local array data structure that can be returned to view and use various blocks of the chain.

Getting Multiple Blocks 🙌🏻

Users can also retrieve a desired number of recent blocks on the chain. They will be prompted to type in the number of blocks they would like to see.

Syntax: EtherMine.get_multiple_blocks()

Similar to getting the latest block, all the blocks will be added to the local user array of saved blocks.

Viewing Blocks 🧱

The users can view all their past blocks they have seen using the commands listed above.

Syntax: EtherMine.view_blocks()

This command may be a little heavy depending on how many blocks the user has saved, however, all the information will be outputted, which can be used for anything, such as the local mining procedure this library has to offer. This array can be used for multiple applications as it is returned rather than being printed.

Mining 💎

Users can also mine a block with the in-built mining function. Depending on the performance of the user's machine, the mining process can be a little bit heavy for some users, but does work for all systems.

To mine: EtherMine.mine(block_number, from_account_hash, transaction_hash, previous_hash, difficulty)

This command does have some pre-requisities as inputs:

  • block_number: The number of the block the user would like to mine.
  • from_account_hash: The original owner of the block
  • transaction_hash: The transaction hash
  • previous_hash: The previous transaction hash of the block
  • difficulty: The difficulty of the block

All this information can be found using the platform EthTrade (view the "More Information" section for more information)or using the functions listed above. However, note that if the user does use the functions above, some information may not be all available.

If the mining is unsucessful, the algorithm will return None, else, it will return the hash of the block along with the nonce value.

More Information 📚

This library is full functional for all operating systems. However, this algorithm may not work for all Web3 library versions.

Infura: https://infura.io Library on PyPi: https://pypi.org/project/ethminer/ EthTrade: https://github.com/GEEGABYTE1/EthTrade

Made with 🔮

You might also like...
This is a basic encryption and decryption program made in python.

A basic encryption and decryption program to visualize how the process of protecting data works.

Web3 Ethereum DeFi toolkit for smart contracts, Uniswap and PancakeSwap trades, Ethereum JSON-RPC utilities, wallets and automated test suites.
Web3 Ethereum DeFi toolkit for smart contracts, Uniswap and PancakeSwap trades, Ethereum JSON-RPC utilities, wallets and automated test suites.

Web3 Ethereum Defi This project contains common Ethereum smart contracts and utilities, for trading, wallets,automated test suites and backend integra

Python lib to automate basic QFT calculations like Wick-contractions.

QFTools Python lib to automate basic QFT calculations like Wick-contractions. Features Wick contractions for real scalar fields Wick contractions for

The Intelligent Bitcoin Miner, Part II

The Intelligent Bitcoin Miner, Part II At a Glance This app simulates the behavior and profitability of Bitcoin miners for The Intelligent Bitcoin Min

Another Provably Rare Gem Miner 💎 (for Raritygems)

Provably Rare Gem Miner Go (for Rarity) Pull Request is strongly welcome as I don't know anything about Golang/Python/Web3. Usage Install Python 3.x i

Deep Web Miner Python | Spyder Crawler

Webcrawler written in Python. This crawler does dig in till the 3 level of inside addressed and mine the respective data accordingly

XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.
XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

Que es S4K Builder?, Fácil un constructor de tokens grabbers con muchas opciones, como BTC Miner, Clipper, shutdown PC, Y más! Disfrute el proyecto. 3

S4K Builder Este script Python 3 de código abierto es un constructor del muy popular registrador de tokens que está en [mi GitHub] (https://github.com

Turn crypto miner on/off depending on powerwall charge level

Mining Crypto with Tesla Solar and Powerwalls This script turns a crypto miner on and off when the Tesla Powerwall level drops/rises above a certain t

This tool help you to check if your Windows machine has hidden miner.

Hidden Miner Detector This tool help you to check if your Windows machine has hidden miner. Miners track when you open antivirus software or task mana

Twitch Points Miner for multiple accounts with Discord logging

Twitch Points Miner for multiple accounts with Discord logging Creator of the Twitch Miner -- PLEASE NOTE THIS IS PROBABLY BANNABLE -- Made on python

This is simple Blockchain ,miner and wallet to send crypto using python

pythonBlockchain-SImple This is simple Blockchain ,miner and wallet to send crypto using python It is simple Blocchain so it can only dobasic work usi

TON Miner from TON-Pool.com

TON-Pool Miner Miner from TON-Pool.com

A DUCO (Duino-Coin) miner for GigaDevice ARM boards.
A DUCO (Duino-Coin) miner for GigaDevice ARM boards.

GD32 Duino-Coin Miner Description Contains the firmware and miner software for mining DUCO (Duino-Coin) on GigaDevice GD32 chips. Supported boards GD3

A step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.
A step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

This project has a step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

a basic code repository for basic task in CV(classification,detection,segmentation)

basic_cv a basic code repository for basic task in CV(classification,detection,segmentation,tracking) classification generate dataset train predict de

Ethereum Gas Fee for the MacBook Pro touchbar (using BetterTouchTool)
Ethereum Gas Fee for the MacBook Pro touchbar (using BetterTouchTool)

Gasbar Ethereum Gas Fee for the MacBook Pro touchbar (using BetterTouchTool) Worried about Ethereum gas fees? Me too. I'd like to keep an eye on them

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.

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

Owner
Jaival Patel
Competitive Programmer submitting solutions every second | Blockchain Developer creating cryptos everyday
Jaival Patel
XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

null 29 Jul 7, 2022
This is simple Blockchain ,miner and wallet to send crypto using python

pythonBlockchain-SImple This is simple Blockchain ,miner and wallet to send crypto using python It is simple Blocchain so it can only dobasic work usi

null 3 Nov 22, 2022
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
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
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
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
Lottery by Ethereum Blockchain

Lottery by Ethereum Blockchain Set your web3 provider url in .env PROVIDER=https://mainnet.infura.io/v3/<YOUR-INFURA-TOKEN> Create your source file .

John Torres 3 Dec 23, 2021
Encrypt your code without a worry. Stark utilizes the base64, hashlib and Crypto lib to encrypt your code which cannot be decrypted with any online tools.

Stark Encrypt your code without a worry. Stark utilizes the base64, hashlib and Crypto lib to encrypt your code which cannot be decrypted with any onl

cliphd 3 Sep 10, 2021