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

First implementation version of SATP #2748

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
dafba95
initial commit
outsidethecode Jun 29, 2023
235e7a4
initial commit
outsidethecode Jun 30, 2023
bfb3d87
initial commit
outsidethecode Jun 30, 2023
6332243
initial commit
outsidethecode Jun 30, 2023
ff66175
initial commit
outsidethecode Jul 1, 2023
c976683
initial commit
outsidethecode Jul 2, 2023
7a99c0d
initial commit
outsidethecode Jul 2, 2023
2dd8ff0
initial commit
outsidethecode Jul 2, 2023
4a0f236
intial commit
outsidethecode Jul 2, 2023
0449cd8
initial commit
outsidethecode Jul 3, 2023
a63d7d6
initial commit
outsidethecode Jul 31, 2023
af47784
initial commit
outsidethecode Jul 31, 2023
98551d2
Implemented the two endpoints TransferProposalClaims and TransferProp…
outsidethecode Aug 1, 2023
3819abc
implemented the lock assertion method
outsidethecode Aug 2, 2023
4aeea5b
Added the lock-assertion-receipt and lock-assertion-broadcast methods
outsidethecode Aug 2, 2023
5fee4cb
Added the request to the driver to lock an asset
outsidethecode Aug 3, 2023
bc6fa77
corrected some variable names
outsidethecode Aug 4, 2023
7ca4476
Merge pull request #1 from outsidethecode/sapt-stage-2
outsidethecode Aug 4, 2023
2ae61f9
Added the endpoints corresponding to the steps 3.1 to 3.9
outsidethecode Aug 9, 2023
2e38595
Implemented the step 2.1B so that the driver call the gateway to upda…
outsidethecode Aug 14, 2023
ee007ad
Implemented the status check functionality required for 2.1B, 3.2B, 3…
outsidethecode Aug 15, 2023
406b6d6
Merge branch 'hyperledger:main' into lock-assertion-lock-assertion-re…
outsidethecode Aug 21, 2023
c537d36
Merge branch 'hyperledger:main' into satp
outsidethecode Aug 21, 2023
d3afbe2
First iteration of switching to real driver (fabric)
outsidethecode Aug 21, 2023
1e53b2d
Added the required functions to call back the gateway after the asset…
outsidethecode Aug 23, 2023
c1fbb46
Colorful log to show different stages and steps
outsidethecode Aug 29, 2023
ae0aa5a
Initial commit for create-asset, extinguish, and assign-asset
outsidethecode Aug 31, 2023
e7b7d38
Added the resources required to assign an asset
outsidethecode Sep 11, 2023
9543ac6
uncommented the perform lock part
outsidethecode Sep 12, 2023
63ea77b
Merge branch 'hyperledger:main' into satp
outsidethecode Sep 19, 2023
4d5f6c2
implemented the lock assertion method
outsidethecode Aug 2, 2023
d25842c
Added the lock-assertion-receipt and lock-assertion-broadcast methods
outsidethecode Aug 2, 2023
d10ef02
Added the request to the driver to lock an asset
outsidethecode Aug 3, 2023
f61d126
corrected some variable names
outsidethecode Aug 4, 2023
a26af14
Added the endpoints corresponding to the steps 3.1 to 3.9
outsidethecode Aug 9, 2023
3c12959
Implemented the step 2.1B so that the driver call the gateway to upda…
outsidethecode Aug 14, 2023
b8c1786
Implemented the status check functionality required for 2.1B, 3.2B, 3…
outsidethecode Aug 15, 2023
5791f2f
First iteration of switching to real driver (fabric)
outsidethecode Aug 21, 2023
7c8dc17
Added the required functions to call back the gateway after the asset…
outsidethecode Aug 23, 2023
92fb3d3
initial commit
outsidethecode Aug 29, 2023
2dfb321
Initial commit for create-asset, extinguish, and assign-asset
outsidethecode Aug 31, 2023
e298f15
Added the resources required to assign an asset
outsidethecode Sep 11, 2023
440c140
uncommented the perform lock part
outsidethecode Sep 12, 2023
0ed12e9
corrected compile error due to merging issue
outsidethecode Sep 19, 2023
099c946
Squashed commit: first implementation version of satp
outsidethecode Aug 2, 2023
16158cb
Merge branch 'satp-version-3' of https://github.com/outsidethecode/ca…
outsidethecode Sep 19, 2023
77a7d1e
Merge pull request #4 from outsidethecode/satp-version-1
outsidethecode Oct 3, 2023
410e843
Initial documentation on how to run the satp gateway and test it
outsidethecode Oct 3, 2023
7345523
Merge pull request #5 from outsidethecode/satp-version-3
outsidethecode Oct 3, 2023
cae117a
feat(weaver): add application logs
RafaelAPB Oct 6, 2023
33703d2
Initial log functionality
outsidethecode Oct 16, 2023
64ce8b3
feat: log statements are stored in sqlite db
outsidethecode Oct 30, 2023
69fac14
feat: updated the .gitignore file
outsidethecode Oct 30, 2023
3c55604
feat: added log entries to all requests
outsidethecode Oct 31, 2023
1b7a268
feat: removed the unnecessary
outsidethecode Nov 2, 2023
9c308aa
feat: removed unnecessary comments
outsidethecode Nov 2, 2023
42e216a
feat: added the missing methods in driver
outsidethecode Nov 3, 2023
7ab00eb
feat: remove the unnecessary log statements
outsidethecode Nov 4, 2023
77ced9e
feat: initial rfcs for satp
outsidethecode Nov 22, 2023
3a23215
Merge branch 'satp' into lock-assertion-lock-assertion-receipt
outsidethecode Nov 27, 2023
b14148c
Merge pull request #2 from outsidethecode/lock-assertion-lock-asserti…
outsidethecode Nov 27, 2023
a3b5f6a
Merge branch 'satp' into satp-version-3
outsidethecode Nov 27, 2023
098ea07
Merge pull request #7 from outsidethecode/satp-version-3
outsidethecode Nov 27, 2023
347d3ec
Merge pull request #8 from outsidethecode/satp-rfcs
outsidethecode Nov 27, 2023
b552f18
initial satp github action script
outsidethecode Nov 27, 2023
55f0af8
corrected the github actions
outsidethecode Nov 28, 2023
3f16312
Merge pull request #9 from outsidethecode/github-actions
outsidethecode Nov 28, 2023
db7ff82
Corrected the protoc version to be 3.17.3 and rebuild
outsidethecode Dec 11, 2023
b890ffc
feat: initial rfcs for satp
outsidethecode Nov 22, 2023
fd80261
initial satp github action script
outsidethecode Nov 27, 2023
cb4dbaf
corrected the github actions
outsidethecode Nov 28, 2023
069a969
Corrected the protoc version to be 3.17.3 and rebuild
outsidethecode Dec 11, 2023
c7a74e2
Merge branch 'satp' of https://github.com/outsidethecode/cacti into satp
outsidethecode Jan 3, 2024
91ba0b8
Merge branch 'satp-final' into satp
outsidethecode Jan 3, 2024
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
200 changes: 200 additions & 0 deletions .github/workflows/test_weaver-fabric-fabric-satp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: CC-BY-4.0

