Skip to content

Instantly share code, notes, and snippets.

View zelig's full-sized avatar

Viktor Trón zelig

View GitHub Profile
@zelig
zelig / swarm-e2e.md
Last active July 5, 2016 16:13
swarm end to end automated testing from scratch

assumptions

  • setup according to wiki
  • nodes.lst lists the host nodes of the remote swarm cluster (formmat is cicada@3.3.0.1 per line)
  • given a directory swarm locally (633Mb)
du -m -d 0 /tmp/swarm/
650     /tmp/swarm/
@zelig
zelig / swarm.log
Created May 30, 2016 23:36
swarm deadlock in kademlia
goroutine 137 [semacquire, 4 minutes]:
sync.runtime_Semacquire(0xc83047af64)
/usr/lib/go/src/runtime/sema.go:43 +0x26
sync.(*Mutex).Lock(0xc83047af60)
/usr/lib/go/src/sync/mutex.go:82 +0x1c4
sync.(*RWMutex).Lock(0xc83047af60)
/usr/lib/go/src/sync/rwmutex.go:82 +0x30
github.com/ethereum/go-ethereum/swarm/network/kademlia.(*Kademlia).Count(0xc83047af00, 0x0)
/home/tron/go/src/github.com/ethereum/go-ethereum/swarm/network/kademlia/kademlia.go:94 +0x6f
github.com/ethereum/go-ethereum/swarm/network/kademlia.(*Kademlia).String(0xc83047af00, 0x0, 0x0)
@zelig
zelig / swarm-server-setup.sh
Last active August 12, 2016 21:31
swarm server setup
cat > ~/.gitconfig <<EOF
[github]
user = zelig
token =
[user]
name = zelig
email = viktor.tron@gmail.com
[core]
pager = less -FRX
[color]
@zelig
zelig / notes.md
Created December 3, 2015 22:31
swarm PR git notes
@zelig
zelig / sword.md
Created December 1, 2015 12:17
The Ethereum Sword = Swarm On-demand Retrieval Daemon

The Ethereum Sword = Swarm On-demand Retrieval Daemon

With this service enabled, you keep the Ethereum chain data in swarm, so your ethereum node can function as a flexible light client.

Sword leverages the new chain and state access layers to the core, to provide an on-demand retrieval plugin. Perfectly identical to the LES-based light client, SWORD provides integrity protected (merkle proof verified) on-demand access to the ethereum blockchain data. Chain data include blocks, transactions (maybe even block headers), receipts, state and contract storage. This means a fast user-experience that allows you to do anything a full archival node can without major compromise to security yet without ever running the VM or storing any particular part of the chain and state database.

SWORD is completely resistant to local storage or memory failures but requires network connectivity and a healthy swarm network with sufficient provision (enough nodes submitting, storing and serving chain data). On the one hand a

@zelig
zelig / interfaces.md
Last active November 29, 2015 11:49
node stack, rpc/ipc/js interfaces and module Api registration

@karalabe @bas-vk @fjl guys I was thinking of the ipcjson integration in the new stack design. SO the idea is that we should make ipc interfaces (http, js, etc) services now that they do not depend on other packages. These services would be registered just like others (in wrapper). Then other services when they are initialised would look if they find an ipcapi capable service and register their API module(s) (more than one, e.g., ethereum will insert at least eth and miner, but probably also natspec, registrar, etc)

// in ipc package
type Api interface {
  // whatever we need to describe an Api
  Autocomplete()
  Methods()
  Name()
  Version()
/////////////////////////////////////
// deploy a contract
eth.getBlockTransactionCount("pending");
miner.start(1); admin.sleepBlocks(1); miner.stop();
source = "contract test {\n" +
" /// @notice will multiply `a` by 7.\n" +
" function multiply(uint a) returns(uint d) {\n" +
" return a * 7;\n" +
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
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
https://github.com/ethersphere/swarm/wiki/Swap
https://github.com/ethersphere/go-ethereum/pull/20
./geth --datadir ~/tmp/swap/01 account new
# 0xaf420ffb7b146c7198177e5510b04b6966b17358 (passwd = bzz)
then you need to mine some ether on an easy chain
./geth --datadir ~/tmp/swap/01 --nodiscover --networkid 322 --mine --dev console 2>> swap01.log