Skip to content

Commit

Permalink
WIP test circle.yml add docker-compose test
Browse files Browse the repository at this point in the history
  • Loading branch information
satellitex authored and l4l committed Mar 17, 2017
1 parent 55b69ef commit 2b8af25
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ test:
- export ID=$(docker run -it -d -p 1204:1204 hyperledger/iroha-docker /run.sh); echo "ID=$ID" >> ~/.bashrc
# put new tests below
- curl -X POST http://127.0.0.1:1204/account/register -d '{"publicKey":"WdvM/DPabapmtA7ISbTYPywbHxk8gWu2221LzmcmAgw=","alias":"yonezu","timestamp":1482053586}'
# docker-compose TEST (add peer)
- docker-compose up
- docker-compose scale iroha=2
# WIP - docker exec -it iroha_iroha_2 sh -c "/usr/local/iroha/bin/make_sumeragi" > /tmp/me.json
# WIP - docker exec -it iroha_iroha_1 sh -c "/usr/local/iroha/bin/issue_transaction add peer ${TARGET_IP} ${TARGET_KEY} 1.0 true"
- docker exec -it iroha_iroha_1 sh -c "/usr/local/iroha/bin/issue_transaction add peer 172.18.0.5 X/Sk+plpcQ/+Wb9RQybm+OUS7FP3lbkuQmyHuK+uMvQ 1.0 true"
post:
# iroha-main logs
- docker logs $ID
Expand Down
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"pool_worker_queue_size": 1024,
"http_port": 1204,
"grpc_port": 50051,
"active_start": true
"active_start": false
}
2 changes: 2 additions & 0 deletions core/consensus/sumeragi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ namespace sumeragi {

void update()
{
logger::debug("sumeragi") << "Context update!";
auto peers = config::PeerServiceConfig::getInstance().getPeerList();
for (auto&& p : peers ) {
validatingPeers.push_back( std::move(p) );
Expand Down Expand Up @@ -226,6 +227,7 @@ namespace sumeragi {
ConsensusEvent event;
event.set_status("uncommit");
event.mutable_transaction()->CopyFrom(transaction);
context->update();
// send processTransaction(event) as a task to processing pool
// this returns std::future<void> object
// (std::future).get() method locks processing until result of processTransaction will be available
Expand Down
4 changes: 3 additions & 1 deletion core/infra/config/peer_service_with_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void PeerServiceConfig::initialziePeerList_from_json(){
for (const auto& peer : getGroup()) {
peerList.emplace_back( peer["ip"].get<std::string>(),
peer["publicKey"].get<std::string>(),
1.0);
getMaxTrustScore() );
}
}

Expand Down Expand Up @@ -185,6 +185,8 @@ std::vector<std::unique_ptr<peer::Node>> PeerServiceConfig::getPeerList() {
nodes.push_back( std::make_unique<peer::Node>( node.getIP(), node.getPublicKey(), node.getTrustScore() ) );
sort( nodes.begin(), nodes.end(),
[]( const std::unique_ptr<peer::Node> &a, const std::unique_ptr<peer::Node> &b ) { return a->getTrustScore() > b->getTrustScore(); } );
for( auto &&node : nodes )
logger::debug("getPeerList") << node->getIP() + " " <<node->getPublicKey();
return nodes;
}
std::vector<std::string> PeerServiceConfig::getIpList() {
Expand Down

0 comments on commit 2b8af25

Please sign in to comment.