From 6a09063415e22e5a6d533d3914d6cf4a9468f3c6 Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Tue, 16 Nov 2021 08:55:31 +1100 Subject: [PATCH 1/8] fix code to get current darknode-cli version --- artifacts/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/update.sh b/artifacts/update.sh index cc6b9b8a..41fe34ee 100755 --- a/artifacts/update.sh +++ b/artifacts/update.sh @@ -37,7 +37,7 @@ main(){ progressBar 40 100 # Update the binary - current=$(darknode --version | grep "darknode-cli version" | cut -d ' ' -f 3) + current=$(darknode --version | grep "Darknode CLI version" | cut -d ' ' -f 4) latest=$(get_latest_release "renproject/darknode-cli") vercomp $current $latest if [ "$?" -eq "2" ]; then From a958641b94e91e5aa01429669ee2863e66c9051a Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Mon, 22 Nov 2021 14:25:17 +1100 Subject: [PATCH 2/8] remove dependency to mercury and use new rpc endpoint --- cmd/down.go | 49 +++++++++++++++++-------------------------------- go.mod | 29 +++++++++++++++++++++++++++-- go.sum | 20 -------------------- 3 files changed, 44 insertions(+), 54 deletions(-) diff --git a/cmd/down.go b/cmd/down.go index 06688c44..57c0006c 100644 --- a/cmd/down.go +++ b/cmd/down.go @@ -15,13 +15,11 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/fatih/color" "github.com/renproject/darknode-cli/darknode" "github.com/renproject/darknode-cli/darknode/bindings" "github.com/renproject/darknode-cli/util" - "github.com/renproject/mercury/sdk/client/ethclient" - "github.com/renproject/mercury/types/ethtypes" - "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -121,13 +119,13 @@ func withdraw(ctx *cli.Context) error { } // Connect to Ethereum - client, err := connect(config.Network) + client, err := ethclient.Dial("https://ren-mercury.herokuapp.com/eth/mainnet") if err != nil { return err } // Create a transactor for ethereum tx - gasPrice, err := client.EthClient().SuggestGasPrice(c) + gasPrice, err := client.SuggestGasPrice(c) if err != nil { return err } @@ -138,7 +136,7 @@ func withdraw(ctx *cli.Context) error { // Check REN balance first renAddress := renAddress(config.Network) - tokenContract, err := bindings.NewERC20(common.HexToAddress(renAddress), client.EthClient()) + tokenContract, err := bindings.NewERC20(common.HexToAddress(renAddress), client) if err != nil { return err } @@ -155,7 +153,7 @@ func withdraw(ctx *cli.Context) error { if err != nil { return err } - receipt, err := bind.WaitMined(c, client.EthClient(), tx) + receipt, err := bind.WaitMined(c, client, tx) if err != nil { return err } @@ -167,15 +165,15 @@ func withdraw(ctx *cli.Context) error { // Check the ETH balance fmt.Println("Checking ETH balance...") - balance, err := client.Balance(c, ethtypes.Address(ethAddr)) + balance, err := client.BalanceAt(c, ethAddr, nil) if err != nil { return err } - gas := ethtypes.Wei(gasPrice.Uint64() * 21000) - zero := ethtypes.Wei(0) - if balance.Gt(zero) { - if balance.Gt(gas) { - tx, err := transfer(auth, receiverAddr, balance.Sub(gas), client) + gas := gasPrice.Mul(gasPrice, big.NewInt(21000)) + zero := big.NewInt(0) + if balance.Cmp(zero) == 1 { + if balance.Cmp(gas) == 1 { + tx, err := transfer(auth, receiverAddr, balance.Sub(balance, gas), client) if err != nil { return err } @@ -190,9 +188,9 @@ func withdraw(ctx *cli.Context) error { } // transfer ETH to the provided address. -func transfer(transactor *bind.TransactOpts, receiver common.Address, amount ethtypes.Amount, client ethclient.Client) (*types.Transaction, error) { - bound := bind.NewBoundContract(receiver, abi.ABI{}, nil, client.EthClient(), nil) - transactor.Value = amount.ToBig() +func transfer(transactor *bind.TransactOpts, receiver common.Address, amount *big.Int, client *ethclient.Client) (*types.Transaction, error) { + bound := bind.NewBoundContract(receiver, abi.ABI{}, nil, client, nil) + transactor.Value = amount transactor.GasLimit = 21000 return bound.Transfer(transactor) } @@ -209,19 +207,6 @@ func renAddress(network darknode.Network) string { } } -// connect to Ethereum. -func connect(network darknode.Network) (ethclient.Client, error) { - logger := logrus.New() - switch network { - case darknode.Mainnet: - return ethclient.New(logger, ethtypes.Mainnet) - case darknode.Testnet, darknode.Devnet: - return ethclient.New(logger, ethtypes.Kovan) - default: - return nil, errors.New("unknown network") - } -} - // nodeStatus returns the registration status of the darknode with given name. func nodeStatus(name string) (status, error) { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) @@ -233,15 +218,15 @@ func nodeStatus(name string) (status, error) { address := crypto.PubkeyToAddress(config.Keystore.Ecdsa.PublicKey) // Connect to Ethereum - client, err := connect(config.Network) + client, err := ethclient.Dial("https://ren-mercury.herokuapp.com/eth/mainnet") if err != nil { return 0, err } - dnrAddr, err := config.DnrAddr(client.EthClient()) + dnrAddr, err := config.DnrAddr(client) if err != nil { return 0, err } - dnr, err := bindings.NewDarknodeRegistry(dnrAddr, client.EthClient()) + dnr, err := bindings.NewDarknodeRegistry(dnrAddr, client) if err != nil { return 0, err } diff --git a/go.mod b/go.mod index f171207c..f16cb58f 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,24 @@ go 1.13 require ( cloud.google.com/go v0.51.0 // indirect + github.com/allegro/bigcache v1.2.1 // indirect + github.com/aristanetworks/goarista v0.0.0-20200310212843-2da4c1f5881b // indirect github.com/aws/aws-sdk-go v1.41.8 github.com/btcsuite/btcd v0.20.1-beta + github.com/cespare/cp v1.1.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/deckarep/golang-set v1.7.1 // indirect + github.com/dgraph-io/badger v1.6.1 // indirect + github.com/dgraph-io/ristretto v0.0.3 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/digitalocean/godo v1.69.1 + github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/elastic/gosigar v0.10.5 // indirect github.com/ethereum/go-ethereum v1.9.6 github.com/fatih/color v1.7.0 + github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.4.3 // indirect github.com/google/go-github/v39 v39.2.0 github.com/google/uuid v1.1.5 // indirect @@ -17,6 +29,7 @@ require ( github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/huin/goupnp v1.0.2 // indirect + github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-base58 v0.0.0-20150317085156-6237cf65f3a6 github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559 // indirect github.com/kr/text v0.2.0 // indirect @@ -24,19 +37,31 @@ require ( github.com/multiformats/go-multiaddr v0.1.1 github.com/multiformats/go-multihash v0.0.8 github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/prometheus/tsdb v0.10.0 // indirect github.com/renproject/aw v0.3.7 - github.com/renproject/mercury v0.3.15 + github.com/renproject/kv v1.1.2 // indirect github.com/renproject/phi v0.1.0 - github.com/sirupsen/logrus v1.4.2 + github.com/rjeczalik/notify v0.9.2 // indirect + github.com/rs/cors v1.7.0 // indirect + github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e // indirect + github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect + github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect github.com/stretchr/testify v1.7.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tyler-smith/go-bip39 v1.0.2 // indirect github.com/urfave/cli v1.22.5 + github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect google.golang.org/api v0.15.0 + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 // indirect + gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index dd0f543d..d4cd91ed 100644 --- a/go.sum +++ b/go.sum @@ -39,11 +39,9 @@ github.com/aws/aws-sdk-go v1.41.8/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= @@ -60,7 +58,6 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/codahale/blake2 v0.0.0-20150924215134-8d10d0420cbf/go.mod h1:BO2rLUAZMrpgh6GBVKi0Gjdqw2MgCtJrtmUdDeZRKjY= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -101,7 +98,6 @@ github.com/elastic/gosigar v0.10.5/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTy github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.9.2/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= -github.com/ethereum/go-ethereum v1.9.5/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/ethereum/go-ethereum v1.9.6 h1:EacwxMGKZezZi+m3in0Tlyk0veDQgnfZ9BjQqHAaQLM= github.com/ethereum/go-ethereum v1.9.6/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= @@ -181,8 +177,6 @@ github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -190,12 +184,10 @@ github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+d github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -218,7 +210,6 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559 h1:0VWDXPNE0brOek1Q8bLfzKkvOzwbQE/snjGojlCr8CY= github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -241,17 +232,13 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20190720004541-5f6b3168e4a0 h1:DmK33IJe81zJOzLmzzBHWf2/fGB0tnvqLnvGu8S5wYY= -github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20190720004541-5f6b3168e4a0/go.mod h1:VVt+rn/itmf+9eZq9CAabVlsfsHveUNUQ0bRv3ChqxY= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo= @@ -272,7 +259,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -324,8 +310,6 @@ github.com/renproject/id v0.1.1/go.mod h1:i4OJzgjl4XLcU7nfU9UshX7PaBVpnTk3gEVj8d github.com/renproject/kv v1.1.0/go.mod h1:B+LKu5xLj9t65LrbsSyzTcgLcPdWCd0qxFEtNB7NRo8= github.com/renproject/kv v1.1.2 h1:P18yHdDVJTEZ9yeyx6o82ICY1m6f+VdtAt/ouZez+AU= github.com/renproject/kv v1.1.2/go.mod h1:78bvdAtYiYxCoT9ihVhl8qdmjl7s9fST/FkRLnZ6rXY= -github.com/renproject/mercury v0.3.15 h1:qPcId0DZy36fMuBZoXzcrZem2fbUXFJ1E2dBDETZNps= -github.com/renproject/mercury v0.3.15/go.mod h1:dxOQMy6wf+Kf8zLN3LGypCeq7jdKVHQUpMW6fsTvsMc= github.com/renproject/phi v0.0.0-20190713013721-51f586bc4816/go.mod h1:Hrxx2ONVpfByficRjyRd1trecalYr0lo7Z0akx8UXqg= github.com/renproject/phi v0.1.0 h1:ZOn7QeDribk/uV46OhQWcTLxyuLg7P+xR1Hfl5cOQuI= github.com/renproject/phi v0.1.0/go.mod h1:Hrxx2ONVpfByficRjyRd1trecalYr0lo7Z0akx8UXqg= @@ -404,7 +388,6 @@ golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -430,7 +413,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -448,7 +430,6 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -497,7 +478,6 @@ golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 339b478354c9807d0f9e226057955c142891a151 Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Mon, 22 Nov 2021 15:44:00 +1100 Subject: [PATCH 3/8] update update script --- artifacts/install.sh | 21 ++++++++------- artifacts/update.sh | 63 ++++++++++++++++++++------------------------ cmd/down.go | 5 ++++ 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/artifacts/install.sh b/artifacts/install.sh index f5436278..8f804b08 100755 --- a/artifacts/install.sh +++ b/artifacts/install.sh @@ -98,13 +98,15 @@ prerequisites() { requiredPatch="$(echo $1 | cut -d. -f3)" if [ "$major" -lt "$requiredMajor" ]; then - err "Please upgrade your terraform to version above $min_terraform_ver" - fi - if [ "$minor" -lt "$requiredMinor" ]; then - err "Please upgrade your terraform to version above $min_terraform_ver" - fi - if [ "$patch" -lt "$requiredPatch" ]; then - err "Please upgrade your terraform to version above $min_terraform_ver" + echo "Please upgrade your terraform to version above $min_terraform_ver" + elif [ "$major" -eq "$requiredMajor" ]; then + if [ "$minor" -lt "$requiredMinor" ]; then + echo "Please upgrade your terraform to version above $min_terraform_ver" + elif [ "$minor" -eq "$requiredMinor" ]; then + if [ "$patch" -lt "$requiredPatch" ]; then + echo "Please upgrade your terraform to version above $min_terraform_ver" + fi + fi fi fi } @@ -141,6 +143,9 @@ check_architecture() { 11.*) # We assume Big Sur will be OK for now ;; + 12.*) + # We assume Monterey will be OK for now + ;; *) # Unknown product version, warn and continue echo "Warning: Detected unknown macOS major version: $(sw_vers -productVersion)" @@ -209,14 +214,12 @@ ensure() { downloader() { if check_cmd curl; then if ! check_help_for curl --proto --tlsv1.2; then - echo "Warning: Not forcing TLS v1.2, this is potentially less secure" curl --silent --show-error --fail --location "$1" --output "$2" else curl --proto '=https' --tlsv1.2 --silent --show-error --fail --location "$1" --output "$2" fi elif check_cmd wget; then if ! check_help_for wget --https-only --secure-protocol; then - echo "Warning: Not forcing TLS v1.2, this is potentially less secure" wget "$1" -O "$2" else wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" diff --git a/artifacts/update.sh b/artifacts/update.sh index 41fe34ee..96e3729c 100755 --- a/artifacts/update.sh +++ b/artifacts/update.sh @@ -23,15 +23,17 @@ main(){ requiredMinor="$(echo $min_terraform_ver | cut -d. -f2)" requiredPatch="$(echo $min_terraform_ver | cut -d. -f3)" if [ "$major" -lt "$requiredMajor" ]; then - err "Please upgrade your terraform to version above $min_terraform_ver" - fi - if [ "$minor" -lt "$requiredMinor" ]; then - err "Please upgrade your terraform to version above $min_terraform_ver" - fi - if [ "$patch" -lt "$requiredPatch" ]; then - err "Please upgrade your terraform to version above $min_terraform_ver" + echo "Please upgrade your terraform to version above $min_terraform_ver" + elif [ "$major" -eq "$requiredMajor" ]; then + if [ "$minor" -lt "$requiredMinor" ]; then + echo "Please upgrade your terraform to version above $min_terraform_ver" + elif [ "$minor" -eq "$requiredMinor" ]; then + if [ "$patch" -lt "$requiredPatch" ]; then + echo "Please upgrade your terraform to version above $min_terraform_ver" + fi + fi fi - else + elsev1.2 install_terraform $cur_terraform_ver fi progressBar 40 100 @@ -87,14 +89,12 @@ check_cmd() { downloader() { if check_cmd curl; then if ! check_help_for curl --proto --tlsv1.2; then - echo "Warning: Not forcing TLS v1.2, this is potentially less secure" curl --silent --show-error --fail --location "$1" --output "$2" else curl --proto '=https' --tlsv1.2 --silent --show-error --fail --location "$1" --output "$2" fi elif check_cmd wget; then if ! check_help_for wget --https-only --secure-protocol; then - echo "Warning: Not forcing TLS v1.2, this is potentially less secure" wget "$1" -O "$2" else wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" @@ -140,36 +140,31 @@ get_latest_release() { sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value } -# source : https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash vercomp () { if [[ $1 == $2 ]] then return 0 fi - local IFS=. - local i ver1=($1) ver2=($2) - # fill empty fields in ver1 with zeros - for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) - do - ver1[i]=0 - done - for ((i=0; i<${#ver1[@]}; i++)) - do - if [[ -z ${ver2[i]} ]] - then - # fill empty fields in ver2 with zeros - ver2[i]=0 + major1="$(echo $1 | cut -d. -f1)" + minor1="$(echo $1 | cut -d. -f2)" + patch1="$(echo $1 | cut -d. -f3)" + major2="$(echo $2 | cut -d. -f1)" + minor2="$(echo $2 | cut -d. -f2)" + patch2="$(echo $2 | cut -d. -f3)" + + if [ "$major1" -lt "$major2" ]; then + return 2 + elif [ "$major1" -eq "$major2" ]; then + if [ "$minor1" -lt "$minor2" ]; then + return 2 + elif [ "$minor1" -eq "$minor2" ]; then + if [ "$patch1" -lt "$patch2" ]; then + return 2 fi - if ((10#${ver1[i]} > 10#${ver2[i]})) - then - return 1 - fi - if ((10#${ver1[i]} < 10#${ver2[i]})) - then - return 2 - fi - done - return 0 + fi + fi + + return 1 } # Source: https://github.com/fearside/ProgressBar diff --git a/cmd/down.go b/cmd/down.go index 57c0006c..3cb82899 100644 --- a/cmd/down.go +++ b/cmd/down.go @@ -5,6 +5,7 @@ import ( "context" "errors" "fmt" + "log" "math/big" "os" "strings" @@ -127,6 +128,7 @@ func withdraw(ctx *cli.Context) error { // Create a transactor for ethereum tx gasPrice, err := client.SuggestGasPrice(c) if err != nil { + log.Print(1) return err } ethAddr := crypto.PubkeyToAddress(config.Keystore.Ecdsa.PublicKey) @@ -138,10 +140,13 @@ func withdraw(ctx *cli.Context) error { renAddress := renAddress(config.Network) tokenContract, err := bindings.NewERC20(common.HexToAddress(renAddress), client) if err != nil { + log.Print(2) return err } + log.Printf("ethaddrs = %v, contract = %v", ethAddr.Hex(), renAddress) renBalance, err := tokenContract.BalanceOf(&bind.CallOpts{}, ethAddr) if err != nil { + log.Print(3) return err } From d632c5cb0fefd31978f6576e82a772e096f15d89 Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Mon, 22 Nov 2021 15:52:19 +1100 Subject: [PATCH 4/8] fix syntax error --- artifacts/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/update.sh b/artifacts/update.sh index 96e3729c..a074ec6f 100755 --- a/artifacts/update.sh +++ b/artifacts/update.sh @@ -33,7 +33,7 @@ main(){ fi fi fi - elsev1.2 + else install_terraform $cur_terraform_ver fi progressBar 40 100 From b34c15c348a9b0f6de348a2a96e5c0ee05ff440d Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Mon, 22 Nov 2021 15:54:59 +1100 Subject: [PATCH 5/8] remove debug logs --- cmd/down.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmd/down.go b/cmd/down.go index 3cb82899..57c0006c 100644 --- a/cmd/down.go +++ b/cmd/down.go @@ -5,7 +5,6 @@ import ( "context" "errors" "fmt" - "log" "math/big" "os" "strings" @@ -128,7 +127,6 @@ func withdraw(ctx *cli.Context) error { // Create a transactor for ethereum tx gasPrice, err := client.SuggestGasPrice(c) if err != nil { - log.Print(1) return err } ethAddr := crypto.PubkeyToAddress(config.Keystore.Ecdsa.PublicKey) @@ -140,13 +138,10 @@ func withdraw(ctx *cli.Context) error { renAddress := renAddress(config.Network) tokenContract, err := bindings.NewERC20(common.HexToAddress(renAddress), client) if err != nil { - log.Print(2) return err } - log.Printf("ethaddrs = %v, contract = %v", ethAddr.Hex(), renAddress) renBalance, err := tokenContract.BalanceOf(&bind.CallOpts{}, ethAddr) if err != nil { - log.Print(3) return err } From e38ab9fe4c049ac6859db01e4cdfcd60aa73c52a Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Tue, 23 Nov 2021 09:40:06 +1100 Subject: [PATCH 6/8] revert to using mercury sdk --- cmd/down.go | 51 +++++++++++++++++++++++++++++++++------------------ go.mod | 25 ++----------------------- go.sum | 16 ++++++++++++++++ 3 files changed, 51 insertions(+), 41 deletions(-) diff --git a/cmd/down.go b/cmd/down.go index 57c0006c..b7018d84 100644 --- a/cmd/down.go +++ b/cmd/down.go @@ -15,11 +15,13 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" "github.com/fatih/color" "github.com/renproject/darknode-cli/darknode" "github.com/renproject/darknode-cli/darknode/bindings" "github.com/renproject/darknode-cli/util" + "github.com/renproject/mercury/sdk/client/ethclient" + "github.com/renproject/mercury/types/ethtypes" + "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -119,13 +121,13 @@ func withdraw(ctx *cli.Context) error { } // Connect to Ethereum - client, err := ethclient.Dial("https://ren-mercury.herokuapp.com/eth/mainnet") + client, err := connect(config.Network) if err != nil { return err } // Create a transactor for ethereum tx - gasPrice, err := client.SuggestGasPrice(c) + gasPrice, err := client.EthClient().SuggestGasPrice(c) if err != nil { return err } @@ -136,7 +138,7 @@ func withdraw(ctx *cli.Context) error { // Check REN balance first renAddress := renAddress(config.Network) - tokenContract, err := bindings.NewERC20(common.HexToAddress(renAddress), client) + tokenContract, err := bindings.NewERC20(common.HexToAddress(renAddress), client.EthClient()) if err != nil { return err } @@ -153,7 +155,7 @@ func withdraw(ctx *cli.Context) error { if err != nil { return err } - receipt, err := bind.WaitMined(c, client, tx) + receipt, err := bind.WaitMined(c, client.EthClient(), tx) if err != nil { return err } @@ -165,15 +167,15 @@ func withdraw(ctx *cli.Context) error { // Check the ETH balance fmt.Println("Checking ETH balance...") - balance, err := client.BalanceAt(c, ethAddr, nil) + balance, err := client.Balance(c, ethtypes.Address(ethAddr)) if err != nil { return err } - gas := gasPrice.Mul(gasPrice, big.NewInt(21000)) - zero := big.NewInt(0) - if balance.Cmp(zero) == 1 { - if balance.Cmp(gas) == 1 { - tx, err := transfer(auth, receiverAddr, balance.Sub(balance, gas), client) + gas := ethtypes.Wei(gasPrice.Uint64() * 21000) + zero := ethtypes.Wei(0) + if balance.Gt(zero) { + if balance.Gt(gas) { + tx, err := transfer(auth, receiverAddr, balance.Sub(gas), client) if err != nil { return err } @@ -188,9 +190,9 @@ func withdraw(ctx *cli.Context) error { } // transfer ETH to the provided address. -func transfer(transactor *bind.TransactOpts, receiver common.Address, amount *big.Int, client *ethclient.Client) (*types.Transaction, error) { - bound := bind.NewBoundContract(receiver, abi.ABI{}, nil, client, nil) - transactor.Value = amount +func transfer(transactor *bind.TransactOpts, receiver common.Address, amount ethtypes.Amount, client ethclient.Client) (*types.Transaction, error) { + bound := bind.NewBoundContract(receiver, abi.ABI{}, nil, client.EthClient(), nil) + transactor.Value = amount.ToBig() transactor.GasLimit = 21000 return bound.Transfer(transactor) } @@ -207,6 +209,19 @@ func renAddress(network darknode.Network) string { } } +// connect to Ethereum. +func connect(network darknode.Network) (ethclient.Client, error) { + logger := logrus.New() + switch network { + case darknode.Mainnet: + return ethclient.New(logger, ethtypes.Mainnet) + case darknode.Testnet, darknode.Devnet: + return ethclient.New(logger, ethtypes.Kovan) + default: + return nil, errors.New("unknown network") + } +} + // nodeStatus returns the registration status of the darknode with given name. func nodeStatus(name string) (status, error) { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) @@ -218,15 +233,15 @@ func nodeStatus(name string) (status, error) { address := crypto.PubkeyToAddress(config.Keystore.Ecdsa.PublicKey) // Connect to Ethereum - client, err := ethclient.Dial("https://ren-mercury.herokuapp.com/eth/mainnet") + client, err := connect(config.Network) if err != nil { return 0, err } - dnrAddr, err := config.DnrAddr(client) + dnrAddr, err := config.DnrAddr(client.EthClient()) if err != nil { return 0, err } - dnr, err := bindings.NewDarknodeRegistry(dnrAddr, client) + dnr, err := bindings.NewDarknodeRegistry(dnrAddr, client.EthClient()) if err != nil { return 0, err } @@ -267,4 +282,4 @@ func nodeStatus(name string) (status, error) { return notRefunded, nil } return nilStatus, nil -} +} \ No newline at end of file diff --git a/go.mod b/go.mod index f16cb58f..d590c0c9 100644 --- a/go.mod +++ b/go.mod @@ -4,23 +4,15 @@ go 1.13 require ( cloud.google.com/go v0.51.0 // indirect - github.com/allegro/bigcache v1.2.1 // indirect - github.com/aristanetworks/goarista v0.0.0-20200310212843-2da4c1f5881b // indirect github.com/aws/aws-sdk-go v1.41.8 github.com/btcsuite/btcd v0.20.1-beta - github.com/cespare/cp v1.1.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect - github.com/deckarep/golang-set v1.7.1 // indirect github.com/dgraph-io/badger v1.6.1 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/digitalocean/godo v1.69.1 - github.com/edsrzf/mmap-go v1.0.0 // indirect - github.com/elastic/gosigar v0.10.5 // indirect github.com/ethereum/go-ethereum v1.9.6 github.com/fatih/color v1.7.0 - github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect - github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.4.3 // indirect github.com/google/go-github/v39 v39.2.0 @@ -29,29 +21,19 @@ require ( github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/huin/goupnp v1.0.2 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-base58 v0.0.0-20150317085156-6237cf65f3a6 github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559 // indirect github.com/kr/text v0.2.0 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect github.com/multiformats/go-multiaddr v0.1.1 github.com/multiformats/go-multihash v0.0.8 github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pborman/uuid v1.2.0 // indirect - github.com/prometheus/tsdb v0.10.0 // indirect github.com/renproject/aw v0.3.7 - github.com/renproject/kv v1.1.2 // indirect + github.com/renproject/mercury v0.3.16 github.com/renproject/phi v0.1.0 - github.com/rjeczalik/notify v0.9.2 // indirect - github.com/rs/cors v1.7.0 // indirect - github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e // indirect - github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect - github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect + github.com/sirupsen/logrus v1.4.2 github.com/stretchr/testify v1.7.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tyler-smith/go-bip39 v1.0.2 // indirect github.com/urfave/cli v1.22.5 - github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d @@ -60,8 +42,5 @@ require ( google.golang.org/api v0.15.0 google.golang.org/protobuf v1.25.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect - gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 // indirect - gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index d4cd91ed..f88db6cd 100644 --- a/go.sum +++ b/go.sum @@ -39,9 +39,11 @@ github.com/aws/aws-sdk-go v1.41.8/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= @@ -58,6 +60,7 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/codahale/blake2 v0.0.0-20150924215134-8d10d0420cbf/go.mod h1:BO2rLUAZMrpgh6GBVKi0Gjdqw2MgCtJrtmUdDeZRKjY= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -98,6 +101,7 @@ github.com/elastic/gosigar v0.10.5/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTy github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.9.2/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= +github.com/ethereum/go-ethereum v1.9.5/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/ethereum/go-ethereum v1.9.6 h1:EacwxMGKZezZi+m3in0Tlyk0veDQgnfZ9BjQqHAaQLM= github.com/ethereum/go-ethereum v1.9.6/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= @@ -177,6 +181,8 @@ github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -184,10 +190,12 @@ github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+d github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -210,6 +218,7 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559 h1:0VWDXPNE0brOek1Q8bLfzKkvOzwbQE/snjGojlCr8CY= github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -236,9 +245,12 @@ github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20190720004541-5f6b3168e4a0 h1:DmK33IJe81zJOzLmzzBHWf2/fGB0tnvqLnvGu8S5wYY= +github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20190720004541-5f6b3168e4a0/go.mod h1:VVt+rn/itmf+9eZq9CAabVlsfsHveUNUQ0bRv3ChqxY= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo= @@ -259,6 +271,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -310,6 +323,8 @@ github.com/renproject/id v0.1.1/go.mod h1:i4OJzgjl4XLcU7nfU9UshX7PaBVpnTk3gEVj8d github.com/renproject/kv v1.1.0/go.mod h1:B+LKu5xLj9t65LrbsSyzTcgLcPdWCd0qxFEtNB7NRo8= github.com/renproject/kv v1.1.2 h1:P18yHdDVJTEZ9yeyx6o82ICY1m6f+VdtAt/ouZez+AU= github.com/renproject/kv v1.1.2/go.mod h1:78bvdAtYiYxCoT9ihVhl8qdmjl7s9fST/FkRLnZ6rXY= +github.com/renproject/mercury v0.3.16 h1:vbD0DJOJK+ETIwMRDjfEOdUoPzYPWkaIiq/adqe/k7M= +github.com/renproject/mercury v0.3.16/go.mod h1:+1iE/uf04pXGSk0lNTdGjs4w+MUyKs4R3o3xK2Bko3Y= github.com/renproject/phi v0.0.0-20190713013721-51f586bc4816/go.mod h1:Hrxx2ONVpfByficRjyRd1trecalYr0lo7Z0akx8UXqg= github.com/renproject/phi v0.1.0 h1:ZOn7QeDribk/uV46OhQWcTLxyuLg7P+xR1Hfl5cOQuI= github.com/renproject/phi v0.1.0/go.mod h1:Hrxx2ONVpfByficRjyRd1trecalYr0lo7Z0akx8UXqg= @@ -413,6 +428,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= From 1b14d9ce9c4f1193b3e44428a1dc9ce9d964d62f Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Tue, 23 Nov 2021 09:41:16 +1100 Subject: [PATCH 7/8] use the same mercury version as before --- go.mod | 7 +------ go.sum | 11 +++++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index d590c0c9..3875c411 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,9 @@ require ( github.com/aws/aws-sdk-go v1.41.8 github.com/btcsuite/btcd v0.20.1-beta github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect - github.com/dgraph-io/badger v1.6.1 // indirect - github.com/dgraph-io/ristretto v0.0.3 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/digitalocean/godo v1.69.1 github.com/ethereum/go-ethereum v1.9.6 github.com/fatih/color v1.7.0 - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.4.3 // indirect github.com/google/go-github/v39 v39.2.0 github.com/google/uuid v1.1.5 // indirect @@ -28,7 +24,7 @@ require ( github.com/multiformats/go-multihash v0.0.8 github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/renproject/aw v0.3.7 - github.com/renproject/mercury v0.3.16 + github.com/renproject/mercury v0.3.15 github.com/renproject/phi v0.1.0 github.com/sirupsen/logrus v1.4.2 github.com/stretchr/testify v1.7.0 // indirect @@ -40,7 +36,6 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect google.golang.org/api v0.15.0 - google.golang.org/protobuf v1.25.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index f88db6cd..8b7f8e5a 100644 --- a/go.sum +++ b/go.sum @@ -241,8 +241,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -323,8 +323,8 @@ github.com/renproject/id v0.1.1/go.mod h1:i4OJzgjl4XLcU7nfU9UshX7PaBVpnTk3gEVj8d github.com/renproject/kv v1.1.0/go.mod h1:B+LKu5xLj9t65LrbsSyzTcgLcPdWCd0qxFEtNB7NRo8= github.com/renproject/kv v1.1.2 h1:P18yHdDVJTEZ9yeyx6o82ICY1m6f+VdtAt/ouZez+AU= github.com/renproject/kv v1.1.2/go.mod h1:78bvdAtYiYxCoT9ihVhl8qdmjl7s9fST/FkRLnZ6rXY= -github.com/renproject/mercury v0.3.16 h1:vbD0DJOJK+ETIwMRDjfEOdUoPzYPWkaIiq/adqe/k7M= -github.com/renproject/mercury v0.3.16/go.mod h1:+1iE/uf04pXGSk0lNTdGjs4w+MUyKs4R3o3xK2Bko3Y= +github.com/renproject/mercury v0.3.15 h1:qPcId0DZy36fMuBZoXzcrZem2fbUXFJ1E2dBDETZNps= +github.com/renproject/mercury v0.3.15/go.mod h1:dxOQMy6wf+Kf8zLN3LGypCeq7jdKVHQUpMW6fsTvsMc= github.com/renproject/phi v0.0.0-20190713013721-51f586bc4816/go.mod h1:Hrxx2ONVpfByficRjyRd1trecalYr0lo7Z0akx8UXqg= github.com/renproject/phi v0.1.0 h1:ZOn7QeDribk/uV46OhQWcTLxyuLg7P+xR1Hfl5cOQuI= github.com/renproject/phi v0.1.0/go.mod h1:Hrxx2ONVpfByficRjyRd1trecalYr0lo7Z0akx8UXqg= @@ -403,6 +403,7 @@ golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -446,6 +447,7 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -494,6 +496,7 @@ golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 7fa53e14713f318b520a1f2feb66bd11e0ce894a Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Thu, 25 Nov 2021 21:01:12 +1100 Subject: [PATCH 8/8] fix terraform for apple silicon --- artifacts/install.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/artifacts/install.sh b/artifacts/install.sh index f5436278..5729d2a2 100755 --- a/artifacts/install.sh +++ b/artifacts/install.sh @@ -35,10 +35,18 @@ main() { fi if ! check_cmd terraform; then terraform_url="https://releases.hashicorp.com/terraform/${cur_terraform_ver}/terraform_${cur_terraform_ver}_${ostype}_${cputype}.zip" - ensure downloader "$terraform_url" "$HOME/.darknode/bin/terraform.zip" - ensure unzip -qq "$HOME/.darknode/bin/terraform.zip" -d "$HOME/.darknode/bin" - ensure chmod +x "$HOME/.darknode/bin/terraform" - rm "$HOME/.darknode/bin/terraform.zip" + + # The official terraform download page doesn't have bins for apple silicon before v1.0.0 + # so we have to build ourselves and upload to the cli release + if [ "$ostype" = 'darwin' -a "$cputype" = 'arm64' ];then + terraform_url="https://www.github.com/renproject/darknode-cli/releases/download/3.1.0/terraform_darwin_arm64" + ensure downloader "$terraform_url" "$HOME/.darknode/bin/terraform" + else + ensure downloader "$terraform_url" "$HOME/.darknode/bin/terraform.zip" + ensure unzip -qq "$HOME/.darknode/bin/terraform.zip" -d "$HOME/.darknode/bin" + ensure chmod +x "$HOME/.darknode/bin/terraform" + rm "$HOME/.darknode/bin/terraform.zip" + fi fi progressBar 50 100 @@ -118,7 +126,7 @@ check_architecture() { : elif [ "$ostype" = 'linux' -a "$cputype" = 'aarch64' ]; then : - elif [ "$ostype" = 'darwin' -a "$cputype" = 'x86_64' ]; then + elif [ "$ostype" = 'darwin' ]; then if [ "$cputype" = 'x86_64' ]; then : elif [ "$cputype" = 'arm64' ]; then