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
# example usage: | |
# bash <(curl -s https://gist.githubusercontent.com/makevoid/.../raw/.../install-ruby-2.6-debian.sh) | |
# bash <(curl -s https://gist.githubusercontent.com/makevoid/5920d782ea4ae28f29b7b137e3399499/raw/d5275487d1dcd3c838178d8bff9cf7660a011ec8/install-ruby-2.3-debian.sh) | |
set -xe | |
apt update -y | |
apt-get install -y ruby-full | |
gem i bundler |
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
# example usage: | |
# bash <(curl -s https://gist.githubusercontent.com/makevoid/05824727e45adde87672ae9787524433/raw/5c53711d582c849f8a1f9c33675a78ab34878dee/install-ruby-2.5-ubuntu.sh) | |
set -xe | |
apt-add-repository ppa:brightbox/ruby-ng | |
apt update -y | |
apt install -y ruby2.6 ruby2.6-dev |
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 ubuntu:cosmic as ruby | |
RUN apt update -y | |
RUN apt install -y ruby-dev git | |
RUN gem i bundler | |
FROM ruby as ruby-build | |
RUN apt install -y build-essential |
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
curl --user bitcoin:PASSWORD --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://localhost:8332/ |
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
# bash <(curl -s https://gist.githubusercontent.com/makevoid/0ace4d915b37a3e57a7aead6397525c9/raw/1fe13cbb52a3068f8d9b4e05f8fd306d1d2714ce/install_latest_node.js) | |
set -xe | |
sudo apt-get update -y | |
sudo apt-get install -y curl apt-transport-https ca-certificates | |
curl --fail -ssL -o setup-nodejs https://deb.nodesource.com/setup_10.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
// // package.json | |
// { | |
// "dependencies": { | |
// "bitcoincashjs": "^0.1.10", | |
// "bitcore-explorers": "^1.0.1", | |
// } | |
// } | |
const fs = require('fs') | |
const bitcoin = require('bitcoincashjs') // npm i bitcoincashjs --save | |
// ( see https://bitcore.io/api/lib for docs ) |
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 Insight = require("insight-client") | |
const insightHost = "https://blockdozer.com/insight-api" | |
const insight = new Insight(insightHost) | |
const addrInfo = () => { | |
return new Promise((resolve, reject) => { | |
insight.addr(address, (err, data) => { | |
if (err) { reject(err); return } |
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 bitcoin = require('bitcoincashjs') // npm i bitcoincashjs --save | |
// ( see https://bitcore.io/api/lib for docs ) | |
// // generate and save private key | |
// const pvt = new bitcoin.PrivateKey() | |
// console.log(pvt.toString('hex')) | |
const privateKeyString = fs.readFileSync('./private-key.txt').toString().trim() | |
const privateKey = new bitcoin.PrivateKey(privateKeyString) |
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 CoreClient = require('bitcoin-core') // npm i --save bitcoinc-re | |
const host = '127.0.0.1' // ssh -L 8332:localhost:8332 root@YOUR_SERVER_IP -N # (ssh tunnel) | |
const core = new CoreClient({ // you have to | |
host: host, | |
username: 'bitcoin', | |
password: "PASSWORD", | |
}) |
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 zmq = require('zeromq') | |
const BitcoinCashZMQDecoder = require('bitcoincash-zmq-decoder') | |
const decoder = new BitcoinCashZMQDecoder("mainnet") | |
const subscriber = zmq.socket("sub") | |
const host = 'tcp://34.245.188.100:28332' | |
subscriber.subscribe("") // subscribe to all | |
const parseTransaction = (data) => { |