name: Secure Test Asset Transfer

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
fabric-fabric-satp-local:
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up Docker Compose
run: |
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

- name: Install Yarn
run: npm install -g yarn

- name: Install Envsubst
run: apt-get update && apt-get install gettext-base

- name: Set up JDK 8
uses: actions/[email protected]
with:
java-version: '8'
distribution: 'adopt'

- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.20.2'

- name: Use Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x

- name: Install RUST Toolchain minimal stable with clippy and rustfmt
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy

- name: Get Latest Relay Dependencies
run: |
make protos-local
cargo update -p nom
cargo update -p lexical-core
working-directory: weaver/core/relay

- name: Use Protoc 3.15
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# FABRIC NETWORK
- name: Start Fabric Network
run: make start-interop-local CHAINCODE_NAME=satpsimpleasset
working-directory: weaver/tests/network-setups/fabric/dev

# PROTOS GO
- name: Build GO Protos
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
make build
working-directory: weaver/common/protos-go

# PROTOS JS
- name: Build JS Protos
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
make build
working-directory: weaver/common/protos-js

# Build Dependencies
- name: Build Fabric Interop SDK
run: make build-local
working-directory: weaver/sdks/fabric/interoperation-node-sdk

- name: Build Fabric CLI
run: make build-local
working-directory: weaver/samples/fabric/fabric-cli

