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 app for encrypting messages with fernet cryptography.

Fernet Encryption Python app for encrypting messages with fernet cryptography. Github repo: https://github.com/mystic-repo/FernetEncryption PyPi: http

Mystic 1 May 28, 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
RSI Algorithmic Trading with Python

In this repository you can see my first algorithhmic trading script. I use 5 cryptocurrencies: Bitcoin (BTC), Ethereum (ETH), Bitcoin Cash (BCH), Litecoin (LTC) and Chainlink (LINK).

Jon Aldekoa 4 Mar 16, 2022
SDU experiment of introduction to the cryptography

Lab 01 (2 hrs): Programming Basics Program 1: Type Hint, String, Bytes, Hex, Base64 Lab 02 (4 hrs): Classical Cryptography Part 1 (3 hrs): Program 1:

1 Jan 03, 2022
Given a string or a text file with plain text , returns his encryption using SHA256 method

Encryption using SHA256 Given a string or a .txt file with plain text. Returns his encryption using SHA256 method Requirements : pip install pyperclip

yuno 3 Jan 24, 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
Using with Jupyter making live crypto currency action

Make-Live-Crypto-Currency-With-Python Using with Jupyter making live crypto currency action 1.Note: 💣 You must Create a Binance account and also clic

Mahmut Can Gönül 5 Dec 13, 2021
A crypto wallet to send bnb and ether coin using web3.py and moralis speedy node

A crypto wallet to send bnb and ether coin using web3.py and moralis speedy node

Ciscoquan 3 Aug 16, 2022
A python-jvm wrapper for interacting with the Ergo blockchain.

ergpy A python-jvm wrapper for interacting with the Ergo blockchain. Usage Requires Java 8 or higher to be installed on system pip install JPype1 pip

mgpai 16 Oct 05, 2022
Arithmos Cipher is a simple Cryptography that I created myself in Python

Arithmos Cipher is a simple Cryptography that I created myself in Python

LyQuid :3 3 Oct 19, 2022
Gridlock - Encryption and decryption python project

Gridlock Encryption Encryption and decryption of plain text messages inspired by

Matthew 2 Mar 23, 2022
Bitcoin & Lightning Container Manager for facilitating development tools

Torch-cli Bitcoin & Lightning Container Manager for facilitating development too

Gray Finance 3 Aug 22, 2022
Simple bitcoin ticker for the Pimorono Inky pHAT Red.

bitcoin-ticker Simple bitcoin ticker for the Pimorono Inky pHAT Red. Equipment Raspberry Pi Zero W v1.1 or Pi 2 model b v1.1 Pimorono Inky pHAT Red (S

2 Mar 15, 2022
Modeval (or Modular Eval) is a modular and secure string evaluation library that can be used to create custom parsers or interpreters.

modeval Modeval (or Modular Eval) is a modular and secure string evaluation library that can be used to create custom parsers or interpreters. Basic U

2 Jan 01, 2022
Cyber Security Starter Kit Platform

Cyber Security Starter Kit Platform (CSSKP) allows to instantiate new self-assessment products such as Fit4Cybersecurity, Fit4Privacy, Fit4Contract and the like.

CASES Luxembourg 3 Oct 21, 2021
A tool that can encrypt python2 or python3 code with the given password and can reuse with that password

A tool that can encrypt python2 or python3 code with the given password and can reuse with that password

Md Rasel Bhuyan 3 Feb 28, 2022
Bit is Python's fastest Bitcoin library and was designed from the beginning to feel intuitive, be effortless to use, and have readable source code.

Bit is Python's fastest Bitcoin library and was designed from the beginning to feel intuitive, be effortless to use, and have readable source code.

Ofek Lev 1.1k Jan 02, 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
Python wrapper for the Equibles cryptos API.

Equibles Cryptos API for Python Requirements. Python 2.7 and 3.4+ Installation & Usage pip install If the python package is hosted on Github, you can

Equibles 1 Feb 02, 2022
Decrypting winrm traffic using password/ntlm hash

Decrypting winrm traffic using password/ntlm hash

Haoxi Tan 9 Jan 05, 2022