Skip to content

Commit 86aea91

Browse files
authored
Merge pull request #4 from Project-Kunta/development
fixed bug with accepted and broadcasted + interim updating of proposal
2 parents d0f9e35 + 8609eb0 commit 86aea91

File tree

43 files changed

+1569
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1569
-277
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
save:
2-
git add * ; git commit -am "checkpoint" -v ; git push origin master -v ;
2+
git add * ; git commit -am "checkpoint from root" ; git push origin master:development -v

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This will submit a first proposal to alice, which will initiate proposal generat
5050
make p_alice
5151
```
5252

53-
# Stress with input/female transaction
53+
# Stress with output/female transaction
5454
To create/submit a new transaction every m minutes
5555
```
5656
make stress

core/.DS_Store

-4 KB
Binary file not shown.

core/Cargo.lock

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/DockerfileAOS

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#FROM rust:latest
2+
#FROM rust:1.36.0 AS build
3+
FROM clux/muslrust AS build
4+
5+
ARG nodeType
6+
7+
RUN mkdir /environment/
8+
9+
COPY . /environment/
10+
11+
WORKDIR /environment/
12+
13+
RUN rustup target add x86_64-unknown-linux-musl
14+
15+
RUN cargo build --release
16+
17+
# Copy the source and build the application.
18+
COPY ./src ./src
19+
20+
####
21+
#RUN apt-get install pkg-config libx11-dev libxmu-dev
22+
23+
RUN cargo install --target x86_64-unknown-linux-musl --path .
24+
25+
################second stage
26+
FROM scratch
27+
28+
EXPOSE 8081
29+
30+
#test
31+
#COPY --from=build /usr/local/cargo/bin/core .
32+
33+
#works
34+
###COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .
35+
36+
###COPY --from=build /environment/storage ./storage
37+
38+
###CMD ["./core node-name=\"alices node\" node-id=1 port=8081 peers=127.0.0.1:8082,127.0.0.1:8083 ip=127.0.0.1:8081"]

core/DockerfileAlice

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM aos:latest AS build
2+
3+
EXPOSE 8081
4+
5+
#test
6+
#COPY --from=build /usr/local/cargo/bin/core .
7+
8+
#works
9+
####COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .
10+
11+
#RUN mkdir ./storage
12+
13+
####COPY --from=build /environment/storage ./storage
14+
15+
16+
#USER 1
17+
#CMD ["./core node-name='alice node' node-id=1 port=8081 peers=127.0.0.1:8082,127.0.0.1:8083 ip=127.0.0.1:8081"]
18+
####CMD ["./core", "node-name='alice node'", "node-id=1", "port=8081", "peers=127.0.0.1:8082,127.0.0.1:8083", "ip=127.0.0.1:8081"]
19+
#CMD ["./core", "node-name='alice node'", "node-id=1", "port=8081", "peers=localhost:8082,localhost:8083", "ip=localhost:8081"]
20+
21+
CMD ["make", "alice"]

core/DockerfileBob

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM aos:latest AS build
2+
3+
EXPOSE 8082
4+
5+
#test
6+
#COPY --from=build /usr/local/cargo/bin/core .
7+
8+
#works
9+
####COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .
10+
11+
#RUN mkdir ./storage
12+
13+
####COPY --from=build /environment/storage ./storage
14+
15+
16+
#USER 1
17+
#CMD ["./core node-name=\"bob's node\" node-id=2 port=8082 peers=127.0.0.1:8081,127.0.0.1:8083 ip=127.0.0.1:8082"]
18+
####CMD ["./core", "node-name='bobs node'", "node-id=2", "port=8082", "peers=127.0.0.1:8081,127.0.0.1:8083", "ip=127.0.0.1:8082"]
19+
#CMD ["./core", "node-name='bobs node'", "node-id=2", "port=8082", "peers=localhost:8081,localhost:8083", "ip=localhost:8082"]
20+
21+
CMD ["make", "bob"]

