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

CXTMOS Create Proof Transactions (scaling operator proof transactions for ewm-proofchain) #281

Open
wants to merge 39 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e018cdc
add script to extract pub key, account and send tx
noslav Aug 15, 2024
a44e573
send bank tx with funds using two cosmos accounts
noslav Aug 15, 2024
17c72e4
go mod tidy for go-1.22.5
noslav Aug 15, 2024
b966a4e
regen account, pub key using cosmos-sdk secp256k1 lib
noslav Aug 15, 2024
9223d1a
auto generated test account keys with unarmoured hex
noslav Aug 15, 2024
b8a28dc
run script, gen accounts, send tx, get balance
noslav Aug 16, 2024
ee2e72c
update test keys with david
noslav Aug 16, 2024
7462469
rename script; enable extraction of sequences
noslav Aug 19, 2024
d36a2f9
get both sequence, account numbers and final balance post tx
noslav Aug 19, 2024
947bf77
describe main process and remove unused fn calls
noslav Aug 19, 2024
8ebc956
import covenet v0.1.0 and use types
noslav Aug 20, 2024
ece8306
add test keys generated from covenet exec
noslav Aug 20, 2024
3e46175
replace with covenet test keys and address derivation
noslav Aug 20, 2024
5b1dfdf
add new test keys and migrate to covenet docker data volume
noslav Aug 20, 2024
3afb272
rename for finalizing with cxtmos
noslav Aug 20, 2024
6be85d8
update deps; run tx.go
noslav Aug 21, 2024
e03592f
replace simapp config with covenet config for send proof
noslav Aug 21, 2024
2fff748
add covenet grpc url and key config
noslav Aug 22, 2024
951c18b
pick up covenet config from env vars
noslav Aug 22, 2024
31b669a
call covenet node for sending proof tx
noslav Aug 22, 2024
119c7c2
create covenet package enabling proof txs
noslav Aug 22, 2024
23fee69
setup covenet interactor for agent node
noslav Aug 22, 2024
b2cc22b
enable covenet chain with bsp-agent tx run
noslav Aug 22, 2024
fdec3fb
use internal covalenthq/covenet package
noslav Aug 22, 2024
16ae144
fix dependency import naming convention
noslav Aug 26, 2024
1758883
enable docker image to pull covenet private dependency
noslav Aug 26, 2024
5d7fdba
remove expired proof chain links in compose run
noslav Aug 26, 2024
7215829
create proof tx with retry limit; prevent crashing if error is trivial
noslav Aug 29, 2024
5f0d807
refactor with caching optimization for a/c, num, seq, address
noslav Aug 30, 2024
1bd4303
depend on public ewm-types instead of covenet
noslav Aug 30, 2024
a42eedd
remove mentions of covenet
noslav Aug 30, 2024
12b4f6e
depend entirely on public repo ewm-types
noslav Aug 30, 2024
259df16
redirect proof txs to ewm-node
noslav Aug 30, 2024
9ce8919
rename package for marketing convenience
noslav Aug 30, 2024
a26c5c4
linter recom fixes for scripts and ewm packages
noslav Aug 30, 2024
e13c986
modify workflows for golangci-lint
noslav Aug 30, 2024
54c1f28
provide patent protection to users/contributors; ensure modification …
noslav Sep 4, 2024
17daf82
move block divisor to 1; proof every single block specimen
noslav Sep 4, 2024
56f9b4f
refactor unexported functions and consts
noslav Sep 4, 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
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM golang:1.22-alpine as builder
RUN mkdir /build
WORKDIR /build
COPY . .
RUN apk add --no-cache git
RUN go env -w GOPRIVATE=github.com/covalenthq
ARG GIT_TOKEN
RUN git config --global url."https://noslav:${GIT_TOKEN}@github.com".insteadOf "https://github.com"

RUN go mod download
# Build the services
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -o bsp-agent ./cmd/bspagent
Expand All @@ -12,7 +17,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -o bsp-extractor-2 ./s
FROM alpine:3.20
RUN mkdir /app
WORKDIR /app
RUN apk update && apk add --no-cache bash
RUN apk update && apk add --no-cache bash git
RUN mkdir -p bin/block-ethereum bin/block-elrond
COPY --from=builder /build/bsp-agent /app
COPY --from=builder /build/entry.sh /app
Expand Down
107 changes: 107 additions & 0 deletions docker-compose-covenet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
version: "3"

services:
ipfs-pinner:
image: "us-docker.pkg.dev/covalent-project/network/ipfs-pinner:stable"
volumes:
- ~/.ipfs:/root/.ipfs/
container_name: ipfs-pinner
restart: on-failure
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:
- W3_AGENT_KEY=${W3_AGENT_KEY}
- W3_DELEGATION_FILE=${W3_DELEGATION_FILE}
- PROOF_OUT_HEX=${PROOF_OUT_HEX}
networks:
- cqt-net
ports:
- "4001:4001"
- "3001:3001"

