Skip to content

Commit

Permalink
Merge pull request #4 from Project-Kunta/development
Browse files Browse the repository at this point in the history
fixed bug with accepted and broadcasted + interim updating of proposal
  • Loading branch information
Jovonni authored Mar 12, 2020
2 parents d0f9e35 + 8609eb0 commit 86aea91
Show file tree
Hide file tree
Showing 43 changed files with 1,569 additions and 277 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
save:
git add * ; git commit -am "checkpoint" -v ; git push origin master -v ;
git add * ; git commit -am "checkpoint from root" ; git push origin master:development -v
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This will submit a first proposal to alice, which will initiate proposal generat
make p_alice
```

# Stress with input/female transaction
# Stress with output/female transaction
To create/submit a new transaction every m minutes
```
make stress
Expand Down
Binary file modified core/.DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions core/DockerfileAOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#FROM rust:latest
#FROM rust:1.36.0 AS build
FROM clux/muslrust AS build

ARG nodeType

RUN mkdir /environment/

COPY . /environment/

WORKDIR /environment/

RUN rustup target add x86_64-unknown-linux-musl

RUN cargo build --release

# Copy the source and build the application.
COPY ./src ./src

####
#RUN apt-get install pkg-config libx11-dev libxmu-dev

RUN cargo install --target x86_64-unknown-linux-musl --path .

################second stage
FROM scratch

EXPOSE 8081

#test
#COPY --from=build /usr/local/cargo/bin/core .

#works
###COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .

###COPY --from=build /environment/storage ./storage

###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"]
21 changes: 21 additions & 0 deletions core/DockerfileAlice
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM aos:latest AS build

EXPOSE 8081

#test
#COPY --from=build /usr/local/cargo/bin/core .

#works
####COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .

#RUN mkdir ./storage

####COPY --from=build /environment/storage ./storage


#USER 1
#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"]
####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"]
#CMD ["./core", "node-name='alice node'", "node-id=1", "port=8081", "peers=localhost:8082,localhost:8083", "ip=localhost:8081"]

CMD ["make", "alice"]
21 changes: 21 additions & 0 deletions core/DockerfileBob
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM aos:latest AS build

EXPOSE 8082

#test
#COPY --from=build /usr/local/cargo/bin/core .

#works
####COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .

#RUN mkdir ./storage

####COPY --from=build /environment/storage ./storage


#USER 1
#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"]
####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"]
#CMD ["./core", "node-name='bobs node'", "node-id=2", "port=8082", "peers=localhost:8081,localhost:8083", "ip=localhost:8082"]

CMD ["make", "bob"]
22 changes: 22 additions & 0 deletions core/DockerfileCici
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM aos:latest AS build

EXPOSE 8083


#test
#COPY --from=build /usr/local/cargo/bin/core .

#works
####COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .

#RUN mkdir ./storage

####COPY --from=build /environment/storage ./storage


#USER 1
#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"]
####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"]
#CMD ["./core", "node-name='cicis node'", "node-id=3", "port=8083", "peers=localhost:8082,localhost:8081", "ip=localhost:8083"]

