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
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 05, 2023
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
Fully configurable automated python script to collect most visted pages based on google dork

Ranked pages collector Fully configurable automated python script to collect most visted pages based on google dork Usage This project is still under

Security Analyzer 9 Sep 10, 2022
Algo-burner - Burner account for the Algorand blockchain

algo-burner Burner address for Algorand's blockchain Apparently it was a problem

1 Jan 12, 2022
A lightweight encryption library in python.

XCrypt About This was initially a project to prove that I could make a strong encryption but I decided to publish it so that the internet peoples coul

Anonymous 8 Sep 10, 2022
G-Research-Crypto-Competition - Project for passing the ML exam. Dataset took from the competition on the kaggle

G-Research-Crypto-Competition Project for passing the ML exam. Dataset took from

5 Jan 09, 2022
Python binding to the Networking and Cryptography (NaCl) library

PyNaCl: Python binding to the libsodium library PyNaCl is a Python binding to libsodium, which is a fork of the Networking and Cryptography library. T

Python Cryptographic Authority 941 Jan 04, 2023
A simple python program to sign text using either the RSA or ISRSAC algorithm with GUI built using tkinter library.

Digital Signatures using ISRSAC Algorithm A simple python program to sign text using either the RSA or ISRSAC algorithm with GUI built using tkinter l

Vasu Mandhanya 3 Nov 15, 2022
Powerful Tool to encrypt and decrypt files using AES.

AEScryptor Tool Description Encrypt and Decrypt files with AES-128 (16bytes key). AES mode = CFB (cipher Feedback) security = super safe! Usage [1] Ch

5 Jan 12, 2022
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
Accounting Cycle Program with Blockchain Component

In the first iteration of my accounting cycle program, I talked about adding in a blockchain component that allows the user to verify the inegrity of

J. Brandon Walker 1 Nov 29, 2021
Privfiles - Encrypted file storage using Fernet with zero Javascript

Privfiles - Encrypted file storage using Fernet with zero Javascript Source code for the onion service: l3n6v6dm63frml22tlmzacnasvp7co7wylu4hhcs34ukxe

Ward 5 Jul 30, 2022
dashboard to track crypto prices and change via the coinmarketcap APIs

crypto-dashboard Dashboard to track crypto prices and change via the coinmarketcap APIs. Uses chart.js and ag-grid. Requirements: python 3 (was writte

4 Nov 09, 2021
High Performance Blockchain Deserializer

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

Congyu 2 Dec 28, 2021
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
Certbot is EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server.

Certbot is EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.

29.5k Dec 31, 2022
Retrieve ECDSA signature R,S,Z values from blockchain rawtx or txid.

rsz Retrieve ECDSA signature R,S,Z values from blockchain rawtx or txid. Info The script parse the data of rawtx to fetch all the inputs in the transa

iceland 29 Nov 18, 2022
Tracking (of choice) cryptocurrencies' daily prices and moving average.

Crypto-price-moving_average Tracking (of choice) cryptocurrencies' daily prices and moving average. About Alpha Vantage The Alpha Vantage library (htt

Thong Huynh 2 Jan 22, 2022
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 Ether

Rahul raikwar 5 Jan 28, 2022
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

Loïk Mallat 1 Nov 16, 2021