redis:
image: redis:alpine
container_name: redis-srv
restart: always
expose:
- 6379
volumes:
- ./data/redis:/data
- ./data/redis/redis.conf:/usr/local/etc/redis/redis.conf
environment:
- REDIS_REPLICATION_MODE=master
networks:
- cqt-net
entrypoint: redis-server #/usr/local/etc/redis/redis.conf
ports:
- "6379:6379"

redis-commander:
image: rediscommander/redis-commander:latest
container_name: redis-commander-web
hostname: redis-commander
restart: always
depends_on:
- redis
environment:
- REDIS_HOSTS=local:redis:6379
networks:
- cqt-net
ports:
- "8081:8081"

covenet:
image: us-docker.pkg.dev/covalent-project/network/covenet:pre
container_name: covenet-node
restart: always
entrypoint: >
/bin/bash -l -c "
./covenetd start --home /apps/data/.covenet/;"
networks:
- cqt-net
ports:
- "26657:26657"
- "26656:26656"
- "6060:6060"
- "9090:9090"
- "1317:1317"

agent:
image: "us-docker.pkg.dev/covalent-project/network/bsp-agent:pre"
container_name: bsp-agent
restart: on-failure
depends_on:
covenet:
condition: service_started
volumes:
- /Users/pranay/.config/gcloud:/app/gcloud
entrypoint: >
/bin/bash -l -c "
echo Waiting for Covenet to be deployed...;
# while ! nc -v -l -k -p 8008;
# do
sleep 10;
# done;
# echo proof-chain contracts deployed!;
./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}
- MB_RPC_URL=${RPC_URL}
- BLOCKCHAIN=${BLOCKCHAIN}
- COVENET_PRIVATE_KEY=${COVENET_PRIVATE_KEY}
- COVENET_GRPC_URL=${COVENET_GRPC_URL}
networks:
- cqt-net
ports:
- "8080:8080"

networks:
cqt-net:
163 changes: 143 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
module github.com/covalenthq/bsp-agent

go 1.22.5
go 1.22

toolchain go1.22.5

require (
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2
github.com/banzaicloud/logrus-runtime-formatter v0.0.0-20190729070250-5ae5475bae5e
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/covalenthq/lenspath v0.3.2
github.com/covalenthq/lumberjack/v3 v3.0.1
github.com/elodina/go-avro v0.0.0-20160406082632-0c8185d9a3ba
github.com/ethereum/go-ethereum v1.14.8
github.com/ethereum/go-ethereum v1.14.7
github.com/go-redis/redis/v7 v7.4.1
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
github.com/gorilla/websocket v1.5.3
Expand All @@ -20,49 +22,162 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/ubiq/go-ubiq v3.0.1+incompatible
golang.org/x/sys v0.24.0
google.golang.org/api v0.122.0 // indirect
google.golang.org/api v0.128.0 // indirect
gopkg.in/avro.v0 v0.0.0-20171217001914-a730b5802183
)

require (
cloud.google.com/go/bigquery v1.50.0 // indirect
github.com/cosmos/cosmos-sdk v0.46.12
github.com/covalenthq/covenet v0.1.0
google.golang.org/grpc v1.64.1
)

require (
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/errors v1.0.0-beta.7 // indirect
cosmossdk.io/math v1.0.0-beta.3 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect
github.com/apache/arrow/go/v12 v12.0.0 // indirect
github.com/apache/arrow/go/v7 v7.0.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aws/aws-sdk-go v1.40.45 // indirect
github.com/benbjohnson/immutable v0.3.0 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/cosmos/ibc-go/v5 v5.0.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gofrs/uuid v3.3.0+incompatible // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gofrs/uuid v4.3.0+incompatible // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.6.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/ignite/cli v0.25.1 // indirect
github.com/ignite/modules v0.0.0-20220912090139-7c325cae763a // indirect
github.com/inconshreveable/mousetrap v1.0.1 // 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/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.13.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/fundraising v0.3.1 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tendermint/spn v0.2.1-0.20220921200247-8bafad876bdd // indirect
github.com/tendermint/tendermint v0.34.27 // indirect
github.com/tendermint/tm-db v0.6.7 // indirect
github.com/tidwall/btree v1.5.0 // indirect
github.com/uber/jaeger-client-go v2.28.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/xlab/treeprint v1.0.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go v0.110.8 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
Expand All @@ -72,19 +187,18 @@ require (
github.com/fatih/color v1.17.0
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // 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.14.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.20 // 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
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
Expand All @@ -106,15 +220,24 @@ require (
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/ybbus/httpretry v1.0.2
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/tools v0.20.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
lukechampine.com/blake3 v1.1.6 // indirect
)

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27
golang.org/x/crypto => github.com/noslav/go-crypto v0.24.11
)
Loading
Loading