forked from lzhou1110/bitcoin_timestamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
100 lines (94 loc) · 2.39 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
version: '3'
services:
honest:
container_name: honest
image: timestamp_bitcoind:latest
command: >
bash -c "./src/bitcoind -debug=net -server -rpcuser=user -rpcpassword=pass --rpcbind=10.255.0.0 -rpcallowip=10.0.0.0/8 -checkpoints=0"
networks:
closed_network:
ipv4_address: 10.255.0.0
cap_add:
- SYS_TIME
# replica works in cluster mode only
pyattacker1:
image: timestamp_attacker:latest
deploy:
mode: replicated
replicas: 2
command: >
bash -c "export LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1
&& python3 app.py"
networks:
- closed_network
environment:
- FAKETIME_NO_CACHE=1
- FAKETIME=-70m
- HOST=10.255.0.0
- PORT=8332
pyattacker2:
image: timestamp_attacker:latest
deploy:
mode: replicated
replicas: 2
command: >
bash -c "export LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1
&& python3 app.py"
networks:
- closed_network
environment:
- FAKETIME_NO_CACHE=1
- FAKETIME=-70m
- HOST=10.255.0.0
- PORT=8332
# honest-miner:
# container_name: honest_miner
# image: timestamp_miner:latest
# command: >
# bash -c "export LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1
# && python pyminer.py"
# networks:
# - closed_network
# environment:
# - FAKETIME_NO_CACHE=1
# - FAKETIME=+120m
# - PYTHONUNBUFFERED=1
# - HOST=10.255.0.0
# - PORT=8332
# - RPCUSER=user
# - RPCPASS=pass
# - SLEEPDURATION=2
# attacker1:
# container_name: attack_1
# image: timestamp_bitcoind:latest
# command: >
# bash -c "export LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1
# && ./src/bitcoind -addnode=honest -checkpoints=0"
# networks:
# - closed_network
# environment:
# - FAKETIME_NO_CACHE=1
# - FAKETIME=-70m
# cap_add:
# - SYS_TIME
#
# attacker2:
# container_name: attack_2
# image: timestamp_bitcoind:latest
# command: >
# bash -c "export LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1
# && ./src/bitcoind -addnode=honest -checkpoints=0"
# networks:
# - closed_network
# environment:
# - FAKETIME_NO_CACHE=1
# - FAKETIME=-70m
# cap_add:
# - SYS_TIME
networks:
closed_network:
internal: true
ipam:
driver: default
config:
- subnet: 10.0.0.0/8