Skip to content

Commit

Permalink
Fix's to the docker files and the ABCI.
Browse files Browse the repository at this point in the history
- Fix DockerFiles
- Fix ABCI Connector issue if the block was null .
  • Loading branch information
TeknoPT committed Oct 11, 2023
1 parent d660325 commit c4c883c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
3 changes: 1 addition & 2 deletions DOCKER/DockerfileTestnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ COPY DOCKER/bin /app/bin

RUN apt-get update; apt-get install -y inotify-tools libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev libc6-dev libicu-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev librocksdb-dev libc6-dev libsnappy-dev libicu-dev screen bash vim net-tools ca-certificates openssl libssl-dev libgdiplus libx11-dev nano

#EXPOSE 7077 7078 7079 7080 26056 26156 26256 26356 26057 26157 26257 26357
EXPOSE 7078 7079 7080 26156 26256 26356 26157 26257 26357
EXPOSE 7077 7078 7079 7080 26056 26156 26256 26356 26057 26157 26257 26357

RUN chmod +x /app/wrapper-testnet.sh
ENTRYPOINT ["/app/wrapper-testnet.sh"]
1 change: 0 additions & 1 deletion DOCKER/DockerfileTestnetDebug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ COPY DOCKER/bin /app/bin

RUN apt-get update; apt-get install -y libc6-dev libsnappy-dev libicu-dev screen bash vim net-tools ca-certificates openssl libssl-dev librocksdb-dev nano

#EXPOSE 7077 7078 7079 7080 26056 26156 26256 26356 26057 26157 26257 26357
EXPOSE 7078 7079 7080 26156 26256 26356 26157 26257 26357

RUN chmod +x /app/wrapper-testnet-debug.sh
Expand Down
34 changes: 20 additions & 14 deletions Phantasma.Node/src/ABCIConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,27 +293,33 @@ public override Task<ResponseCommit> Commit(RequestCommit request, ServerCallCon
Log.Information($"ABCI Connector - Commit");

var chain = _nexus.RootChain as Chain;
var attempts = 2;

// Is signed by me and I am the proposer
if ( chain.CurrentBlock != null)
Log.Information("Block {Height} is signed by {Address}", chain.Height, chain.CurrentBlock.Validator);

if (chain.CurrentBlock.Validator == chain.ValidatorAddress)
{
Log.Information("Block {Height} Is Being Validated by me.");
chain.Commit();
}
else
if (chain.CurrentBlock != null)
{
var attempts = 2;
while (chain.CurrentBlock != null && attempts-- > 0)
Log.Information("Block {Height} is signed by {Address}", chain.Height, chain.CurrentBlock.Validator);
if (chain.CurrentBlock.Validator == chain.ValidatorAddress)
{
Log.Information("Block {Height} Is Being Validated by me.");
chain.Commit();
}
else
{
AttemptRequestBlock(chain);
while (chain.CurrentBlock != null && attempts-- > 0)
{
AttemptRequestBlock(chain);

Thread.Sleep(_delayRequests);
Thread.Sleep(_delayRequests);
}
//var data = chain.Commit();
}
//var data = chain.Commit();
}
else
{
Log.Error("Block {Height} Is Null.", chain.Height);
}

var response = new ResponseCommit();

//response.Data = ByteString.CopyFrom(data); // this would change the app hash, we don't want that
Expand Down

0 comments on commit c4c883c

Please sign in to comment.