Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Quorum for latest Ambassador #45

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/test_smartcontract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ jobs:
npm install -g ganache-cli
npm install -g truffle
npm install -g truffle-export-abi
- name: Start local node
- name: Start local node and test smartcontracts
run: |
nohup ganache-cli --allowUnlimitedContractSize --gasLimit=68219752232 &
sleep 10
- name: Test quorum smartcontracts
run: |
pwd
sleep 2
cd examples/supplychain-app/quorum/smartContracts
truffle test --config ./truffle-config.js
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
Loading