Skip to content

Instantly share code, notes, and snippets.

View zelig's full-sized avatar

Viktor Trón zelig

View GitHub Profile
@zelig
zelig / gist:6a3dad0babaf1cbabf33
Last active September 30, 2015 18:30
Swarm. Abstract for talk on DEVCON ONE
Swarm is a distributed storage platform and content distribution service, a native base layer service of the ethereum web 3 stack. The primary objective of Swarm is to provide a sufficiently decentralized and redundant store of Ethereum's public record, in particular to store and distribute Đapp code and data as well as block chain data. From an economic point of view, it allows participants to efficiently pool their storage and bandwidth resources in order to provide the aforementioned services to all participants.
From the end user's perspective, Swarm is not that different from WWW, except that uploads are not to a specific server. The objective is to peer-to-peer storage and serving solution that is DDOS-resistant, zero-downtime, fault-tolerant and censorship-resistant as well as self-sustaining due to a built-in incentive system which uses peer to peer accounting and allows trading resources for payment. Swarm is designed to deeply integrate with the devp2p multiprotocol network layer of Ethereum as wel
@zelig
zelig / gist:f38d32012886836c9db5
Created June 21, 2015 01:53
gpuminer crash 1
~/go/src/github.com/ethereum/go-ethereum$ sudo ./geth --minegpu --gpuchunks --verbosity 6 -etherbase d5439940eba22e4b29fb4b6590356040e44249d6 console 2>geth.log
=========== OpenCL initialisation ===========
> Platform AMD Accelerated Parallel Processing
Platform Vendor Advanced Micro Devices, Inc.
Platform Version OpenCL 1.2 AMD-APP (1445.5)
Platform Extensions cl_khr_icd cl_amd_event_callback cl_amd_offline_devices cl_amd_hsa
Platform Profile FULL_PROFILE
Selected device Hawaii
Vendor Advanced Micro Devices, Inc.
@zelig
zelig / gist:85cc18ce1e373d0ee7ab
Created May 18, 2015 20:52
GPU mining on MacOS. Tried on MacBook Pro Retina with NVIDIA GeForce GT750M. Only reaches a max of 700-900 KH/s which is only 0-15% better than CPU on 8 cores
wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.29_mac.pkg
sudo installer -pkg cuda_7.0.29_mac.pkg -target /
// once cpp-ethereum 0.9.23 is released on homebrew you do not need to build from source
brew update
brew tap ethereum/ethereum
brew reinstall cpp-ethereum --with-gpu-mining --devel --build-from-source
// or build from source:
// cd cpp-ethereum
// cmake -DETHASHCL=1 -DGUI=0
// make -j8
nirname-0 (err): at Object.<anonymous> (/Users/tron/Work/ethereum/eth-net-intelligence-api/lib/utils/logger.js:4:13)
nirname-0 (err): at Module._compile (module.js:460:26)
nirname-0 (err): at Object.Module._extensions..js (module.js:478:10)
nirname-0 (err): at Module.load (module.js:355:32)
nirname-0 (err): at Function.Module._load (module.js:310:12)
nirname-0 (err): at Module.require (module.js:365:17)
nirname-0 (err): 2015-05-10 12:03 +02:00: module.js:338
nirname-0 (err): throw err;
nirname-0 (err): ^
nirname-0 (err): Error: Cannot find module 'chalk'
@zelig
zelig / gist:f923f2e65ee8523a97ce
Created May 9, 2015 03:58
miner send on closed channel
panic: send on closed channel
goroutine 41 [running]:
github.com/ethereum/go-ethereum/miner.(*worker).push(0xc20803ec30)
/Users/tron/Work/ethereum/go/src/github.com/ethereum/go-ethereum/miner/worker.go:218 +0x271
github.com/ethereum/go-ethereum/miner.(*worker).commitNewWork(0xc20803ec30)
/Users/tron/Work/ethereum/go/src/github.com/ethereum/go-ethereum/miner/worker.go:337 +0x8e6
github.com/ethereum/go-ethereum/miner.(*worker).update(0xc20803ec30)
/Users/tron/Work/ethereum/go/src/github.com/ethereum/go-ethereum/miner/worker.go:160 +0x364
@zelig
zelig / gist:74ad2237e31ade2734bd
Created May 7, 2015 06:46
trace after stalled mining
SIGQUIT: quit
PC=0x407069b
goroutine 0 [idle]:
runtime.mach_semaphore_wait(0x1403, 0x0, 0x403d5c9, 0x4060c1a, 0x4403, 0x403da83, 0xc2295f4000, 0x406d83a, 0x4061560, 0x7fff5fbff050, ...)
/usr/local/Cellar/go/1.4.1/libexec/src/runtime/sys_darwin_amd64.s:412 +0xb
semasleep()
/usr/local/Cellar/go/1.4.1/libexec/src/runtime/os_darwin.c:438 +0x16c
runtime.onM(0x7fff5fbff050)
/usr/local/Cellar/go/1.4.1/libexec/src/runtime/asm_amd64.s:273 +0x9a
@zelig
zelig / gist:21ac8eada617e56866d8
Created May 4, 2015 21:08
advancing blockchain on a private test network
// assume an existing unlocked primary account
primary = eth.accounts[0];
// mine 10 blocks to generate ether
admin.miner.start();
admin.debug.waitForBlocks(eth.blockNumber+10);
admin.miner.stop() ;
balance = web3.fromWei(eth.getBalance(primary), "ether");
@zelig
zelig / gist:4dbe653092307527d8c8
Created April 29, 2015 17:51
rm -rf ~/tmp/thu*; ./geth --networkid 3301 --maxpeers 0 --datadir ~/tmp/thu/ --loglevel 6 --logtostderr --logfile /dev/null --password <(echo -n 'y') account new; ./geth --networkid 3301 --maxpeers 0 --datadir ~/tmp/thu/ --loglevel 6 --logtostderr --logfile /dev/null --vmdebug --password <(echo -n 'y') --unlock primary js demo.js 2>> ~/tmp/thu.log
admin.miner.start();
admin.debug.waitForBlocks(eth.blockNumber+5);
admin.miner.stop() ;
primary = eth.accounts[0];
console.log("primary: "+primary);
balance = web3.fromWei(eth.getBalance(primary), "ether");
console.log("balance: "+balance);
primary = eth.accounts[0];
web3.fromWei(eth.getBalance(primary), "ether");
admin.contractInfo.newRegistry(primary)
source = "contract test {\n" +
" /// @notice will multiply `a` by 7.\n" +
" function multiply(uint a) returns(uint d) {\n" +
" a * 7;\n" +
I0420 15:19:54.003781 12481 vm.go:898] (pc) 0 -o- PUSH1 (m) 0 (s) 0 (g) 3 (178536) => 0x00
I0420 15:19:54.003793 12481 vm.go:898] (pc) 2 -o- PUSH2 (m) 0 (s) 1 (g) 3 (178533) => 0x0c9f
I0420 15:19:54.003829 12481 vm.go:898] (pc) 5 -o- MSTORE8 (m) 0 (s) 2 (g) 325 (178530) => [3231] 0x0
I0420 15:19:54.003846 12481 vm.go:898] (pc) 6 -o- PUSH29 (m) 3232 (s) 0 (g) 3 (178205) => 0x0100000000000000000000000000000000000000000000000000000000
I0420 15:19:54.003855 12481 vm.go:898] (pc) 36 -o- PUSH1 (m) 3232 (s) 1 (g) 3 (178202) => 0x00
I0420 15:19:54.003870 12481 vm.go:898] (pc) 38 -o- CALLDATALOAD (m) 3232 (s) 2 (g) 3 (178199) => 0x06675a5100000000000000000000000000000000000000000000000000000000
I0420 15:19:54.003887 12481 vm.go:898] (pc) 39 -o- DIV (m) 3232 (s) 2 (g) 5 (178196) 2896485680098663106129717099773470428322051271395333032937648160491175936000 / 2695994666715063979466701508701963067363714