Skip to content

Commit

Permalink
Merge pull request #231 from covalenthq/develop
Browse files Browse the repository at this point in the history
Bsp-agent-DTM-RC:v1.5.0
  • Loading branch information
noslav authored Jan 24, 2024
2 parents b22fc4b + 6588b70 commit 6366dfc
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 87 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,21 @@ jobs:
- name: Create .env file
run: |
touch .env
echo PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} >> .env
echo RPC_URL=${{ secrets.RPC_URL }} >> .env
echo WEB3_JWT=${{ secrets.WEB3_JWT }} >> .env
{
echo "PRIVATE_KEY=${{ secrets.PRIVATE_KEY }}"
echo "RPC_URL=${{ secrets.RPC_URL }}"
echo "WEB3_JWT=${{ secrets.WEB3_JWT }}"
echo "W3_AGENT_KEY=${{ secrets.W3_AGENT_KEY }}"
echo "PROOF_OUT_HEX=${{ secrets.PROOF_OUT_HEX }}"
echo "W3_DELEGATION_FILE=${{ secrets.W3_DELEGATION_FILE }}"
} >> .env
cat .env
- name: Load .env file
uses: xom9ikk/[email protected]

- name: Run containers
run: docker-compose -f "docker-compose-ci.yml" up --build --remove-orphans --exit-code-from agent
run: docker-compose --env-file ".env" -f "docker-compose-ci.yml" up --build --remove-orphans --exit-code-from agent

- name: Check running agent
run: docker inspect bsp-agent
Expand Down
Binary file modified data/redis/dump.rdb
Binary file not shown.
22 changes: 16 additions & 6 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@ version: '3'

services:
ipfs-pinner:
image: "gcr.io/covalent-project/ipfs-pinner:latest"
image: "us-docker.pkg.dev/covalent-project/network/ipfs-pinner:stable"
volumes:
- ~/.ipfs:/root/.ipfs/
container_name: ipfs-pinner
restart: on-failure
expose:
- 4001
- 3000
entrypoint: |
/bin/bash -l -c "
touch proof_out_hex.txt;
chmod +x proof_out_hex.txt;
echo "$PROOF_OUT_HEX" > proof_out_hex.txt;
xxd -r -p proof_out_hex.txt > proof_from_hex.out;
chmod +x proof_from_hex.out;
mv ./proof_from_hex.out /root/.ipfs/proof_from_hex.out;
./ipfs-server -port 3001 -w3-agent-key $W3_AGENT_KEY -w3-delegation-file $W3_DELEGATION_FILE;"
environment:
- WEB3_JWT=${WEB3_JWT}
- W3_AGENT_KEY=${W3_AGENT_KEY}
- W3_DELEGATION_FILE=${W3_DELEGATION_FILE}
- PROOF_OUT_HEX=${PROOF_OUT_HEX}
networks:
- cqt-net
ports:
- "4001:4001"
- "3000:3000"
- "3001:3001"

redis:
image: redis:alpine
Expand Down
22 changes: 15 additions & 7 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@ version: '3'

services:
ipfs-pinner:
image: "gcr.io/covalent-project/ipfs-pinner:latest"
image: "us-docker.pkg.dev/covalent-project/network/ipfs-pinner:stable"
volumes:
- ~/.ipfs:/root/.ipfs/
container_name: ipfs-pinner
restart: on-failure
expose:
- 4001
- 3000
entrypoint: |
/bin/bash -l -c "
touch proof_out_hex.txt;
chmod +x proof_out_hex.txt;
echo "$PROOF_OUT_HEX" > proof_out_hex.txt;
xxd -r -p proof_out_hex.txt > proof_from_hex.out;
chmod +x proof_from_hex.out;
mv ./proof_from_hex.out /root/.ipfs/proof_from_hex.out;
./ipfs-server -port 3001 -w3-agent-key $W3_AGENT_KEY -w3-delegation-file $W3_DELEGATION_FILE;"
environment:
- WEB3_JWT=${WEB3_JWT}
- W3_AGENT_KEY=${W3_AGENT_KEY}
- W3_DELEGATION_FILE=${W3_DELEGATION_FILE}
- PROOF_OUT_HEX=${PROOF_OUT_HEX}
networks:
- cqt-net
ports:
- "4001:4001"
- "3000:3000"
- "3001:3001"

