This article describes a python implementation of bitcoin mining that relies on an algorithm based on a double hash SHA-256.
Introduction – Principle of the bitcoin mining agorithm
Miners on the bitcoin network should look for the nonce which is a 32-bit number. The miner will successively test several NONCEs (1,2,3 …. 10 ^ 32-1), for each of the nonce he creates the following header and hasher twice with a SHA-256 bit hash function.
Field
Description
Size
version
Version
4
Hash previous block
256-bit hash of the previous block
32
Merkle root
This is a hash on the data in the block. It is provided to the miner and it contains a summary of the transactions that are contained in the block.
32
time
A digital timestamp that represents the number of seconds since 1970-01-01T00: 00 UTC
4
bits
The current target in compacted format
4
nonce
32-bit number (starts at 0)
4
Once the hash obtained, the miner must then check that the hash obtained is lower than the target difficulty factor of the block. If the hash obtained is greater then the nonce is not the correct one, another must be tested.
Example on block 671712
If you are using a blockhain bitoin explorer (for example blocstream info), if we take for example block 671712:
In this case here is an algorithm in python which allows to mine this block:
In this simulation I display the header and the calculated hash as well as the hash rate.
The nonce to find for block 671712 was 4107802144
in hexadecimal : 0xf4d81620
This algorithm starts with a nonce = 4107802144 – 400 we will act as if we were very close to finding the block (400 double hashes are missing to find the block):
When you try to lauchn the utility sdkmanager for android SDK you get the following error : Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
To solve this error Godot status != 0x8CD5 in RasterizerGLES2 – rasterizer_gles2.cpp a way to do it is to force using OPENGL2.1 with parameter --video-driver GLES2 the complete command is :
Update Python easy update to Python 3.9 with homebrew – To update Mac os python from an older version to the latest python example python 3.9.1 you can do the folowing :
This article briefly describes how to replace its version of python on Mac. I wrote a similar article some time ago.
godot % scons
scons: Reading SConscript files ...
Automatically detected platform: osx
Building for macOS 10.12+, platform x86-64.
YASM is necessary for WebM SIMD optimizations.
WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!
Checking for C header file mntent.h... no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] Compiling ==> platform/osx/crash_handler_osx.mm
[Initial build] Compiling ==> platform/osx/os_osx.mm
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/canvas.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/canvas_occlusion.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/scene_forward.glsl.gen.h"
[Initial build] Building RD_GLSL header: "servers/rendering/renderer_rd/shaders/canvas_sdf.glsl.gen.h"
Update Python easy update to Python 3.9 with homebrew – To update Mac os python from an older version to the latest python example python 3.9.1 you can do the folowing :
This article briefly describes how to replace its version of python on Mac. I wrote a similar article some time ago.
Comment faire un ping sur Filius ? Filius est un logiciel de simulation de réseau. Ce premier article présente la création d’un réseau ad hoc entre deux ordinateurs et l’utilisation la commande ping.
Etape 1 :
Ajouter les 2 ordinateurs et les relier par un câble réseau.
Filius configuration d’un réseau de 2 ordinateurs
Etape 2 :
Configurer le nom et l’adresse IP des ordinateurs, soit “Ordinateur A” : 198.168.0.10 et “Ordinateur B” : 198.168.0.20
Etape 3 :
Démarrer et installer la ligne de commande sur l’ordinateur A en cliquant dessus.
FIlius installation de la ligne de commande sur ordinateur A
Etape 4 :
Utiliser la commande ping 192.168.0.20. Ping est une commande qui envoie des paquets réseau vers l’adresse demandée et qui mesure les temps de réponse.
minikube v1.17.1 sur Darwin 10.15.7
✨ Utilisation du pilote ssh basé sur le profil existant
👍 Démarrage du noeud de plan de contrôle minikube dans le cluster minikube
🤦 StartHost failed, but will try again: config: please provide an IP address
😿 Failed to start ssh bare metal machine. Running "minikube delete" may fix it: config: please provide an IP address
❌ Exiting due to GUEST_PROVISION: Failed to start host: config: please provide an IP address
😿 If the above advice does not help, please let us know:
👉 https://github.com/kubernetes/minikube/issues/new/choose
Solution – starthost failed, but will try again: config: please provide an ip address
If you are running with docker you will find on https://minikube.sigs.k8s.io/docs/drivers/docker/ what i have done is to delete the last minkube cluster and rerun with the command specify the docker :
minikube delete
You will get :
🔄 Désinstallation de Kubernetes v1.20.2 à l'aide de kubeadm…
🔥 Trying to delete invalid profile minikube
And then :
minikube start --driver=docker
This is working :
😄 minikube v1.17.1 sur Darwin 10.15.7
✨ Utilisation du pilote docker basé sur la configuration de l'utilisateur
👍 Démarrage du noeud de plan de contrôle minikube dans le cluster minikube
🚜 Pulling base image ...