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
#!/bin/bash | |
CURRENT_BLOCK="$(bitcoin-cli getblockcount)" | |
CURRENT_BLOCK_HASH="$(bitcoin-cli getblockhash $CURRENT_BLOCK)" | |
CURRENT_BLOCK_TIME="$(bitcoin-cli getblock $CURRENT_BLOCK_HASH | jq '.mediantime')" | |
HALVING_BLOCK="$(((($CURRENT_BLOCK/210000)+1)*210000))" | |
BLOCK_DELTA="$(($HALVING_BLOCK-$CURRENT_BLOCK))" | |
PREVIOUS_BLOCK="$(($CURRENT_BLOCK-$BLOCK_DELTA))" | |
PREVIOUS_BLOCK_HASH="$(bitcoin-cli getblockhash $PREVIOUS_BLOCK)" | |
PREVIOUS_BLOCK_TIME="$(bitcoin-cli getblock $PREVIOUS_BLOCK_HASH | jq '.mediantime')" | |
DELTA_TIME="$(($CURRENT_BLOCK_TIME-$PREVIOUS_BLOCK_TIME))" |
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 org.bitcoinj.core.*; | |
import org.bitcoinj.crypto.*; | |
import org.bitcoinj.params.*; | |
import org.bitcoinj.script.*; | |
import org.junit.*; | |
public class BitcoinJTest | |
{ | |
private static NetworkParameters params = MainNetParams.get(); |
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
# first boot | |
ssh root@odroid | |
# dependencies | |
apt-get update | |
apt-get full-upgrade | |
apt-get install fswatch jq rsync curl python3 python3-pip | |
apt autoremove | |
# swapfile |
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
bitcoin-cli getrawtransaction 54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713 | sed 's/0100000000000000/\n/g' | tail -n +2 | cut -c7-136,139-268,271-400 | tr -d '\n' | cut -c17-368600 | xxd -p -r > bitcoin.pdf |
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
Eligius<5Benedictus Iesus in sanctissimo altaris Sacramento. | |
Eligius5<Benedictus Deus in Angelis suis, et in Sanctis suis. Amen. | |
Eligius%ZLTO my God, I am heartily sorry for having offended Thee and I detest all my sins... | |
EligiusLS...because of Thy just punishments, but most of all because they offend Thee, ... | |
EligiusA;...my God, who art all good and deserving of all my love. | |
Eligius(AI firmly resolve, with the help of Thy grace, to sin no more... | |
EligiusD/...and avoid the near occasions of sin. Amen. | |
EligiusLOO my God! I firmly believe that Thou art one God in three Divine persons, ... | |
EligiusELO...Father, Son, and Holy Ghost; I believe that Thy Divine Son became man, ... | |
Eligiusr;LT...and died for our sins, and that he will come to, judge the living and the dead. |
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
#!/bin/bash | |
HEIGHT=$(bitcoin-cli getblockcount) | |
echo "$HEIGHT" | |
for ((i=1; i<=$HEIGHT; i++ )) | |
do | |
COINBASE=$(bitcoin-cli decoderawtransaction $(bitcoin-cli getrawtransaction $(bitcoin-cli getblock $(bitcoin-cli getblockhash $i) | jq -r '.tx[0]')) | jq -r '.vin[0].coinbase' | xxd -r -p | tr -cd '[:print:]') | |
echo "$COINBASE" |
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 fs = require('fs'); | |
const readline = require('readline'); | |
var english = fs.readFileSync('english.txt', 'utf8').split("\n") | |
const readInterface = readline.createInterface({ | |
input: fs.createReadStream('coinbase.txt'), | |
console: false | |
}); |
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 fs = require('fs'); | |
// Fill in your own node alias | |
const NAME = '<nodealias>'; | |
console.log('start'); | |
// lncli describegraph > graph.json | |
var graph = JSON.parse(fs.readFileSync('graph.json')); | |
// https://bos.lightning.jorijn.com/data/export.json |
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
#!/bin/bash | |
BLOCKCHAININFO=$(bitcoin-cli getblockchaininfo) | |
BLOCKS=$(echo "$BLOCKCHAININFO" | jq .blocks) | |
TAPROOT=$(echo "$BLOCKCHAININFO" | jq .softforks.taproot.bip9) | |
SINCE=$(echo "$TAPROOT" | jq .since) | |
PERIOD=$(echo "$TAPROOT" | jq .statistics.period) | |
BLOCKS=$(echo "$BLOCKCHAININFO" | jq .blocks) | |
PERIOD_COUNT=$(((BLOCKS - SINCE) / PERIOD)) | |
SINCE=$((SINCE + (PERIOD * PERIOD_COUNT))) | |
ELAPSED=$(echo "$TAPROOT" | jq .statistics.elapsed) |
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
#!/bin/bash | |
CURRENT_BLOCK="$(bitcoin-cli getblockcount)" | |
CURRENT_BLOCK_HASH="$(bitcoin-cli getblockhash $CURRENT_BLOCK)" | |
CURRENT_BLOCK_TIME="$(bitcoin-cli getblock $CURRENT_BLOCK_HASH | jq '.mediantime')" | |
TAPROOT_BLOCK="$(bitcoin-cli getblockchaininfo | jq '.softforks.taproot.bip9.min_activation_height')" | |
BLOCK_DELTA="$(($TAPROOT_BLOCK-$CURRENT_BLOCK))" | |
PREVIOUS_BLOCK="$(($CURRENT_BLOCK-$BLOCK_DELTA))" | |
PREVIOUS_BLOCK_HASH="$(bitcoin-cli getblockhash $PREVIOUS_BLOCK)" | |
PREVIOUS_BLOCK_TIME="$(bitcoin-cli getblock $PREVIOUS_BLOCK_HASH | jq '.mediantime')" | |
DELTA_TIME="$(($CURRENT_BLOCK_TIME-$PREVIOUS_BLOCK_TIME))" |
OlderNewer