Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b64032282b | ||
|
|
e9ec4a23dd | ||
|
|
24f7fd5e97 | ||
|
|
01cb9fb46c | ||
|
|
18518e7cb5 | ||
|
|
d1455a9cbd | ||
|
|
b699663536 | ||
|
|
e09975d0c8 |
@@ -17,9 +17,9 @@ jobs:
|
||||
- name: Run docker build
|
||||
run: make docker-build
|
||||
- name: Tag docker image
|
||||
run: docker tag cerc-io/tx_spammer git.vdb.to/cerc-io/tx_spammer/tx_spammer:${{steps.vars.outputs.sha}}
|
||||
run: docker tag cerc-io/tx-spammer git.vdb.to/cerc-io/tx-spammer/tx-spammer:${{steps.vars.outputs.sha}}
|
||||
- name: Docker Login
|
||||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://git.vdb.to -u cerc-io --password-stdin
|
||||
- name: Docker Push
|
||||
run: docker push git.vdb.to/cerc-io/tx_spammer/tx_spammer:${{steps.vars.outputs.sha}}
|
||||
run: docker push git.vdb.to/cerc-io/tx-spammer/tx-spammer:${{steps.vars.outputs.sha}}
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ jobs:
|
||||
- name: Docker Login to Github Registry
|
||||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://git.vdb.to -u vulcanize --password-stdin
|
||||
- name: Docker Pull
|
||||
run: docker pull git.vdb.to/cerc-io/tx_spammer/tx_spammer:${{steps.vars.outputs.sha}}
|
||||
run: docker pull git.vdb.to/cerc-io/tx-spammer/tx-spammer:${{steps.vars.outputs.sha}}
|
||||
- name: Docker Login to Docker Registry
|
||||
run: echo ${{ secrets.VULCANIZEJENKINS_PAT }} | docker login -u vulcanizejenkins --password-stdin
|
||||
- name: Tag docker image
|
||||
run: docker tag git.vdb.to/cerc-io/tx_spammer/tx_spammer:${{steps.vars.outputs.sha}} cerc-io/tx_spammer:${{steps.vars.outputs.tag}}
|
||||
run: docker tag git.vdb.to/cerc-io/tx-spammer/tx-spammer:${{steps.vars.outputs.sha}} cerc-io/tx-spammer:${{steps.vars.outputs.tag}}
|
||||
- name: Docker Push to Docker Hub
|
||||
run: docker push cerc-io/tx_spammer:${{steps.vars.outputs.tag}}
|
||||
run: docker push cerc-io/tx-spammer:${{steps.vars.outputs.tag}}
|
||||
|
||||
|
||||
+7
-3
@@ -1,13 +1,17 @@
|
||||
FROM golang:1.19-alpine as builder
|
||||
|
||||
RUN apk --update --no-cache add make git g++ linux-headers
|
||||
RUN apk --update --no-cache add gcc libc-dev
|
||||
# DEBUG
|
||||
RUN apk add busybox-extras
|
||||
|
||||
# Get and build tx-spammer
|
||||
ADD . /go/src/github.com/cerc-io/tx-spammer
|
||||
WORKDIR /go/src/github.com/cerc-io/tx-spammer
|
||||
RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o tx-spammer .
|
||||
|
||||
ENV GO111MODULE=on
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o tx-spammer .
|
||||
|
||||
# app container
|
||||
FROM alpine
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ func Execute() {
|
||||
}
|
||||
|
||||
func initFuncs(cmd *cobra.Command, args []string) {
|
||||
logfile := viper.GetString("logfile")
|
||||
logfile := viper.GetString("log.file")
|
||||
if logfile != "" {
|
||||
file, err := os.OpenFile(logfile,
|
||||
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
||||
@@ -65,7 +65,7 @@ func initFuncs(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
|
||||
func logLevel() error {
|
||||
viper.BindEnv("log.level", "LOGRUS_LEVEL")
|
||||
viper.BindEnv("log.level", "LOG_LEVEL")
|
||||
lvl, err := log.ParseLevel(viper.GetString("log.level"))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,57 +1,73 @@
|
||||
module github.com/cerc-io/tx-spammer
|
||||
|
||||
go 1.13
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-pipeline-go v0.2.2 // indirect
|
||||
github.com/Azure/azure-storage-blob-go v0.7.0 // indirect
|
||||
github.com/Azure/go-autorest/autorest/adal v0.8.0 // indirect
|
||||
github.com/StackExchange/wmi v1.2.1 // indirect
|
||||
github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 // indirect
|
||||
github.com/aws/aws-sdk-go v1.25.48 // indirect
|
||||
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c // indirect
|
||||
github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
|
||||
github.com/coreos/bbolt v1.3.2 // indirect
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
|
||||
github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa // indirect
|
||||
github.com/ethereum/go-ethereum v1.10.25
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-stack/stack v1.8.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.2.0 // indirect
|
||||
github.com/jonboulle/clockwork v0.1.0 // indirect
|
||||
github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 // indirect
|
||||
github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff // indirect
|
||||
github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521 // indirect
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
|
||||
github.com/ethereum/go-ethereum v1.11.5
|
||||
github.com/sirupsen/logrus v1.9.0
|
||||
github.com/soheilhy/cmux v0.1.4 // indirect
|
||||
github.com/spf13/afero v1.9.2 // indirect
|
||||
github.com/spf13/cobra v1.6.0
|
||||
github.com/spf13/viper v1.13.0
|
||||
github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect
|
||||
github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.5.0 // indirect
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
|
||||
github.com/urfave/cli v1.22.1 // indirect
|
||||
github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 // indirect
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
go.etcd.io/bbolt v1.3.2 // indirect
|
||||
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
|
||||
golang.org/x/sys v0.1.0 // indirect
|
||||
golang.org/x/text v0.4.0 // indirect
|
||||
gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200316214253-d7b0ff38cac9 // indirect
|
||||
gopkg.in/resty.v1 v1.12.0 // indirect
|
||||
gopkg.in/sourcemap.v1 v1.0.5 // indirect
|
||||
gopkg.in/urfave/cli.v1 v1.20.0 // indirect
|
||||
gotest.tools v2.2.0+incompatible // indirect
|
||||
)
|
||||
|
||||
replace github.com/ethereum/go-ethereum v1.9.10 => github.com/vulcanize/go-ethereum v1.9.10-optimism-0.0.2
|
||||
require (
|
||||
github.com/DataDog/zstd v1.5.2 // indirect
|
||||
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cockroachdb/errors v1.9.1 // indirect
|
||||
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
|
||||
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
|
||||
github.com/cockroachdb/redact v1.1.3 // indirect
|
||||
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/getsentry/sentry-go v0.18.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-stack/stack v1.8.1 // indirect
|
||||
github.com/gofrs/flock v0.8.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
|
||||
github.com/holiman/uint256 v1.2.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
||||
github.com/klauspost/compress v1.15.15 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/common v0.39.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
|
||||
github.com/spf13/afero v1.9.2 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.4.1 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.5.0 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
golang.org/x/crypto v0.1.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
golang.org/x/text v0.7.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
+3
-2
@@ -21,7 +21,6 @@ import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"math/big"
|
||||
@@ -29,13 +28,15 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -18,12 +18,13 @@ package auto
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"github.com/sirupsen/logrus"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+1
-1
@@ -17,10 +17,10 @@
|
||||
package auto
|
||||
|
||||
import (
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
)
|
||||
|
||||
// EthSender sends eth value transfer txs
|
||||
|
||||
+1
-1
@@ -19,8 +19,8 @@ package auto
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Spammer underlying struct type for spamming service
|
||||
|
||||
@@ -19,16 +19,17 @@ package auto
|
||||
import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
)
|
||||
|
||||
// TxGenerator generates and signs txs
|
||||
|
||||
@@ -2,10 +2,11 @@ package auto
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/sirupsen/logrus"
|
||||
"time"
|
||||
)
|
||||
|
||||
type TxWatcher struct {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package manual
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type Spammer struct {
|
||||
|
||||
@@ -19,10 +19,10 @@ package manual
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/cerc-io/tx-spammer/pkg/shared"
|
||||
)
|
||||
|
||||
// TxGenerator generates and signs txs
|
||||
|
||||
+9
-8
@@ -18,35 +18,36 @@ package shared
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/sirupsen/logrus"
|
||||
"math/big"
|
||||
"os"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
)
|
||||
|
||||
// ChainConfig returns the appropriate ethereum chain config for the provided chain id
|
||||
// TxSigner returns the London signer at the provided block height
|
||||
func TxSigner(chainID *big.Int) types.Signer {
|
||||
return types.NewLondonSigner(chainID)
|
||||
}
|
||||
|
||||
// SendTransaction sends a signed tx using the provided client
|
||||
func SendTransaction(rpcClient *rpc.Client, tx *types.Transaction) error {
|
||||
msg, _ := tx.AsMessage(TxSigner(tx.ChainId()), big.NewInt(1))
|
||||
msg, _ := core.TransactionToMessage(tx, TxSigner(tx.ChainId()), big.NewInt(1))
|
||||
if nil == tx.To() {
|
||||
logrus.Debugf("TX %s to create contract %s (sender %s)",
|
||||
tx.Hash().Hex(), crypto.CreateAddress(msg.From(), tx.Nonce()), msg.From().Hex())
|
||||
tx.Hash().Hex(), crypto.CreateAddress(msg.From, tx.Nonce()), msg.From.Hex())
|
||||
} else if nil == tx.Data() || len(tx.Data()) == 0 {
|
||||
logrus.Debugf("TX %s sending %s Wei to %s (sender %s)",
|
||||
tx.Hash().Hex(), tx.Value().String(), msg.To().Hex(), msg.From().Hex())
|
||||
tx.Hash().Hex(), tx.Value().String(), tx.To().Hex(), msg.From.Hex())
|
||||
} else {
|
||||
logrus.Debugf("TX %s calling contract %s (sender %s)",
|
||||
tx.Hash().Hex(), msg.To().Hex(), msg.From().Hex())
|
||||
tx.Hash().Hex(), tx.To().Hex(), msg.From.Hex())
|
||||
}
|
||||
|
||||
data, err := tx.MarshalBinary()
|
||||
|
||||
Reference in New Issue
Block a user