Basic Ethereum Miner Lib

Related tags

CryptographyEth-Miner
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 🔮

Owner
Jaival Patel
Competitive Programmer submitting solutions every second | Blockchain Developer creating cryptos everyday
Jaival Patel
Python FFI bindings for libsecp256k1 (maintained)

secp256k1-py Python FFI bindings for libsecp256k1 (an experimental and optimized C library for EC operations on curve secp256k1). Previously maintaine

Rusty Russell 29 Dec 29, 2022
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

38 Nov 14, 2022
Image Encryption/Decryption based on Rubik Cube 's principle and AES

Image Encryption/Decryption based on Rubik Cube 's principle and AES Our final project for Theory of Crytography class. Our Image Encryption/Decryptio

Danny 5 Apr 11, 2022
Hide secret texts inside an image, optionally encrypt them with a password using AES-256.

Hide secret texts/messages inside an image. You can optionally encrypt your texts with a password using AES-256 before encoding into the image.

Teja Swaroop 97 Dec 29, 2022
Hasher Hash, Compare and Verify your files Translations

Hasher Hash, Compare and Verify your files Translations In order to translate Hasher to a language you must add a folder with the language abbreviatio

Jeyson Flores 14 Apr 01, 2022
📊Python implementation of the Colin Talks Crypto Bitcoin Bull Run Index (CBBI).

Colin Talks Crypto Bitcoin Bull Run Index (CBBI) This is a Python implementation of the Colin Talks Crypto Bitcoin Bull Run Index (CBBI). It makes use

Kamil Monicz 86 Jan 02, 2023
This program can encrypt/ decrypt any string

Ceasar_cipher Hey this is J0ey, this program is a very basic Caesar cipher encoder/decoder. In order to use this program, you will need to have Python

1 Jan 11, 2022
Generate bitcoin public and private keys and check if they match a filelist of existing addresses that have a nonzero balance

btc-heist Running Install deps, i.e., python3 -m pip install -r requirements.txt Download the CSV dump of all bitcoin addresses with a balance and cut

Denis Khoshaba 103 Dec 05, 2022
Blockchain with crypto transaction feature

python script that asks users for their name, who they are sending J2 coin too(fictional cryptocurrency) and how much they're sending. it then prints the transaction detail in words and prints the ha

Joshua Stojkovic 2 Jan 10, 2022
smartpassgen - A cross-platform package of modules for generating, secure storage and recovery of complex, cryptographic, smart passwords on the fly.

smartpassgen - A cross-platform package of modules for generating, secure storage and recovery of complex, cryptographic, smart passwords on the fly.

4 Sep 04, 2021
Encrypt decrypt files - Programmed in Python | PySimpleGUI

Crypter Programmed in Python | PySimpleGUI If you like it give it a star How it works Crypter program use Fernet for encryption. Fernet guarantees tha

Adrijan 11 Jun 18, 2022
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
DIY gravity falls cryptograms made with python

ciphers-cryptograms some diy code to implementing ciphers-cryptograms from gravity falls with python, it's fun tho Algorithm or ciphers list Caesar At

Muhammad Asthi Seta Ari Yuwana 3 Jun 26, 2022
bitcoin-ticker is a E-ink ticker that shows usefull information about bitcoin

bitcoin-ticker bitcoin-ticker is a E-ink ticker that shows usefull information about bitcoin. Due to the limited refresh lifetime, new information is

32 Nov 09, 2022
This project is a proof of concept to create a dashboard using Dash to display information about various cryptocurrencies.

This project is a WIP as a way to display useful information about cryptocurrencies. It's currently being actively developed as a proof of concept, and a way to visualize more useful data about vario

7 Apr 21, 2022
Highly decentralized and censorship-resistant way to store key data

Beacon coin Beacon coin is a Chia singelton coin that can store data that needs to be: always available censorship resistant versioned potentially imm

Sebastjan Trepca 24 Oct 04, 2022
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

Yuvraj Singh Deora 3 Jan 14, 2022
An automated Risk Management Monitor Bot for ByBit cryptocurrencies exchange.

An automated Risk Management Monitor Bot for ByBit cryptocurrencies exchange that forces all open positions to adhere to a specific risk ratio, defined per asset. It supports USDT Perpetual, Inverse

Hadi Aladdin 25 Nov 27, 2022
Simple crypto & blockchain implementation written in Python

JaamoCoin - simple Python blockchain example This is a very simple blockchain example written in Python. Based on this tutorial: https://medium.com/co

Jaakko Alajoki 1 Jan 07, 2022
Python repo to create blockchain CSVs

staketaxcsv Python repo to create blockchain CSVs for Terra (LUNA), Solana (SOL), and Cosmos (ATOM). CSV codebase for stake.tax Community contribution

187 Dec 31, 2022