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": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": "s3:*", | |
| "Resource": [ | |
| "arn:aws:s3:::BUCKET_NAME", | |
| "arn:aws:s3:::BUCKET_NAME/*" | |
| ] |
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 Web3 = require('web3') | |
| const web3 = new Web3("http://mainnet.infura.io") | |
| const eth = web3.eth | |
| const bitcore = require('bitcore-lib') | |
| const PrivateKey = bitcore.PrivateKey | |
| const privateKey = new PrivateKey() | |
| eth.accounts.privateKeyToAccount(`0x${privateKey.toString()}`) |
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
| 1 - alt1 | |
| 2 - alt2 | |
| 3 - alt3 | |
| 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
| BAZ = MODULE_EXPORTS.fetch :baz | |
| module Foo | |
| bar = -> { | |
| baz = BAZ | |
| baz.() | |
| } | |
| BAR = bar | |
| end |
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 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) => { |
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 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 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 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 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 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 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
| // // 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 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
| # 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 |