Skip to content

Commit

Permalink
remove redundant elrond code
Browse files Browse the repository at this point in the history
Signed-off-by: Pranay Valson <pranay.valson@gmail.com>
  • Loading branch information
noslav committed Jan 16, 2025
1 parent 954ec0c commit adfb68e
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 354 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/elrond-build-skip.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/elrond-build.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ artifacts

ganache_data
temp
out
out
.editorconfig
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM alpine:3.21
RUN mkdir /app
WORKDIR /app
RUN apk update && apk add --no-cache bash
RUN mkdir -p bin/block-ethereum bin/block-elrond
RUN mkdir -p bin/block-ethereum
COPY --from=builder /build/bsp-agent /app
COPY --from=builder /build/entry.sh /app
COPY --from=builder /build/data /app/data
Expand Down
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ run-agent-eth:
--log-folder ./logs/ \
--ipfs-pinner-server="http://127.0.0.1:3000/"

run-agent-elrond:
@echo "---- Running Agent from cmd/bspagent ----"
@go run ./cmd/bspagent/*.go \
--redis-url="redis://username:@localhost:6379/0?topic=replication#replicate" \
--avro-codec-path="./codec/block-elrond.avsc" \
--binary-file-path="./bin/block-elrond/" \
--proof-chain-address=0xbFCa723A2661350f86f397CEdF807D6e596d7874 \
--websocket-urls="34.69.250.147:20000 34.69.250.147:20001 34.69.250.147:20002 34.69.250.147:20003" \
--consumer-timeout=8000 \
--ipfs-pinner-server="http://127.0.0.1:3000/"

test:
@echo "---- Testing Agent from cmd/bspagent ----"
@go test ./... -coverprofile=coverage.out
Expand Down
8 changes: 2 additions & 6 deletions cmd/bspagent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func init() {

func main() {
log.Info("bsp-agent command line config: ", utils.GetConfig(flag.CommandLine))
chainType := getChainFromConfig(agconfig)
chainType := getChainFromConfig()

Check warning on line 68 in cmd/bspagent/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/bspagent/main.go#L68

Added line #L68 was not covered by tests
agentNode = node.NewAgentNode(chainType, agconfig)

setupMetrics()
Expand Down Expand Up @@ -96,11 +96,7 @@ func setupMetrics() {
}
}

func getChainFromConfig(agconfig *config.AgentConfig) node.ChainType {
webSockUrls := agconfig.ChainConfig.WebsocketURLs
if webSockUrls != "" {
return node.Elrond
}
func getChainFromConfig() node.ChainType {

Check failure on line 99 in cmd/bspagent/main.go

View workflow job for this annotation

GitHub Actions / go-lint

unnecessary leading newline (whitespace)

Check warning on line 99 in cmd/bspagent/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/bspagent/main.go#L99

Added line #L99 was not covered by tests

return node.Ethereum
}
Binary file modified data/redis/dump.rdb
Binary file not shown.
28 changes: 9 additions & 19 deletions entry.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
#!/bin/bash
if [ "$BLOCKCHAIN" == "elrond" ]
then
timeout 120s ./bsp-agent --redis-url=redis://username:@redis:6379/0?topic=replication-2#replicate \
--avro-codec-path=./codec/block-elrond.avsc \
--binary-file-path=./bin/block-elrond/ \
--proof-chain-address=0xEa2ff902dbeEECcc828757B881b343F9316752e5\
--consumer-timeout=15 \
--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#replicate \
--avro-codec-path=./codec/block-ethereum.avsc \
--binary-file-path=./bin/block-ethereum/ \
--block-divisor=3 \
--log-folder ./logs/ \
--proof-chain-address=0xEa2ff902dbeEECcc828757B881b343F9316752e5 \
--metrics --metrics.port 6063 --metrics.addr 0.0.0.0 \
--consumer-timeout=15 \
--ipfs-pinner-server="http://ipfs-pinner:3001/"
fi
./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/ \
--proof-chain-address=0xEa2ff902dbeEECcc828757B881b343F9316752e5 \
--metrics --metrics.port 6063 --metrics.addr 0.0.0.0 \
--consumer-timeout=15 \
--ipfs-pinner-server="http://ipfs-pinner:3001/"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/ethereum/go-ethereum v1.14.12
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
github.com/gorilla/websocket v1.5.3 // indirect
github.com/ipfs/go-cid v0.1.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/linkedin/goavro/v2 v2.13.1
Expand Down
Loading

0 comments on commit adfb68e

Please sign in to comment.