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 {Constant} from "ergo-lib-wasm-browser" | |
import JSONBigInt from "json-bigint" | |
const JSONBI = JSONBigInt({useNativeBigInt: true}) | |
type SigmaRust = typeof import("ergo-lib-wasm-browser") | |
class Module { | |
_ergo?: SigmaRust |
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
from flask_api import FlaskAPI | |
app = FlaskAPI(__name__) | |
@app.route("/bootSettings") | |
def get_boot_settings(): | |
return {'noPremineProof': ['proof1', 'proof2'], | |
'genesisStateDigestHex': 'cb63aa99a3060f341781d8662b58bf18b9ad258db4fe88d09f8f71cb668cad4502'} |
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 | |
import secrets | |
if __name__ == '__main__': | |
secret_hex = secrets.token_bytes(32).hex() | |
h_secret = hashlib.blake2b(secret_hex.encode('utf8'), digest_size=32) | |
print('Secret: \n{}\nHashed secret: \n{}'.format(secret_hex, h_secret.hexdigest())) |
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 numpy as np | |
# sigmoid function | |
def nonlin(x): | |
return 1 / (1 + np.exp(-x)) | |
# sigmoid derivative | |
def noniln_deriv(x): |
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 argparse | |
import requests | |
import json | |
def load_source(path): | |
with open(path, "r") as file: | |
return file.read() |
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 secrets | |
if __name__ == '__main__': | |
secret = secrets.token_bytes(32) | |
print('Seed: \n{}'.format(secret.hex())) |
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 argparse | |
import yaml | |
import requests | |
import psycopg2 | |
INFO_ROUTE = "/info" | |
ADDR_ROUTE = "/wallet/addresses" |