Skip to content

Instantly share code, notes, and snippets.

View CowboyJim's full-sized avatar

Jim Boone CowboyJim

  • Huntersville, NC
View GitHub Profile
@CowboyJim
CowboyJim / enode.sh
Created May 18, 2017 13:13
Script to retrieve enode values
#!/bin/bash
out_file="static-nodes.json"
echo "[" > $out_file
for (( x=1; x<=4; x++ ))
do
cmd=`geth --exec 'admin.nodeInfo.enode' attach http://localhost:810$x`
echo $cmd>>$out_file
if [ $x -lt 4 ]; then
@CowboyJim
CowboyJim / static-nodes.json
Created May 18, 2017 13:11
Etherum bootnode file
[
"enode://1c00499646a30da44c73f056cab78d9e1b4c0102148a33a397940d57bd5c6c80175fdcaf2ab4f6cc789251e811ce713514d9a8f398beca4b406146fbf0054d28@[::]:30301?discport=0"
,
"enode://d3fe6721e482a52d794316fd37f018738873dae372c6465614bf3d7b7bf8aa7f49758e81945400383adaba6db0350d719db5a4d1b765fc320b5d30bf48867373@[::]:30302?discport=0"
,
"enode://1f3ebf228ac30fec6a84e9e0558fd009d90c1342f91ca392f3d2cedf038ef948f3887d9f8c982d379cdb1268d19989cdab5247fcf2b2d7bd5c42cd8e6c54ab83@[::]:30303?discport=0"
,
"enode://5300aba9b29bbd37409cec4446a41eb80dd95a95473cf7b7a8a9157626c7c78f7819dadf3108e42b60264b61aafcd4e232c955b072577ba6d8ff5bdd503b12c0@[::]:30304?discport=0"
]
@CowboyJim
CowboyJim / start_bc_network.py
Last active April 2, 2018 17:50
Create and start Ethereum blockchain network
#!/usr/bin/env python
"""
Simple script that creates a four node Ethereum private blockchain
network using the geth client. Please adjust the script constants
to match your environment.
"""
import sys
from subprocess import call
import os.path
import time
{
"nonce": "0x0000000000000042",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "Custom Genesis Block",
"gasLimit": "0x8000000",
"difficulty": "0x0100",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": {
@CowboyJim
CowboyJim / AliasDirectoryTest.js
Created January 31, 2017 15:16
Payment Directory Distributed Unit Test
contract('AliasDirectoryContract', function (accounts) {
// Note: account[0] is the contract owner
var authorizedBank = accounts[1];
var unauthorizedBank = accounts[2];
var directory;
// Grap a reference to the directory contract and add an authorized user prior to the tests
before("Add authorized bank and user", function () {
@CowboyJim
CowboyJim / AliasDirectoryContract.sol
Created January 31, 2017 15:13
Payment Directory Distributed Contract
pragma solidity ^0.4.2;
/// @title Simple Alias Directory
/// @author Jim Boone
/*
Demonstration payment alias directory distributed application
solidity contract
jim.boone@levvel.io
Copyright: Levvel, LLC
@CowboyJim
CowboyJim / alias_record.json
Last active February 17, 2017 19:19
Payment Directory Distributed Application Code
{
"Banks": {
"0xdbfc61a3657fc9c70356bc93d54e4a23081b0d24": {
"name": "National Bank",
"routing": "026005092"
},
"0x808e096baf29663de55fb8f7b2c23b3cf8f176dd": {
"name": "Pine Tree Bank",
"routing": "053000196"
}