Skip to content

Commit

Permalink
[besu][quorum] Ambassador and Web3 version upgrades
Browse files Browse the repository at this point in the history
Signed-off-by: sownak.roy <[email protected]>
  • Loading branch information
sownak committed Jan 22, 2024
1 parent 01c2ba2 commit c8e26df
Show file tree
Hide file tree
Showing 46 changed files with 35,070 additions and 2,795 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
**/.vscode/
# custom config templates
*_custom.tpl
.env*
4 changes: 2 additions & 2 deletions examples/supplychain-app/besu/express_nodeJS/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:10-alpine
FROM node:16-alpine

#copy app
COPY . ./app

#Set working directory and copy package files over for
WORKDIR /app

RUN apk update || : && apk add python make build-base
RUN apk update || : && apk add python3 make build-base

#install dependencies
RUN npm install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ router.get("/:trackingID?", function(req, res) {
container.custodian = newContainer.custodian;
container.custodian = container.custodian + "," + newContainer.lastScannedAt;
container.trackingID = newContainer.trackingID;
let timestampAsNumber = Number(newContainer.timestamp);
if(protocol==="raft")
container.timestamp = (new Date(newContainer.timestamp/1000000)).getTime();
container.timestamp = (new Date(timestampAsNumber/1000000)).getTime();
else
container.timestamp = (new Date(newContainer.timestamp*1000)).getTime();
container.timestamp = (new Date(timestampAsNumber*1000)).getTime();
container.containerID = newContainer.containerID;
container.linearId = {};
container.linearId.externalId = null;
Expand Down Expand Up @@ -90,10 +91,11 @@ router.get("/:trackingID?", function(req, res) {
container.custodian = container.custodian + "," + toPush.lastScannedAt;
container.lastScannedAt = toPush.lastScannedAt;
container.trackingID = toPush.trackingID;
let timestampAsNumber = Number(toPush.timestamp);
if(protocol==="raft")
container.timestamp = (new Date(toPush.timestamp/1000000)).getTime();
container.timestamp = (new Date(timestampAsNumber/1000000)).getTime();
else
container.timestamp = (new Date(toPush.timestamp*1000)).getTime();
container.timestamp = (new Date(timestampAsNumber*1000)).getTime();
container.containerID = toPush.containerID;
container.linearId = {};
container.linearId.externalId = null;
Expand Down Expand Up @@ -124,7 +126,9 @@ router.post("/", upload.array(), function(req, res) {
};
// Add this.address in the counterparties list
newContainer.counterparties.push(fromAddress+","+fromNodeSubject);

web3.eth.getBalance(fromAddress).then(balance => {
console.log(`Account Balance: ${balance}`);
});

var misc = [];
var keys = Object.keys(newContainer.misc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ router.get('/:trackingID/history', function (req, res) {
var history = {};
history.party = toPush.custodian;
history.party = history.party+","+toPush.lastScannedAt;
let timestampAsNumber = Number(toPush.timestamp);
if(protocol==="raft")
history.time = (new Date(toPush.timestamp/1000000)).getTime();
history.time = (new Date(timestampAsNumber/1000000)).getTime();
else
history.time = (new Date(toPush.timestamp * 1000)).getTime();
history.time = (new Date(timestampAsNumber * 1000)).getTime();
history.location = toPush.lastScannedAt;
allTransaction.push(history);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ router.get('/containerless', function (req, res) {
product.recalled = toPush.recalled;
product.custodian = toPush.custodian;
product.custodian = product.custodian + "," + toPush.lastScannedAt;
let timestampAsNumber = Number(toPush.timestamp);
if(protocol==="raft")
product.time = (new Date(toPush.timestamp/1000000)).getTime();
product.time = (new Date(timestampAsNumber/1000000)).getTime();
else
product.time = (new Date(toPush.timestamp * 1000)).getTime();
product.time = (new Date(timestampAsNumber * 1000)).getTime();
product.lastScannedAt = toPush.lastScannedAt;
product.containerID = toPush.containerID;
product.misc = {};
Expand Down Expand Up @@ -90,10 +91,11 @@ router.get('/:trackingID?', function (req, res) {
product.custodian = newProduct.custodian;
product.custodian = product.custodian + "," + newProduct.lastScannedAt;
product.trackingID = newProduct.trackingID;
let timestampAsNumber = Number(newProduct.timestamp);
if(protocol==="raft")
product.timestamp = (new Date(newProduct.timestamp/1000000)).getTime();
product.timestamp = (new Date(timestampAsNumber/1000000)).getTime();
else
product.timestamp = (new Date(newProduct.timestamp * 1000)).getTime();
product.timestamp = (new Date(timestampAsNumber * 1000)).getTime();
product.containerID = newProduct.containerID;
product.linearId = {
"externalId": null,
Expand Down Expand Up @@ -137,10 +139,11 @@ router.get('/:trackingID?', function (req, res) {
product.custodian = toPush.custodian;
product.custodian = product.custodian + "," + toPush.lastScannedAt;
product.trackingID = toPush.trackingID;
let timestampAsNumber = Number(toPush.timestamp);
if(protocol==="raft")
product.timestamp = (new Date(toPush.timestamp/1000000)).getTime();
product.timestamp = (new Date(timestampAsNumber/1000000)).getTime();
else
product.timestamp = (new Date(toPush.timestamp * 1000)).getTime();
product.timestamp = (new Date(timestampAsNumber * 1000)).getTime();
product.containerID = toPush.containerID;
product.linearId = {
"externalId": null,
Expand Down
Loading

0 comments on commit c8e26df

Please sign in to comment.