Skip to content

Instantly share code, notes, and snippets.

View tyler-smith's full-sized avatar

Tyler Smith tyler-smith

View GitHub Profile
@tyler-smith
tyler-smith / tree.go
Created July 2, 2019 20:15
Fake `tree` command for scam baiting
package main
import "fmt"
func main() {
fmt.Println("No hackers found. System security at 100%.")
}
@tyler-smith
tyler-smith / ecmh_inclusion_proof.go
Created June 20, 2019 05:09
Simple ECMH inclusion proof
package main
import (
"fmt"
"github.com/gcash/bchd/bchec"
)
func main() {
// Create set (1, 2, 3)
set := bchec.NewMultiset(bchec.S256())
@tyler-smith
tyler-smith / openbazaar.conf
Created January 12, 2019 01:13
OpenBazaar systemd example
[program:openbazaar]
command=/opt/openbazaar/bin/openbazaard start -v
autostart=true
autorestart=true
user=openbazaar
stderr_logfile=/var/log/openbazaar/error.log
stdout_logfile=/var/log/openbazaar/stdout.log
stdout_logfile_maxbytes=100MB
stderr_logfile_maxbytes=100MB
stdout_logfile_backups=7

Basic simulation of Avalanche based pre-concensus. It creates 100 nodes and 1k transactions. Each node queries the others until it has finalized every transaction.

Example output:

> go run ./basic-preconcensus.go --logging
...
Finalized tx 19 on node 99 after 134 queries
Finalized tx 6 on node 99 after 134 queries
Finalized tx 58 on node 99 after 134 queries
Finished in 2.881907s
@tyler-smith
tyler-smith / main.go
Created December 15, 2018 17:50
Convert to Cashaddr
// Put addresses in addrs.txt file in the directory you run this program from
// It will convert them to cashaddr and write them to stdout
package main
import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
@tyler-smith
tyler-smith / README.md
Last active November 6, 2018 17:13
Bitprim Cluster Guide

TODO:

  • Add config to put blockchain data on EBS

Overview

Steps to create a Bitprim cluster. The architecture will be 2 tiered: a BCH node tier and an API server tier. Both tiers are instances of a Bitprim server but with different configuration files.

Installation

@tyler-smith
tyler-smith / install.sh
Created November 6, 2018 02:49
ZCash Insight
apt install -y libzmq3-dev build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget curl bsdmainutils automake
git clone https://github.com/zcash/zcash.git
cd zcash
git checkout v2.0.1
./zcutil/fetch-params.sh
./zcutil/build.sh -j$(nproc)
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
nvm install v4
@tyler-smith
tyler-smith / Dockerfile
Created October 30, 2018 05:47
bchd dnsseeder optimized Dockerfile
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM golang
LABEL maintainer="Josh Ellithorpe <[email protected]>"
WORKDIR /go/src/github.com/gcash/dnsseeder
# Install dep
RUN go get -u github.com/golang/dep/cmd/dep
# Copy the local package files to the container's workspace.

Server:

  • Install Go: https://github.com/golang/go/wiki/Ubuntu
  • Install openbazaar-go: go get -u github.com/OpenBazaar/openbazaar-go
  • Go to openbazaar-go directory: cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go
  • Run: go run openbazaard.go start -v
    • Takes a bit on first startup
    • You should see something like this:
________                      __________