Skip to content

Commit

Permalink
Merge pull request #139 from seed-labs/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
wonkr authored Mar 1, 2023
2 parents 95860ae + 7f1f427 commit 3749042
Show file tree
Hide file tree
Showing 89 changed files with 3,103 additions and 552 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
**/output/*
**/eth-states*/*
**/test_log/*
**/test_log*/*
**/__pycache__/*
*.bak
*.out
*.o
*.so
Expand All @@ -24,3 +25,4 @@ client/backend/node_modules
client/backend/bin
*.bin
output
project-words.txt
22 changes: 22 additions & 0 deletions docker_images/seedemu-ethereum/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.18 AS builder1
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /
RUN git clone https://github.com/ethereum/go-ethereum
RUN cd go-ethereum && git checkout v1.10.26 && make all

FROM rust:1.63 AS builder2
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /
RUN apt-get update && apt-get -y --no-install-recommends install software-properties-common build-essential curl git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang protobuf-compiler
RUN git clone https://github.com/wonkr/lighthouse.git
WORKDIR lighthouse
RUN git checkout stable
RUN make install
RUN make install-lcli
WORKDIR /

FROM ubuntu:20.04
COPY --from=builder1 /go-ethereum/build/bin/geth /usr/bin
COPY --from=builder1 /go-ethereum/build/bin/bootnode /usr/bin
COPY --from=builder2 /usr/local/cargo/bin/lcli /usr/bin
COPY --from=builder2 /usr/local/cargo/bin/lighthouse /usr/bin
9 changes: 9 additions & 0 deletions docker_images/seedemu-ethereum/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.4"
services:
test:
build:
context: .
dockerfile: Dockerfile
image: handsonsecurity/seedemu-ethereum


5 changes: 4 additions & 1 deletion examples/B06-blockchain/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
emu.dump('component-blockchain.bin')

emu.render()

docker = Docker(etherViewEnabled=True)

# If output directory exists and override is set to false, we call exit(1)
# updateOutputdirectory will not be called
emu.compile(Docker(), './output')
emu.compile(docker, './output')
Empty file.
27 changes: 0 additions & 27 deletions examples/C04-ethereum-pos/blockchain-pos.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,4 @@
# Enable etherView
docker = Docker(internetMapEnabled=True, etherViewEnabled=True)

# Add the 'rafaelawon/seedemu-lighthouse-base' custom image from dockerhub.
# This image contains custom lighthouse software.
docker.addImage(DockerImage('rafaelawon/seedemu-lighthouse-base', [], local=False), priority=-1)

# Add the 'rafaelawon/seedemu-lighthouse-base' custom image from dockerhub.
# This image contains custom lcli software.
docker.addImage(DockerImage('rafaelawon/seedemu-lcli-base', [], local=False), priority=-2)

base = emu.getLayer('Base')

# Get the physical nodes of all hosts from Base layer.
# The name of physical nodes generated from Makers.makeEmulatorBaseWith10StubASAndHosts() is 'host_{}'
# Base::getNodesByName('host') returns the physical nodes whose name starts with 'host'.
hosts = base.getNodesByName('host')

# Set all host nodes to use the custom 'seedemu-lighthouse-base' image.
for host in hosts:
docker.setImageOverride(host, 'rafaelawon/seedemu-lighthouse-base')

# Get the physical node of beacon setup node.
# The host in asn 150 with id 0 (ip : 10.150.0.71) is set as BeaconSetupNode.
# Base::getNodeByAsnAndName(150, 'host_0') returns the physical node whose name is 'host_0' in AS 150.
beacon_setup = base.getNodeByAsnAndName(150, 'host_0')

# Set the node to use the custom 'seedemu-lcli-base' image.
docker.setImageOverride(beacon_setup, 'rafaelawon/seedemu-lcli-base')

emu.compile(docker, './output', override = True)
124 changes: 62 additions & 62 deletions misc/openvpn-remote-access/ovpn-client.ovpn
Original file line number Diff line number Diff line change
Expand Up @@ -6,76 +6,76 @@ float

<key>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTXPWh2M+CC3m6
2x25O0ici7TDjgIeaDxxZYSNin9Z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YDVR0PBAQDAgEGMA0GCSqGSIb3DQEBCwUA
A4IBAQAddpMVHoz8Og3o4dvIXj7aSNPzj9XoAVhPyEnnE8EfRRqtWbt+3tSSKxGL
xAVXH/e/2/whcXTgBfbwn20/bVfOLQdzTgKszSducQPCD61k+OGAXR45xtNBcvNr
BHkeqOMAu5nmn9Dlm5VWCmbJFBxTu/PPUxDv5y0Z/CwaoweKunvLCpmdqfDl6ejk
lf9ipMCEV73D+WX/vdfD5VGoLIZbZzUgfjoRP54t+FbZav0LYpuU3DI83CvO/pzJ
2QOUJYOd6gNn+h2HA0dacDRCpJnLFUUsKn7RhK4pyhRTtXz8vndOHAEm0plonqeT
vgv5PvXzjCVY71b1ZrjHo0SUDGRC
-----END CERTIFICATE-----
</ca>
key-direction 1
Expand Down
4 changes: 3 additions & 1 deletion seedemu/compiler/DistributedDocker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Distributed Docker Compiler is not maintained

from .Docker import Docker, DockerCompilerFileTemplates
from seedemu.core import Emulator, ScopedRegistry, Node, Network
from seedemu.core.enums import NodeRole
Expand Down Expand Up @@ -42,7 +44,7 @@ def __init__(self, namingScheme: str = "as{asn}{role}-{name}-{primaryIp}"):
"""!
@brief DistributedDocker compiler constructor.
@param namingScheme (optional) node naming scheme. Avaliable variables
@param namingScheme (optional) node naming scheme. Available variables
are: {asn}, {role} (r - router, h - host, rs - route server), {name},
{primaryIp}
"""
Expand Down
Loading

0 comments on commit 3749042

Please sign in to comment.