Skip to content

Instantly share code, notes, and snippets.

View mingderwang's full-sized avatar
:bowtie:
On chain, building L2

Ming-der Wang mingderwang

:bowtie:
On chain, building L2
View GitHub Profile
@mingderwang
mingderwang / createContract.js
Created January 6, 2017 10:27 — forked from frozeman/createContract.js
Deploy contracts on Ethereum and reliable get the contract address
// -> Soldity
// **********
// Your Soldity contract
event Created(bytes32 indexed identifier);
contract MyContract {
function MyContract(bytes32 identifier) {
Created(identifier);
}
@mingderwang
mingderwang / Untitled
Created December 11, 2016 10:07 — forked from anonymous/Untitled
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity/#version=soljson-latest.js&optimize=undefined&gist=
pragma solidity ^0.4.2
;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
@mingderwang
mingderwang / deploy.rb
Created July 28, 2016 10:18 — forked from bkutil/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
after "deploy:restart_workers", "deploy:restart_scheduler"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
@mingderwang
mingderwang / Untitled
Created July 3, 2016 07:12 — forked from anonymous/Untitled
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-latest.js&optimize=undefined&gist=
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
uint voteCount;
/*
This file is part of the DAO.
The DAO is free software: you can redistribute it and/or modify
it under the terms of the GNU lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The DAO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@mingderwang
mingderwang / elasticsearch.yml
Created June 3, 2016 14:14 — forked from reyjrar/elasticsearch.yml
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@mingderwang
mingderwang / runGeth.txt
Last active March 13, 2016 14:03
Geth install
geth install: https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum
________________________________________________________
create network:
______________
geth --datadir="/home/mwang/gethprivate/datadir" -verbosity 1 --port 30301 --networkid "25" --rpc --rpcport 8101 --genesis /home/yann/gethprivate/genesis/testgenesis.json --ipcpath <IPCPATH> console
genesis.json: https://gist.githubusercontent.com/mingderwang/0653ffa6f44f143bf7c2/raw/6bcfedeccbd587e3f43fac6d5ae86a4a2fd3b272/genesis.json
_____________
<IPCPATH>:
OSX: <HOME>/Library/Ethereum/geth.ipc
Linux: <HOME>/.ethereum/geth.ipc
{
"nonce": "0x0000000000000042",
"difficulty": "0x131415",
"alloc": {
"5fa096458cac206b8b5a5f6f6b0ee1449c839ebd": {
"balance": "9337000000000000000000"
}
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
eth allows to create custom/private blockchain by using several options:
--private defines the name of the custom chain (optional).
--config <filename>
<filename> contains a JSON description of the network:
- sealEngine (engine use to mine block)
- params (general network information like minGasLimit, minimumDifficulty, blockReward, networkID)
- genesis (genesis block description)
- accounts (setup an original state that contains accounts/contracts)
@mingderwang
mingderwang / __readme.markdown
Created January 3, 2016 04:36 — forked from apai4/__readme.markdown
ElasticSearch bootstrap script and node configuration for Ubuntu [https://gist.github.com/2050769]

Installing ElasticSearch with Monit & nginx

This repository contains files tailored for bootstrapping, installing and configuring ElasticSearch with Chef Solo on the Ubuntu operating system, inspired by this article.

Launch and ssh into Ubuntu 12.04 instance (if on ec2, use ami from alestic.com and with a security group as detailed here)

Now, copy the files to the machine and execute the bootstrap script: