NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception
# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
# Generate the private and public keys | |
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > key | |
# Extract the public key and remove the EC prefix 0x04 | |
cat key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub | |
# Extract the private key and remove the leading zero byte | |
cat key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv | |
# Generate the hash and take the address part |
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"net/mail" | |
"net/smtp" | |
"crypto/tls" | |
) |
# Open Terminal | |
vim ~/.vimrc | |
# Mac OS-X -> .vimrc ; Window -> .gvimrc | |
# Add it in the file and adjust the font size (h12) accordingly | |
set guifont=Menlo\ Regular:h15 |
[program:caddy] | |
command=/usr/bin/caddy -conf="/etc/caddy/Caddyfile" | |
autostart=true | |
autorestart=true | |
startsecs=10 | |
stdout_logfile=/var/log/caddy.log | |
stdout_logfile_maxbytes=1MB | |
stdout_logfile_backups=10 | |
stdout_capture_maxbytes=1MB | |
stderr_logfile=/var/log/caddy_error.log |
contract random { | |
/* Generates a random number from 0 to 100 based on the last block hash */ | |
function randomGen(uint seed) constant returns (uint randomNumber) { | |
return(uint(sha3(block.blockhash(block.number-1), seed ))%100); | |
} | |
/* generates a number from 0 to 2^n based on the last n blocks */ | |
function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) { | |
uint n = 0; | |
for (uint i = 0; i < size; i++){ |
// Parsing arbitrary JSON using interfaces in Go | |
// Demonstrates how to parse JSON with abritrary key names | |
// See https://blog.golang.org/json-and-go for more info on generic JSON parsing | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) |
package main | |
import ( | |
"net/http" | |
"os" | |
"bytes" | |
"path" | |
"path/filepath" | |
"mime/multipart" | |
"io" |
NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception
# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" |
#include <string.h> | |
#include <sys/time.h> | |
#include <iostream> | |
#include <openssl/sha.h> | |
#include <openssl/rand.h> | |
#include "secp256k1/src/hash_impl.h" | |
#include "cryptopp/sha.h" | |
static const size_t NUM_RUNS = 300000UL; |