Skip to content

Commit b8a1414

Browse files
authored
Merge pull request #3 from datachainlab/fix-demo
Fix demo and update README.md
2 parents c573acc + ae8883d commit b8a1414

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

.github/workflows/demo.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99
jobs:
1010
demo:
1111
name: demo
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Set up Go 1.16
1515
uses: actions/setup-go@v1
1616
with:
1717
go-version: 1.16
1818
- uses: actions/checkout@v2
1919
- name: Cache go modules
20-
uses: actions/cache@v2
20+
uses: actions/cache@v4
2121
with:
2222
path: |
2323
~/.cache/go-build
@@ -85,15 +85,15 @@ jobs:
8585
working-directory: demo/chains/tendermint
8686
unit-test:
8787
name: unit-test
88-
runs-on: ubuntu-20.04
88+
runs-on: ubuntu-22.04
8989
steps:
9090
- name: Set up Go 1.16
9191
uses: actions/setup-go@v2
9292
with:
9393
go-version: 1.16
9494
- uses: actions/checkout@v2
9595
- name: Cache go modules
96-
uses: actions/cache@v2
96+
uses: actions/cache@v4
9797
with:
9898
path: |
9999
~/.cache/go-build

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ As Atomic commit protocol, [Simple commit protocol](https://datachainlab.github.
66

77
## Requirements
88

9-
- [Go](https://go.dev/) 1.16+
9+
- [Go](https://go.dev/) 1.16–1.18
1010
- [Docker](https://www.docker.com/products/docker-desktop)
1111
- [jq](https://stedolan.github.io/jq/)
1212

@@ -68,6 +68,10 @@ make -C demo network
6868

6969
## Testing the demo
7070

71+
This demo is primarily developed and validated on **Go 1.18**, and is supported on **Go 1.16–1.18**.
72+
**Go 1.19 and later may exhibit unstable behavior** due to dependency and runtime differences.
73+
To ensure a reproducible setup, we **strongly recommend Go 1.18**.
74+
7175
```Makefile
7276
# initialize relayer, fabric CLI, tendermint CLI, and run handshake for IBC between fabric and tendermint by creating transactions.
7377
make -C demo run-init

demo/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# `-j` option (short for –jobs) specifies the number of jobs that are run at the same time
44
.PHONY: build
55
build:
6-
make -C ../relayer build && mkdir -p ./bin && cp ../relayer/build/uly ./bin/ & \
7-
make -C chains/fabric bin & \
8-
cd chains/tendermint && go mod vendor && make docker-images & \
9-
make -C ../cmds/alpha build & \
6+
make -C ../relayer build && mkdir -p ./bin && cp ../relayer/build/uly ./bin/
7+
make -C chains/fabric bin
8+
cd chains/tendermint && go mod vendor && make docker-images
9+
make -C ../cmds/alpha build
1010
make -C ../cmds/beta build
1111

1212
.PHONY: network

demo/chains/fabric/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ network:
1818

1919
.PHONY: network-common
2020
network-common:
21-
IMAGE_TAG=${FABRIC_VERSION} ${DOCKER_COMPOSE} up -d \
21+
FABRIC_PLATFORM=${FABRIC_PLATFORM} IMAGE_TAG=${FABRIC_VERSION} ${DOCKER_COMPOSE} up -d \
2222
fabric-orderer.fabric-tendermint-cross-demo.com \
2323
fabric-peer0.org1.fabric-tendermint-cross-demo.com
2424

2525
.PHONY: network-chaincode
2626
network-chaincode:
27-
IMAGE_TAG=${FABRIC_VERSION} ${DOCKER_COMPOSE} up -d \
27+
FABRIC_PLATFORM=${FABRIC_PLATFORM} IMAGE_TAG=${FABRIC_VERSION} ${DOCKER_COMPOSE} up -d \
2828
fabric-chaincode.org1.fabric-tendermint-cross-demo.com
2929

3030
.PHONY: network-down
3131
network-down:
32-
IMAGE_TAG=${FABRIC_VERSION} ${DOCKER_COMPOSE} down -v --remove-orphans
32+
FABRIC_PLATFORM=${FABRIC_PLATFORM} IMAGE_TAG=${FABRIC_VERSION} ${DOCKER_COMPOSE} down -v --remove-orphans
3333

3434
.PHONY: clean
3535
clean:

demo/chains/fabric/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
fabric-orderer.fabric-tendermint-cross-demo.com:
88
container_name: fabric-orderer.fabric-tendermint-cross-demo.com
99
image: hyperledger/fabric-orderer:${IMAGE_TAG}
10+
platform: ${FABRIC_PLATFORM}
1011
environment:
1112
- FABRIC_LOGGING_SPEC=INFO
1213
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
@@ -31,6 +32,7 @@ services:
3132
fabric-peer0.org1.fabric-tendermint-cross-demo.com:
3233
container_name: fabric-peer0.org1.fabric-tendermint-cross-demo.com
3334
image: hyperledger/fabric-peer:${IMAGE_TAG}
35+
platform: ${FABRIC_PLATFORM}
3436
environment:
3537
- FABRIC_LOGGING_SPEC=INFO
3638
- CORE_PEER_ID=fabric-peer0.org1.fabric-tendermint-cross-demo.com

demo/chains/fabric/scripts/startCC.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ CHAINCODE_CCID_ORG1=$(cat ${PROJECT_DIR}/build/Org1-fabibc-ccid.txt)
88

99
set -x
1010
CHAINCODE_CCID_ORG1=${CHAINCODE_CCID_ORG1} \
11-
docker-compose -f docker-compose-chaincode.yaml up -d \
11+
docker compose -f docker-compose-chaincode.yaml up -d \

demo/var.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
DOCKER ?= docker
2-
DOCKER_COMPOSE ?= docker-compose
2+
DOCKER_COMPOSE ?= docker compose
33
DOCKER_REPO ?= ""
44
DOCKER_BUILD ?= $(DOCKER) build --rm --no-cache --pull
55

66
MAKEFILE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
77

88
FABRIC_VERSION ?=2.2.0
99
FABRIC_CA_VERSION ?=1.4.7
10+
FABRIC_PLATFORM ?=linux/amd64
1011

1112
TENDERMINT_TAG ?= latest
1213

0 commit comments

Comments
 (0)