This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
db: | |
build: ./db | |
environment: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: test | |
restart: always | |
web: | |
build: ./web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const mysql = require("mysql"); | |
const app = express(); | |
const connection = mysql.createPool({ | |
connectionLimit: 10, | |
host: process.env.MYSQL_HOST || "localhost", | |
user: process.env.MYSQL_USER || "root", | |
password: process.env.MYSQL_PASSWORD || "password", | |
database: process.env.MYSQL_DATABASE || "test", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib, struct, codecs | |
ver = 2 | |
prev_block = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717" | |
mrkl_root = "871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a" | |
time_ = 0x53058b35 # 2014-02-20 04:57:25 | |
bits = 0x19015f53 | |
# https://en.bitcoin.it/wiki/Difficulty | |
exp = bits >> 24 |