Skip to content

Instantly share code, notes, and snippets.

View bitgord's full-sized avatar

Michael Gord bitgord

View GitHub Profile
`"use strict"`
const keythereum = require('keythereum')
const c = console
// private key from bitcoin
let privateKey = "10f2fb3aaac742b2f6c2a0a830d5330846633c8a139696cca2c0e379944f62b2"
let password = "bla"
// ---
`"use strict"`
const keythereum = require('keythereum')
const c = console
// private key from bitcoin
let privateKey = "10f2fb3aaac742b2f6c2a0a830d5330846633c8a139696cca2c0e379944f62b2"
let password = "bla"
// ---
@bitgord
bitgord / dockerfile
Last active March 2, 2017 09:45
Dockerfile-wallet
# Set one or more individual labels
LABEL com.example.version="0.0.1-beta"
LABEL vendor="microjasa"
LABEL com.example.release-date="2017-03-02"
LABEL com.example.version.is-production=""
FROM ubuntu
FROM michaelgord/microjasa-wallet:latest
RUN apt-get update && apt-get install -y nodejs
CMD echo "pulling node."
@bitgord
bitgord / bitcoind-wallets
Created January 13, 2017 01:30
An overview of wallets in bitcoind with bitcoin-cli
// This walkthrough assumes you have successfully downloaded bitcoind and connected to bitcoind daemon
// First we create a wallet backup file and then restore the wallet from the backup file
// Use the backupwallet command to back up your wallet with the filename as the parameter
// Here the wallet is backed up to the file wallet.backup
bitcoin-cli backupwallet wallet.backup
// Now you can import the backup file
bitcoin-cli importwallet wallet.backup
@bitgord
bitgord / connect-bitcoind
Last active January 12, 2017 22:22
Connect to Bitcoind in your terminal
// This gist assumes you have already setup bitcoind
// If you have not you can go to that walkthrough here https://gist.github.com/bitgord/88547c580139d7629dd103ec923adc0a
// When you first run bitcoind you get an arror message that requires a username and password
// create a new file in the bitcoin directory called bitcoin.conf and add a username and password
rpcuser=username
rpcpassword=1234
// While you are configuring the file you can add other customizations
// View the customizations with the help command
@bitgord
bitgord / setup-bitcoind
Last active January 12, 2017 21:52
Quick setup of bitcoin-d
// Clone the repo into your terminal
git clone https://github.com/bitcoin/bitcoin.git
// Change directory into the new folder
cd bitcoin
// Checkout the versions
git tag
// Read the docs in the ReadME and read the build docs
@bitgord
bitgord / sol-wallet
Last active February 16, 2023 12:50
Wallet Smart Contract Using Solidity
contract SimpleWallet {
// address is the owner
address owner;
struct WithdrawlStruct {
address to;
uint amount;
}
@bitgord
bitgord / Ethereum-Private-Network
Created January 2, 2017 18:46
Create a private network on Ethereum using CLI / Go-Ethereum
First look at the documentation on the Ethereum Go Github.
https://github.com/ethereum/go-ethereum
You will find a section with <code>init</code> and on "Operating a Private Network. In that section is
an example genesis.json file, also pasted below. You can change these parameters however you want.
I suggest that you make a random nonce to avoid people connecting to your private chain. The alloc
object is the prefund accounts with tokens.
{
"coinbase" : "0x0000000000000000000000000000000000000000",
@bitgord
bitgord / Mongo-Arrays-Embedded-Data
Last active December 13, 2016 05:45
Intro to MongoDB Arrays and Embedded Data
// From mongo shell run this to insert
db.customers.insert({
first_name: 'Test',
last_name: 'Testlast',
age: '32',
address: {
street: '111 street',
city: 'Toronto',
province: 'ON',
},
@bitgord
bitgord / Quick-Mongo-Setup-CRUD-Syntax
Last active December 13, 2016 05:30
Quick Mongo Setup and CRUD Syntax
// Start Mongod // From terminal run mongod
// start mongo shell // from terminal run mongo
// Create a new Collection
db.createCollection('[[name]]')
// Create a User
db.createUser( { "user" : "[[name]]",
"pwd": "[[password]]" } )