- name: Build Relay
run: make
working-directory: weaver/core/relay

- name: Build Fabric Driver
run: make build-local
working-directory: weaver/core/drivers/fabric-driver

# GATEWAY
- name: Start Relay for network1 and network2
run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin server &> gateway.out &
working-directory: weaver/core/relay

# FABRIC DRIVER
- name: Setup Fabric Driver .env
run: |
cp .env.satp.template .env
sed -i "s#<PATH-TO-WEAVER>#${GITHUB_WORKSPACE}/weaver#g" .env
working-directory: weaver/core/drivers/fabric-driver

- name: Start Fabric Driver for network1 and network2
run: npm run dev &> fdriver.out &
working-directory: weaver/core/drivers/fabric-driver

# FABRIC CLI
- name: Setup Fabric CLI ENV
run: |
echo ${GITHUB_WORKSPACE}
cp .env.template .env
./bin/fabric-cli env set-file ./.env
./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials
./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json
./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE satpsimpleasset
./bin/fabric-cli env set REMOTE_CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/remote-network-config.json
./bin/fabric-cli env set CHAINCODE_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/chaincode.json
cat .env
working-directory: weaver/samples/fabric/fabric-cli

- name: Setup Fabric CLI Config
run: |
echo ${GITHUB_WORKSPACE}
cp config.satp.template.json config.json
sed -i "s#<PATH-TO-WEAVER>#${GITHUB_WORKSPACE}/weaver#g" config.json
###### Change line number in following commands if config is modified #####
./bin/fabric-cli config set network2 aclPolicyPrincipalType ca
./bin/fabric-cli config set network1 chaincode satpsimpleasset
./bin/fabric-cli config set network2 chaincode satpsimpleasset
cp chaincode.json.template chaincode.json
cp remote-network-config.json.template remote-network-config.json
working-directory: weaver/samples/fabric/fabric-cli

- name: Fabric CLI Init
run: |
./bin/fabric-cli configure create all --local-network=network1
./bin/fabric-cli configure create all --local-network=network2
./bin/fabric-cli configure network --local-network=network1
./bin/fabric-cli configure network --local-network=network2
./scripts/initAsset.sh
working-directory: weaver/samples/fabric/fabric-cli

# CLIENT
- name: Start the client to initiate the satp protocol
run: cargo run --bin satp_client "9085" "localhost:9085/Dummy_Network/abc:abc:abc:abc" &> client.out &
working-directory: weaver/core/relay

# Test SATP
- name: Test SATP
run: |
COUNT=0
TOTAL=1

./bin/fabric-cli chaincode query --user=bob mychannel satpsimpleasset ReadAsset '["bond01","a04"]' --local-network=network1 &> tmp.out
cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

# RESULT
echo "Passed $COUNT/$TOTAL Tests."

if [ $COUNT == $TOTAL ]; then
exit 0
else
exit 1
fi
working-directory: weaver/samples/fabric/fabric-cli

- name: DEBUG Logs - fabric n1 and n2 gateway
if: failure()
run: cat weaver/core/relay/gateway.out

- name: DEBUG Logs - fabric n1 and n2 driver
if: failure()
run: cat weaver/core/drivers/fabric-driver/fdriver.out
Loading
Loading