Skip to content

Instantly share code, notes, and snippets.

View lmars's full-sized avatar

Lewis Marshall lmars

View GitHub Profile
@lmars
lmars / 1_encrypt.go
Created January 3, 2019 14:00
go-ethereum / ecies-parity example
package main
import (
"crypto/rand"
"fmt"
"log"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/ecies"
)
@lmars
lmars / lmars-swarm-notes-2017-04-25.md
Created April 25, 2017 09:32
Swarm notes - 25th Apr 2017

Lmars Swarm Notes - 25th Apr 2017

In the past week:

  • Added integration tests for the swarm CLI: ethereum/go-ethereum#14353. These are similar to the geth integration tests, executing the current running binary but with a hook to run the CLI app rather than the tests, which avoids the need to compile a separate binary.
@lmars
lmars / swarm-simulation-scenarios.md
Created April 19, 2017 09:22
Swarm Simulation Scenarios

Simulation Scenarios

A simulaion scenario consists of the initial network description followed by a series of simulation steps.

Initial network description

This consists of:

  • the number of nodes in the network
@lmars
lmars / lmars-swarm-agenda-2017-04-18.md
Last active April 18, 2017 09:47
Swarm Agenda - Tue 18th Apr 2017

Lmars Swarm Agenda - Tue 18th Apr 2017

Development environment

PR: ethereum/go-ethereum#14332

  • Development environment is a Linux bash shell which runs in a Docker container
  • Includes common tools and Go 1.8.1
  • Local directory is mounted in the container at /go/src/github.com/ethereum/go-ethereum so
@lmars
lmars / swarm-network-testing.md
Created March 27, 2017 17:45
Swarm Network Testing

Integration testing

Network simulation

The aim is to fully simulate devp2p networks, manage connections between nodes and record interactions in a replayable journal.

A simulation framework is currently in progress on the network-testing-framework branch and currently includes the following packages:

@lmars
lmars / swarm-api-improvements.md
Created March 12, 2017 15:39
Swarm API improvements

Uploading files

Files can be uploaded in a single HTTP request, where the body is either a single file to store, a tar stream (application/x-tar) or a multipart form (multipart/form-data).

  • single file upload
$ curl -H "Content-Type: text/plain" --data-binary "some-data" http://localhost:8500/bzz:/
69094f7a9a04d680708596d1c0b67b0852d72d91bbaf934206c0904137c5a3c7
@lmars
lmars / flynn-healthcheck.json
Created October 7, 2016 20:49
Flynn healthcheck
{
"processes": {
"web": {
"ports": [
{
"port": 8080,
"proto": "tcp",
"service": {
"name": "APPNAME-web",
"create": true,
@lmars
lmars / ip-tables-debug.txt
Created May 14, 2015 19:29
IP Tables Debug
# log ICMP packets
sudo iptables -t raw -A OUTPUT -p icmp -j TRACE
sudo iptables -t raw -A PREROUTING -p icmp -j TRACE
sudo modprobe ipt_LOG
# in the container
ping -c 1 8.8.8.8
@lmars
lmars / flynn-mongodb.txt
Created March 14, 2015 16:37
Flynn MongoDB
# create a mongo app
flynn create --remote "" mongo
# create a release using the latest (at the time of writing) Docker MongoDB image
flynn -a mongo release add -f config.json "https://registry.hub.docker.com?name=mongo&id=216d9a0e82646f77b31b78eeb0e26db5500930bbd6085d5d5c3844ec27c0ca50"
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a mongo ps" and it should come up.
flynn -a mongo scale server=1
# mongo should now be running in the cluster at mongo.discoverd:27017
@lmars
lmars / commands.txt
Last active January 22, 2016 20:43
Flynn Redis
# create a redis app
flynn create --remote "" redis
# create a release using the latest (at the time of writing) Docker Redis image
flynn -a redis release add -f config.json "https://registry.hub.docker.com?name=redis&id=868be653dea3ff6082b043c0f34b95bb180cc82ab14a18d9d6b8e27b7929762c"
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a redis ps" and should come up.
flynn -a redis scale server=1
# redis should now be running in the cluster at redis.discoverd:6379