Skip to content

Instantly share code, notes, and snippets.


Viktor Trón zelig

View GitHub Profile
zelig / chunk.go
Last active Apr 27, 2018
chunk refactor proposal
View chunk.go
type Address []byte
// LocalStore just implements a combined memory cache and disk Store
// it only stores values on disk if they are Marshalable
type LocalStore interface {
Get(ref Address) (Chunk, error)
Put(ch Chunk) (func() error, error)
View gist:e5bf48c90cc57682fceba8e5f04763ad
This file has been truncated, but you can view the full file.
goroutine 0 [idle]:
runtime.futex(0x10d7170, 0x0, 0x0, 0x0, 0xffffffff00000000, 0xffffffff, 0x0, 0x0, 0x7ffe88726450, 0x41431b, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:422 +0x21
runtime.futexsleep(0x10d7170, 0x0, 0xffffffffffffffff)
/usr/local/go/src/runtime/os_linux.go:45 +0x62
/usr/local/go/src/runtime/lock_futex.go:145 +0x6b
zelig / bmt.txt
Created Apr 20, 2017
bmt benchmarks
View bmt.txt
tron@nirname:~/work/go-ethereum$ go test -v -cpu 8 ./bmt -bench . -run no
BenchmarkSHA3_4k-8 100000 13977 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_2k-8 200000 7311 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_1k-8 300000 3859 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_512b-8 1000000 2108 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_256b-8 1000000 1311 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_128b-8 2000000 891 ns/op 512 B/op 3 allocs/op
BenchmarkBMTBaseline_4k-8 30000 45670 ns/op 69077 B/op 392 allocs/op
BenchmarkBMTBaseline_2k-8 50000
View dump.go
func (s *DbStore) Dump() {
//Iterates over the database and checks that there are no faulty chunks
it := s.db.NewIterator()
startPosition := []byte{kpIndex}
var key []byte
var total int
for it.Valid() {
key = it.Key()
zelig / dbstats.go
Last active Apr 7, 2017
db stats script
View dbstats.go
package main
import (
// ""
zelig /
Last active Aug 31, 2017
The Ethereum Swarm project: timeline of accomplishments and roadmap

The development of the distributed mass storage subsystem for Ethereum named Swarm was kicked off in October 2014, shortly before Devcon 0 in Berlin, where we presented the design principles, the basic network and protocol architecture as well as the requirements that we aimed to achieve. With the preliminary design finalized by the end of 2014, implementation in Go language began in 2015.

In 2015, we built the foundations of Swarm, consisting of the subsystems for distributing arbitrarily large files across the network with the possibility of subsequent efficient retrieval and

zelig / enodes.txt
Created Dec 15, 2016
swarm test cluster enodes
View enodes.txt
zelig /
Last active Apr 6, 2021
p2p network similation, testing and monitoring framework

see slides of a talk on the p2p network similation, testing and monitoring framework

p2p: network testing framework and protocol abstraction


The purpose of this work is to have a comprehensive and modular network testing suite, which is able to drive test harnesses for p2p network behaviour. This includes simulations as well as cluster tests on an actual network.


PSS = bzz whispered

pss (bzz whispered) is a swarm network service offering incentivised internode messaging using kademlia based deterministic routing.

phase 0 comes with priorities and an easy to use api exposed to RPC. you can subscribe to messages and peers using geths new pub/sub (available via websockets and ipc).

Swarm kademlia routing implements an efficient unicast address based messaging system. While whisper's architecture offers a nice trade-off between efficiency and anonimity, it is lacking the case when strong anonimity is not required, but predictably low latency transfer is. Public chatrooms, or convo between nodes that do not mind leaking this fact (the content is always safe due to end-to-end encryption).

zelig /
Last active Oct 2, 2016


Whisper is a pure identity-based messaging system. Whisper provides a low-level (non-application-specific) but easily-accessible API without being based upon or influenced by the low-level hardware attributes and characteristics. Peer-to-peer communication between nodes running Whisper clients uses the underlying ÐΞVp2p Wire Protocol. Whisper is not designed to provide a connection oriented system, nor for simply delivering data between a pair of particular network endpoints. Whisper is a new protocol designed expressly for a new paradigm of application development. It is designed from the ground up for easy and efficient multi-casting and broadcasting, and also for low-level partially-asynchronous communications. It is designed to be a building block in next generation ÐApps which require large-scale many-to-many data-discovery, signal negotiation and modest transmissions with an absolute minimum of fuss and the expectation that one has a very reasonable assurance of complete privacy. At its