This file contains hidden or 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
#!/bin/bash | |
# Configuration | |
SERVICE_URL="http://127.0.0.1:3000" | |
LOG_FILE="/var/log/nodejs-health.log" | |
WARNING_FILE="/var/log/nodejs-warnings.log" | |
# Function to log messages | |
log_message() { | |
local timestamp=$(date '+%Y-%m-%d %H:%M:%S') |
This file contains hidden or 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
#!/bin/bash | |
# setup.sh - Main setup script | |
exec > >(tee /var/log/setup.log) 2>&1 | |
echo "Starting Node.js application setup..." | |
# Update system and install dependencies | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y netcat-openbsd mysql-client |
This file contains hidden or 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.1" | |
# Our containers | |
services: | |
# Temporary container used to initialize the replica set | |
mongo-setup: | |
container_name: mongo-setup | |
image: mongo | |
restart: on-failure | |
networks: |
This file contains hidden or 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
{ | |
"genesis": { | |
"config": { | |
"chainId": 14333, | |
"berlinBlock": 0, | |
"ibft2": { | |
"blockperiodseconds": 2, | |
"epochlength": 30000, | |
"requesttimeoutseconds": 4 | |
} |
This file contains hidden or 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
pragma circom 2.0.0; | |
include "/usr/local/lib/node_modules/circomlib/circuits/comparators.circom"; | |
template FactorCircuit() { | |
signal input a; | |
signal output isFactor; | |
// Constraint to ensure that a are factors of 9 | |
signal temp; |
This file contains hidden or 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
CONTRACT_ADDRESS_BDTOKEN=0x389cACE1478ad58245c04BE6ae47b9EdC7881515 | |
Validator1_pubkey=0x8F1f90DCf24b532e3580998E78fdc5224f94307E | |
Validator1_privkey="12c97ce3557d01b69b4a7398a2ae8fa0b52181392fa52b8ba90905c2f1336234" | |
SIGNER=0xf2F4E1205B7Ac806847D7F50FbFed8469656688B | |
PKEY="c506cbbc39ff6ceb48c9d42d46026f2fb87a596232f7cf90c240478dbc14fd31" |
This file contains hidden or 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
#!python3 | |
import hashlib | |
import math | |
import sys | |
from base64 import b64decode, b64encode | |
prooffile = "proof.txt" # File where Merkle proof will be written. | |
MAXHEIGHT = 20 # Max height of Merkle tree |
This file contains hidden or 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 fetchLatestBlock = () => | |
fetch(`https://blockchain.info/q/latesthash?cors=true`) | |
.then(r => r.text()); | |
const fetchMerkleRootAndTransactions = block => | |
fetch(`https://blockchain.info/rawblock/${block}?cors=true`) | |
.then(r => r.json()) | |
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]); | |
const random = arr => |
This file contains hidden or 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
mkdir node1 node2 | |
geth account new --datadir ./node1 | |
geth account new --datadir ./node2 | |
puppeth | |
export mytestnet.json | |
geth init --datadir "./node1" mytestnet.json |
This file contains hidden or 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
# Copyright 2018-2020 Cargill Incorporated | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
NewerOlder