redis:
image: redis:alpine
Expand Down Expand Up @@ -115,7 +123,7 @@ services:
sleep 1;
done;
echo proof-chain contracts deployed!;
./bsp-agent --redis-url=redis://username:@redis:6379/0?topic=replication-2#replicate --avro-codec-path=./codec/block-ethereum.avsc --binary-file-path=./bin/block-ethereum/ --block-divisor=1 --log-folder ./logs/ --metrics --metrics.port 6063 --metrics.addr 0.0.0.0 --proof-chain-address=0xEa2ff902dbeEECcc828757B881b343F9316752e5 --consumer-timeout=100000 --ipfs-pinner-server="http://ipfs-pinner:3000/";
./bsp-agent --redis-url=redis://username:@redis:6379/0?topic=replication#replicate --avro-codec-path=./codec/block-ethereum.avsc --binary-file-path=./bin/block-ethereum/ --block-divisor=3 --log-folder ./logs/ --metrics --metrics.port 6063 --metrics.addr 0.0.0.0 --proof-chain-address=0xEa2ff902dbeEECcc828757B881b343F9316752e5 --consumer-timeout=100000 --ipfs-pinner-server="http://ipfs-pinner:3001/";
exit 0;"
environment:
- MB_PRIVATE_KEY=${PRIVATE_KEY}
Expand Down
4 changes: 2 additions & 2 deletions entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ then
--websocket-urls="34.69.250.147:20000 34.69.250.147:20001 34.69.250.147:20002 34.69.250.147:20003"

else
./bsp-agent --redis-url=redis://username:@redis:6379/0?topic=replication-2#replicate \
./bsp-agent --redis-url=redis://username:@redis:6379/0?topic=replication#replicate \
--avro-codec-path=./codec/block-ethereum.avsc \
--binary-file-path=./bin/block-ethereum/ \
--block-divisor=3 \
--proof-chain-address=0xea2ff902dbeeeccc828757b881b343f9316752e5 \
--consumer-timeout=15 \
--ipfs-pinner-server="http://ipfs-pinner:3000/"
--ipfs-pinner-server="http://ipfs-pinner:3001/"
fi
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ require (
github.com/ethereum/go-ethereum v1.11.5
github.com/go-redis/redis/v7 v7.4.1
github.com/golang/snappy v0.0.4
github.com/gorilla/websocket v1.5.0
github.com/gorilla/websocket v1.5.1
github.com/ipfs/go-cid v0.1.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/linkedin/goavro/v2 v2.12.0
github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.9.3
github.com/ubiq/go-ubiq v3.0.1+incompatible
golang.org/x/sys v0.15.0
golang.org/x/sys v0.16.0
google.golang.org/api v0.122.0 // indirect
gopkg.in/avro.v0 v0.0.0-20171217001914-a730b5802183
)
Expand All @@ -29,18 +29,19 @@ require (
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect
github.com/apache/arrow/go/v7 v7.0.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/benbjohnson/immutable v0.3.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/deepmap/oapi-codegen v1.8.2 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/goccy/go-json v0.9.11 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gofrs/uuid v3.3.0+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/holiman/uint256 v1.2.0 // indirect
github.com/influxdata/flux v0.170.1 // indirect
github.com/influxdata/influxql v1.1.1-0.20211004132434-7e7d61973256 // indirect
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/rs/cors v1.8.2 // indirect
Expand Down Expand Up @@ -69,13 +70,13 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect
github.com/influxdata/influxdb v1.10.0
github.com/influxdata/influxdb-client-go/v2 v2.12.3
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.13.0
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
Expand Down Expand Up @@ -108,7 +109,7 @@ require (
golang.org/x/sync v0.1.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
lukechampine.com/blake3 v1.1.6 // indirect
)
Loading

0 comments on commit 6366dfc

Please sign in to comment.