CMD ["make", "cici"]
64 changes: 53 additions & 11 deletions core/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
compile:
RUST_BACKTRACE=1 cargo check --verbose;
alice: clean_alice
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;
#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;
#RUST_BACKTRACE=1 cargo run node-name="alice's node" port=8081 peers=192.168.0.8:8082 ip=192.168.0.2:8081;
#RUST_BACKTRACE=1 cargo run node-name="alice's node" port=8081 peers=127.0.0.1:8081 ip=127.0.0.1:8081;
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;
bob: clean_bob
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;
#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;
#RUST_BACKTRACE=1 cargo run node-name="bob's node" port=8082 peers=192.168.0.2:8081 ip=192.168.0.8:8082;
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;
cici: clean_cici
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;
#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;
#RUST_BACKTRACE=1 cargo run node-name="cici's node" port=8083 peers=192.168.0.2:8081 ip=192.168.0.8:8083;
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;
reset_alice:
rm storage/.DS_Store ; make clean_alice ; make get ; make alice
rm storage/.DS_Store ; rm -r .DS_Store ; make clean_alice ; make get ; make alice
reset_bob:
rm storage/.DS_Store ; make clean_bob ; make get ; make bob
rm storage/.DS_Store ; rm -r .DS_Store ; make clean_bob ; make get ; make bob
reset_cici:
rm storage/.DS_Store ; make clean_cici ; make get ; make cici
rm storage/.DS_Store ; rm -r .DS_Store ; make clean_cici ; make get ; make cici
clean_alice:
rm -f ./storage/proposals.db ;
rm -rf ./storage/proposal/* ;
Expand All @@ -33,6 +40,7 @@ clean_bob:
rm -rf ./storage/state/* ;
make create_directories ;
#cargo clean ;

clean_cici:
rm -f ./storage/proposals.db ;
rm -rf ./storage/proposal/* ;
Expand All @@ -52,25 +60,35 @@ create_directories:
build:
cargo build --verbose;
save:
git add * ; git commit -am "saved..." ; git push origin master
git add * ; git commit -am "saved from core" ; git push origin master:development -v
get:
git fetch ; git pull origin master;
rms:
rm ./storage/proposal/*
stress:
while true; do make stress_a; sleep 30 ; make stress_b; sleep 30 ; make stress_c; sleep 30 ; done
#while true; do make txo; make sap; sleep 60; done
#while true; do make txo; make create_proposal; sleep 60; done
#while true; do make sat; make sap; sleep 30; done
while true; do make stress_a; sleep 15 ; make stress_b; sleep 15 ; make stress_c; sleep 15 ; done
#while true; do make stress_a; sleep 60 ; done
p_alice:
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" 127.0.0.1:8081/proposal/create/
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" 127.0.0.1:8081/proposal/create/
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" localhost:8081/proposal/create/
p_bob:
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" 127.0.0.1:8082/proposal/create/
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" 127.0.0.1:8082/proposal/create/
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" localhost:8082/proposal/create/
p_cici:
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" 127.0.0.1:8083/proposal/create/
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" 127.0.0.1:8083/proposal/create/
curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" localhost:8083/proposal/create/
stress_a:
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 ;
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8081" 127.0.0.1:8081/proposal/create/
stress_b:
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 ;
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8082" 192.168.0.8:8082/proposal/create/ ;
stress_c:
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 ;
#curl -d 'TESTSTRING' --header "Origin: 127.0.0.1:8083" 192.168.0.8:8083/proposal/create/ ;
sat:
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
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
Expand Down Expand Up @@ -108,3 +126,27 @@ test_hash:
cd hash; RUST_BACKTRACE=1 cargo test --verbose;
test_signature:
cd signature; RUST_BACKTRACE=1 cargo test --verbose;
dbm: #dbmain
time docker build --file "./DockerfileAOS" --build-arg nodeType=$1 -t aos .
dball:
make dba ;
make dbb ;
make dbc ;
dba:
time docker build --force-rm --rm --network="host" --file "./DockerfileAlice" --build-arg nodeType=alice -t alice_node .
dbb:
time docker build --force-rm --rm --network="host" --file "./DockerfileBob" --build-arg nodeType=bob -t bob_node .
dbc:
time docker build --force-rm --rm --network="host" --file "./DockerfileCici" --build-arg nodeType=cici -t cici_node .
rac:
docker run -d -p 8081:8081 --dns=192.168.0.1 alice_node ;
docker run -d -p 8082:8082 --dns=192.168.0.1 bob_node ;
docker run -d -p 8083:8083 --dns=192.168.0.1 cici_node ;

#docker run -d --network="host" alice_node ;
#docker run -d --network="host" bob_node ;
#docker run -d --network="host" cici_node ;

#docker run -d -t -p 8081:8081 --net=host --dns=192.168.0.1 alice_node ;
#docker run -d -t -p 8082:8082 --net=host --dns=192.168.0.1 bob_node ;
#docker run -d -t -p 8083:8083 --net=host --dns=192.168.0.1 cici_node ;
Loading

0 comments on commit 86aea91

Please sign in to comment.