core/DockerfileCici

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM aos:latest AS build
2+
3+
EXPOSE 8083
4+
5+
6+
#test
7+
#COPY --from=build /usr/local/cargo/bin/core .
8+
9+
#works
10+
####COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .
11+
12+
#RUN mkdir ./storage
13+
14+
####COPY --from=build /environment/storage ./storage
15+
16+
17+
#USER 1
18+
#CMD ["./core node-name=\"cici's node\" node-id=3 port=8083 peers=127.0.0.1:8082,127.0.0.1:8081 ip=127.0.0.1:8083"]
19+
####CMD ["./core", "node-name='cicis node'", "node-id=3", "port=8083", "peers=127.0.0.1:8082,127.0.0.1:8081", "ip=127.0.0.1:8083"]
20+
#CMD ["./core", "node-name='cicis node'", "node-id=3", "port=8083", "peers=localhost:8082,localhost:8081", "ip=localhost:8083"]
21+
22+
CMD ["make", "cici"]

core/Makefile

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
compile:
22
RUST_BACKTRACE=1 cargo check --verbose;
33
alice: clean_alice
4-
RUST_BACKTRACE=1 cargo run node-name="alice's node" node-id=1 port=8081 peers=127.0.0.1:8082,127.0.0.1:8083 ip=127.0.0.1:8081 ; > run.log;
4+
#RUST_BACKTRACE=1 cargo run node-name="alice's node" port=8081 peers=192.168.0.8:8082,192.168.0.8:8083 ip=192.168.0.2:8081;
5+
#RUST_BACKTRACE=1 cargo run node-name="alice's node" port=8081 peers=192.168.0.8:8082 ip=192.168.0.2:8081;
6+
#RUST_BACKTRACE=1 cargo run node-name="alice's node" port=8081 peers=127.0.0.1:8081 ip=127.0.0.1:8081;
7+
RUST_BACKTRACE=1 cargo run node-name="alice's node" node-id=1 port=8081 peers=127.0.0.1:8082,127.0.0.1:8083 ip=127.0.0.1:8081 #> run.log;
58
bob: clean_bob
6-
RUST_BACKTRACE=1 cargo run node-name="bob's node" node-id=2 port=8082 peers=127.0.0.1:8081,127.0.0.1:8083 ip=127.0.0.1:8082 ; > run.log;
9+
#RUST_BACKTRACE=1 cargo run node-name="bob's node" port=8082 peers=192.168.0.2:8081,192.168.0.8:8083 ip=192.168.0.8:8082;
10+
#RUST_BACKTRACE=1 cargo run node-name="bob's node" port=8082 peers=192.168.0.2:8081 ip=192.168.0.8:8082;
11+
RUST_BACKTRACE=1 cargo run node-name="bob's node" node-id=2 port=8082 peers=127.0.0.1:8081,127.0.0.1:8083 ip=127.0.0.1:8082 #> run.log;
712
cici: clean_cici
8-
RUST_BACKTRACE=1 cargo run node-name="cici's node" node-id=3 port=8083 peers=127.0.0.1:8082,127.0.0.1:8081 ip=127.0.0.1:8083 ; > run.log;
13+
#RUST_BACKTRACE=1 cargo run node-name="cici's node" port=8083 peers=192.168.0.8:8082,192.168.0.2:8081 ip=192.168.0.8:8083;
14+
#RUST_BACKTRACE=1 cargo run node-name="cici's node" port=8083 peers=192.168.0.2:8081 ip=192.168.0.8:8083;
15+
RUST_BACKTRACE=1 cargo run node-name="cici's node" node-id=3 port=8083 peers=127.0.0.1:8082,127.0.0.1:8081 ip=127.0.0.1:8083 #> run.log;
916
reset_alice:
10-
rm storage/.DS_Store ; make clean_alice ; make get ; make alice
17+
rm storage/.DS_Store ; rm -r .DS_Store ; make clean_alice ; make get ; make alice
1118
reset_bob:
12-
rm storage/.DS_Store ; make clean_bob ; make get ; make bob
19+
rm storage/.DS_Store ; rm -r .DS_Store ; make clean_bob ; make get ; make bob
1320
reset_cici:
14-
rm storage/.DS_Store ; make clean_cici ; make get ; make cici
21+
rm storage/.DS_Store ; rm -r .DS_Store ; make clean_cici ; make get ; make cici
1522
clean_alice:
1623
rm -f ./storage/proposals.db ;
1724
rm -rf ./storage/proposal/* ;
@@ -33,6 +40,7 @@ clean_bob:
3340
rm -rf ./storage/state/* ;
3441
make create_directories ;
3542
#cargo clean ;
43+
3644
clean_cici:
3745
rm -f ./storage/proposals.db ;
3846
rm -rf ./storage/proposal/* ;
@@ -52,25 +60,35 @@ create_directories:
5260
build:
5361
cargo build --verbose;
5462
save:
55-
git add * ; git commit -am "saved..." ; git push origin master
63+
git add * ; git commit -am "saved from core" ; git push origin master:development -v
5664
get:
5765
git fetch ; git pull origin master;
5866
rms:
5967
rm ./storage/proposal/*
6068
stress:
61-
while true; do make stress_a; sleep 30 ; make stress_b; sleep 30 ; make stress_c; sleep 30 ; done
69+
#while true; do make txo; make sap; sleep 60; done
70+
#while true; do make txo; make create_proposal; sleep 60; done
71+
#while true; do make sat; make sap; sleep 30; done
72+
while true; do make stress_a; sleep 15 ; make stress_b; sleep 15 ; make stress_c; sleep 15 ; done
73+
#while true; do make stress_a; sleep 60 ; done
6274
p_alice:
63-
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" 127.0.0.1:8081/proposal/create/
75+
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" 127.0.0.1:8081/proposal/create/
76+
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" localhost:8081/proposal/create/
6477
p_bob:
65-
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" 127.0.0.1:8082/proposal/create/
78+
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" 127.0.0.1:8082/proposal/create/
79+
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" localhost:8082/proposal/create/
6680
p_cici:
67-
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" 127.0.0.1:8083/proposal/create/
81+
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" 127.0.0.1:8083/proposal/create/
82+
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" localhost:8083/proposal/create/
6883
stress_a:
6984
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" --header "User-Agent: 100,200,test_string" 127.0.0.1:8081/transaction/submit/output ;
85+
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" 127.0.0.1:8081/proposal/create/
7086
stress_b:
7187
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" --header "User-Agent: 100,200,test_string" 192.168.0.8:8082/transaction/submit/output ;
88+
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" 192.168.0.8:8082/proposal/create/ ;
7289
stress_c:
7390
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" --header "User-Agent: 100,200,test_string" 192.168.0.8:8083/transaction/submit/output ;
91+
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" 192.168.0.8:8083/proposal/create/ ;
7492
sat:
7593
for i in {1..2}; do curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" --header "User-Agent: 100,200,test_string" 127.0.0.1:8081/transaction/submit/output ; done
7694
for i in {1..2}; do curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" --header "User-Agent: 100,200,test_string" 192.168.0.8:8082/transaction/submit/output ; done
@@ -108,3 +126,27 @@ test_hash:
108126
cd hash; RUST_BACKTRACE=1 cargo test --verbose;
109127
test_signature:
110128
cd signature; RUST_BACKTRACE=1 cargo test --verbose;
129+
dbm: #dbmain
130+
time docker build --file "./DockerfileAOS" --build-arg nodeType=$1 -t aos .
131+
dball:
132+
make dba ;
133+
make dbb ;
134+
make dbc ;
135+
dba:
136+
time docker build --force-rm --rm --network="host" --file "./DockerfileAlice" --build-arg nodeType=alice -t alice_node .
137+
dbb:
138+
time docker build --force-rm --rm --network="host" --file "./DockerfileBob" --build-arg nodeType=bob -t bob_node .
139+
dbc:
140+
time docker build --force-rm --rm --network="host" --file "./DockerfileCici" --build-arg nodeType=cici -t cici_node .
141+
rac:
142+
docker run -d -p 8081:8081 --dns=192.168.0.1 alice_node ;
143+
docker run -d -p 8082:8082 --dns=192.168.0.1 bob_node ;
144+
docker run -d -p 8083:8083 --dns=192.168.0.1 cici_node ;
145+
146+
#docker run -d --network="host" alice_node ;
147+
#docker run -d --network="host" bob_node ;
148+
#docker run -d --network="host" cici_node ;
149+
150+
#docker run -d -t -p 8081:8081 --net=host --dns=192.168.0.1 alice_node ;
151+
#docker run -d -t -p 8082:8082 --net=host --dns=192.168.0.1 bob_node ;
152+
#docker run -d -t -p 8083:8083 --net=host --dns=192.168.0.1 cici_node ;

0 commit comments

Comments
 (0)