From eec814f541daf6b135fd2d42c63119661658f4e1 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sat, 21 Nov 2020 03:14:10 +0100 Subject: [PATCH 01/21] Make initial hacks to get Dockers to run --- infra/acala/Dockerfile | 7 ++++--- infra/docker-compose.yaml | 20 +++++++++++--------- multichain.go | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/infra/acala/Dockerfile b/infra/acala/Dockerfile index a988fb74..3c156dac 100644 --- a/infra/acala/Dockerfile +++ b/infra/acala/Dockerfile @@ -15,9 +15,10 @@ WORKDIR /app # TEMPORARY: use the branch that has a good reference to the submodules # TODO: remove when the `master` branch of Acala is updated -RUN git fetch -RUN git checkout update-orml -RUN git pull +# DEZU: commented out because it fails +#RUN git fetch +#RUN git checkout update-orml +#RUN git pull # Make sure submodule.recurse is set to true to make life with submodule easier. RUN git config --global submodule.recurse true diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index b30be3fb..20f9d859 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -1,17 +1,19 @@ version: "2" services: + + # DEZU; Commented out because break build etc etc, notice colons too # # Acala # - acala: - build: - context: ./acala - ports: - - "0.0.0.0:9933:9933" - - "0.0.0.0:9944:9944" - entrypoint: - - "./root/run.sh" - - "${ACALA_ADDRESS}" + # acala + # build + # context ./acala + # ports + # - "0.0.0.0:9933:9933" + # - "0.0.0.0:9944:9944" + # entrypoint + # - "./root/run.sh" + # - "${ACALA_ADDRESS}" # # Binance Smart Chain diff --git a/multichain.go b/multichain.go index 436a7fc0..aa3435b2 100644 --- a/multichain.go +++ b/multichain.go @@ -208,7 +208,7 @@ type Chain string // human-readable string to this set of enumerated values. Chains must be listed // in alphabetical order. const ( - Acala = Chain("Acala") + //Acala = Chain("Acala") // DEZU: Commented out because it breaks the docker build process, #progamermove (#pro-grammermove?) BinanceSmartChain = Chain("BinanceSmartChain") Bitcoin = Chain("Bitcoin") BitcoinCash = Chain("BitcoinCash") From b31da550a004194f8fb4b4c9a69594b279911f51 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sat, 21 Nov 2020 03:15:28 +0100 Subject: [PATCH 02/21] Make some changes to test script so it runs "on my machine" --- test.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index e0b03f1e..ed0e2dba 100755 --- a/test.sh +++ b/test.sh @@ -1,7 +1,12 @@ source ./infra/.env +GO=/usr/local/go/bin/go #DEZU: Added because the script hate on poor GO +COMPOSE_PARALLEL_LIMIT=10 #DEZU: Added because of error, apparently some library has a thread limit of 10? docker-compose -f ./infra/docker-compose.yaml up --build -d echo "Waiting for multichain to boot..." sleep 30 -go test -v ./... +echo "Done waiting, running tests..." # DEZU: Added for debugging +$GO version # DEZU: Added for de lulz +$GO test -v ./... +echo "Done testing, closing..." # DEZU: Added for debugging docker-compose -f ./infra/docker-compose.yaml down -echo "Done!" \ No newline at end of file +echo "Done!" From 533eb4ebf33b052272fa34f9f285b0b958b4943f Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sat, 21 Nov 2020 03:16:44 +0100 Subject: [PATCH 03/21] Change some generated files I can't be arsed to gitignore --- go.mod | 6 ++--- go.sum | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0b489eae..14b2407c 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/codahale/blake2 v0.0.0-20150924215134-8d10d0420cbf github.com/cosmos/cosmos-sdk v0.39.1 github.com/ethereum/go-ethereum v1.9.20 - github.com/filecoin-project/go-address v0.0.4 + github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb github.com/filecoin-project/go-jsonrpc v0.1.2-0.20201008195726-68c6a2704e49 - github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f + github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc github.com/filecoin-project/lotus v1.1.2 github.com/ipfs/go-cid v0.0.7 github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 @@ -22,7 +22,7 @@ require ( github.com/renproject/surge v1.2.6 github.com/tendermint/tendermint v0.33.8 github.com/terra-project/core v0.4.0-rc.4 - go.uber.org/zap v1.15.0 + go.uber.org/zap v1.16.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a ) diff --git a/go.sum b/go.sum index 83c8ff33..2137e7ef 100644 --- a/go.sum +++ b/go.sum @@ -273,24 +273,33 @@ github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6 github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-address v0.0.4 h1:gSNMv0qWwH16fGQs7ycOUrDjY6YCSsgLUl0I0KLjo8w= github.com/filecoin-project/go-address v0.0.4/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= +github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb h1:Cbu7YYsXHtVlPEJ+eqbBx2S3ElmWCB0NjpGPYvvvCrA= +github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 h1:pIuR0dnMD0i+as8wNnjjHyQrnhP5O5bmba/lmgQeRgU= github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349/go.mod h1:vgmwKBkx+ca5OIeEvstiQgzAZnb7R6QaqE1oEDSqa6g= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.1 h1:S6Uuqcspqu81sWJ0He4OAfFLm1tSwPdVjtKTkl5m/xQ= github.com/filecoin-project/go-bitfield v0.2.1/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= +github.com/filecoin-project/go-bitfield v0.2.3-0.20201110211213-fe2c1862e816 h1:RMdzMqe3mu2Z/3N3b9UEfkbGZxukstmZgNC024ybWhA= +github.com/filecoin-project/go-bitfield v0.2.3-0.20201110211213-fe2c1862e816/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-data-transfer v0.9.0 h1:nTT8j7Hu3TM0wRWrGy83/ctawG7sleJGdFWtIsUsKgY= github.com/filecoin-project/go-data-transfer v0.9.0/go.mod h1:i2CqUy7TMQGKukj9BgqIxiP8nDHDXU2VLd771KVaCaQ= +github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo= +github.com/filecoin-project/go-data-transfer v1.2.0 h1:LM+K+J+y9t8e3gYskJHWDlyHJsF6aaxoHOP+HIiVE1U= +github.com/filecoin-project/go-data-transfer v1.2.0/go.mod h1:ZAH51JZFR8NZC4FPiDPG+swjgui0q6zTMJbztc6pHhY= github.com/filecoin-project/go-ds-versioning v0.1.0 h1:y/X6UksYTsK8TLCI7rttCKEvl8btmWxyFMEeeWGUxIQ= github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f h1:GxJzR3oRIMTPtpZ0b7QF8FKPK6/iPAc7trhlL5k/g+s= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-markets v1.0.0 h1:np9+tlnWXh9xYG4oZfha6HZFLYOaAZoMGR3V4w6DM48= github.com/filecoin-project/go-fil-markets v1.0.0/go.mod h1:lXExJyYHwpMMddCqhEdNrc7euYJKNkp04K76NZqJLGg= +github.com/filecoin-project/go-fil-markets v1.0.5 h1:g1EEdSJfi7nbVS2MhhUTRwNU+FHMOgvytTmKQqu6p0M= +github.com/filecoin-project/go-fil-markets v1.0.5/go.mod h1:lt96/KQb5r+YxV31kVGHUVIbQa7zLbxSP6ZBX+ruzDA= github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM= github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM= @@ -308,6 +317,8 @@ github.com/filecoin-project/go-state-types v0.0.0-20200904021452-1883f36ca2f4/go github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f h1:TZDTu4MtBKSFLXWGKLy+cvC3nHfMFIrVgWLAz/+GgZQ= github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= +github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc h1:+hbMY4Pcx2oizrfH08VWXwrj5mU8aJT6g0UNxGHFCGU= +github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe h1:dF8u+LEWeIcTcfUcCf3WFVlc81Fr2JKg8zPzIbBDKDw= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statestore v0.1.0 h1:t56reH59843TwXHkMcwyuayStBIiWBRilQjQ+5IiwdQ= @@ -319,11 +330,17 @@ github.com/filecoin-project/lotus v1.1.2/go.mod h1:jSlQv+/+WGox3TdEzBEfmXzvbot4O github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4= github.com/filecoin-project/specs-actors v0.9.12 h1:iIvk58tuMtmloFNHhAOQHG+4Gci6Lui0n7DYQGi3cJk= github.com/filecoin-project/specs-actors v0.9.12/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= +github.com/filecoin-project/specs-actors v0.9.13 h1:rUEOQouefi9fuVY/2HOroROJlZbOzWYXXeIh41KF2M4= +github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors/v2 v2.0.1/go.mod h1:v2NZVYinNIKA9acEMBm5wWXxqv5+frFEbekBFemYghY= github.com/filecoin-project/specs-actors/v2 v2.2.0 h1:IyCICb0NHYeD0sdSqjVGwWydn/7r7xXuxdpvGAcRCGY= github.com/filecoin-project/specs-actors/v2 v2.2.0/go.mod h1:rlv5Mx9wUhV8Qsz+vUezZNm+zL4tK08O0HreKKPB2Wc= +github.com/filecoin-project/specs-actors/v2 v2.3.2 h1:2Vcf4CGa29kRh4JJ02m+FbvD/p3YNnLGsaHfw7Uj49g= +github.com/filecoin-project/specs-actors/v2 v2.3.2/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y= github.com/filecoin-project/specs-storage v0.1.1-0.20200907031224-ed2e5cd13796 h1:dJsTPWpG2pcTeojO2pyn0c6l+x/3MZYCBgo/9d11JEk= github.com/filecoin-project/specs-storage v0.1.1-0.20200907031224-ed2e5cd13796/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= +github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 h1:Ur/l2+6qN+lQiqjozWWc5p9UDaAMDZKTlDS98oRnlIw= +github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -440,6 +457,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -539,6 +558,7 @@ github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiL github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= github.com/ipfs/go-bitswap v0.2.20 h1:Zfi5jDUoqxDThORUznqdeL77DdGniAzlccNJ4vr+Itc= github.com/ipfs/go-bitswap v0.2.20/go.mod h1:C7TwBgHnu89Q8sHsTJP7IhUqF9XYLe71P4tT5adgmYo= +github.com/ipfs/go-bitswap v0.3.2/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= @@ -548,6 +568,8 @@ github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7s github.com/ipfs/go-blockservice v0.1.3/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= github.com/ipfs/go-blockservice v0.1.4-0.20200624145336-a978cec6e834 h1:hFJoI1D2a3MqiNkSb4nKwrdkhCngUxUTFNwVwovZX2s= github.com/ipfs/go-blockservice v0.1.4-0.20200624145336-a978cec6e834/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= +github.com/ipfs/go-blockservice v0.1.4 h1:Vq+MlsH8000KbbUciRyYMEw/NNP8UAGmcqKi4uWmFGA= +github.com/ipfs/go-blockservice v0.1.4/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -593,6 +615,10 @@ github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CE github.com/ipfs/go-graphsync v0.3.0/go.mod h1:gEBvJUNelzMkaRPJTpg/jaKN4AQW/7wDWu0K92D8o10= github.com/ipfs/go-graphsync v0.3.1 h1:dJLYrck4oyJDfMVhGEKiWHxaY8oYMWko4m2Fi+4bofo= github.com/ipfs/go-graphsync v0.3.1/go.mod h1:bw4LiLM5Oq/uLdzEtih9LK8GrwSijv+XqYiWCTxHMqs= +github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0= +github.com/ipfs/go-graphsync v0.4.3/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY= +github.com/ipfs/go-graphsync v0.5.0 h1:iaByvxq88Ys1KcaQzTS1wmRhNsNEo3SaUiSGqTSbGmM= +github.com/ipfs/go-graphsync v0.5.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= @@ -600,6 +626,8 @@ github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86 github.com/ipfs/go-ipfs-blockstore v1.0.0/go.mod h1:knLVdhVU9L7CC4T+T4nvGdeUIPAXlnd9zmXfp+9MIjU= github.com/ipfs/go-ipfs-blockstore v1.0.1 h1:fnuVj4XdZp4yExhd0CnUwAiMNJHiPnfInhiuwz4lW1w= github.com/ipfs/go-ipfs-blockstore v1.0.1/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= +github.com/ipfs/go-ipfs-blockstore v1.0.3 h1:RDhK6fdg5YsonkpMuMpdvk/pRtOQlrIRIybuQfkvB2M= +github.com/ipfs/go-ipfs-blockstore v1.0.3/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= @@ -643,6 +671,8 @@ github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9 github.com/ipfs/go-ipld-cbor v0.0.5-0.20200204214505-252690b78669/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf h1:PRCy+w3GocY77CBEwTprp6hn7PLiEU1YToKe7B+1FVk= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= +github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= @@ -691,12 +721,16 @@ github.com/ipfs/iptb v1.4.0/go.mod h1:1rzHpCYtNp87/+hTxG5TfCVn/yMY3dKnLn8tBiMfdm github.com/ipfs/iptb-plugins v0.2.1/go.mod h1:QXMbtIWZ+jRsW8a4h13qAKU7jcM7qaittO8wOsTP0Rs= github.com/ipld/go-car v0.1.1-0.20200923150018-8cdef32e2da4 h1:6phjU3kXvCEWOZpu+Ob0w6DzgPFZmDLgLPxJhD8RxEY= github.com/ipld/go-car v0.1.1-0.20200923150018-8cdef32e2da4/go.mod h1:xrMEcuSq+D1vEwl+YAXsg/JfA98XGpXDwnkIL4Aimqw= +github.com/ipld/go-car v0.1.1-0.20201119040415-11b6074b6d4d/go.mod h1:2Gys8L8MJ6zkh1gktTSXreY63t4UbyvNp5JaudTyxHQ= github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f h1:XpOuNQ5GbXxUcSukbQcW9jkE7REpaFGJU2/T00fo9kA= github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= +github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018 h1:RbRHv8epkmvBYA5cGfz68GUSbOgx5j/7ObLIl4Rsif0= +github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6 h1:6Mq+tZGSEMEoJJ1NbJRhddeelkXZcU8yfH/ZRYUo/Es= github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0= +github.com/ipld/go-ipld-prime-proto v0.1.0/go.mod h1:11zp8f3sHVgIqtb/c9Kr5ZGqpnCLF1IVTNOez9TopzE= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= github.com/jackpal/gateway v1.0.4/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= @@ -778,6 +812,7 @@ github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwn github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= +github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= @@ -808,6 +843,8 @@ github.com/libp2p/go-libp2p v0.9.2/go.mod h1:cunHNLDVus66Ct9iXXcjKRLdmHdFdHVe1TA github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8= github.com/libp2p/go-libp2p v0.11.0 h1:jb5mqdqYEBAybTEhD8io43Cz5LzVKuWxOK7znSN69jE= github.com/libp2p/go-libp2p v0.11.0/go.mod h1:3/ogJDXsbbepEfqtZKBR/DedzxJXCeK17t2Z9RE9bEE= +github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= +github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= github.com/libp2p/go-libp2p-autonat v0.0.2/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= @@ -818,6 +855,7 @@ github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/ github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= github.com/libp2p/go-libp2p-autonat v0.3.2 h1:OhDSwVVaq7liTaRIsFFYvsaPp0pn2yi0WazejZ4DUmo= github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= +github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-autonat-svc v0.1.0/go.mod h1:fqi8Obl/z3R4PFVLm8xFtZ6PBL9MlV/xumymRFkKq5A= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= @@ -837,6 +875,7 @@ github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCy github.com/libp2p/go-libp2p-circuit v0.2.3/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= github.com/libp2p/go-libp2p-circuit v0.3.1 h1:69ENDoGnNN45BNDnBd+8SXSetDuw0eJFcGmOvvtOgBw= github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= +github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-connmgr v0.1.1/go.mod h1:wZxh8veAmU5qdrfJ0ZBLcU8oJe9L82ciVP/fl1VHjXk= github.com/libp2p/go-libp2p-connmgr v0.2.3/go.mod h1:Gqjg29zI8CwXX21zRxy6gOg8VYu3zVerJRt2KyktzH4= github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= @@ -865,6 +904,8 @@ github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= +github.com/libp2p/go-libp2p-core v0.7.0 h1:4a0TMjrWNTZlNvcqxZmrMRDi/NQWrhwO2pkTuLSQ/IQ= +github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= @@ -885,8 +926,10 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= github.com/libp2p/go-libp2p-kad-dht v0.2.1/go.mod h1:k7ONOlup7HKzQ68dE6lSnp07cdxdkmnRa+6B4Fh9/w0= github.com/libp2p/go-libp2p-kad-dht v0.8.3/go.mod h1:HnYYy8taJWESkqiESd1ngb9XX/XGGsMA5G0Vj2HoSh4= +github.com/libp2p/go-libp2p-kad-dht v0.11.0/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= github.com/libp2p/go-libp2p-kbucket v0.2.1/go.mod h1:/Rtu8tqbJ4WQ2KTCOMJhggMukOLNLNPY1EtEWWLxUvc= github.com/libp2p/go-libp2p-kbucket v0.4.2/go.mod h1:7sCeZx2GkNK1S6lQnGUW5JYZCFPnXzAZCCBBS70lytY= +github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= github.com/libp2p/go-libp2p-loggables v0.0.1/go.mod h1:lDipDlBNYbpyqyPX/KcoO+eq0sJYEVR2JgOexcivchg= github.com/libp2p/go-libp2p-loggables v0.1.0 h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8= github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= @@ -898,6 +941,7 @@ github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= github.com/libp2p/go-libp2p-mplex v0.2.4 h1:XFFXaN4jhqnIuJVjYOR3k6bnRj0mFfJOlIuDVww+4Zo= github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= +github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= @@ -934,9 +978,12 @@ github.com/libp2p/go-libp2p-pubsub v0.1.1/go.mod h1:ZwlKzRSe1eGvSIdU5bD7+8RZN/Uz github.com/libp2p/go-libp2p-pubsub v0.3.2-0.20200527132641-c0712c6e92cf/go.mod h1:TxPOBuo1FPdsTjFnv+FGZbNbWYsp74Culx+4ViQpato= github.com/libp2p/go-libp2p-pubsub v0.3.6 h1:9oO8W7qIWCYQYyz5z8nUsPcb3rrFehBlkbqvbSVjBxY= github.com/libp2p/go-libp2p-pubsub v0.3.6/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= +github.com/libp2p/go-libp2p-pubsub v0.4.0 h1:YNVRyXqBgv9i4RG88jzoTtkSOaSB45CqHkL29NNBZb4= +github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU= github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= github.com/libp2p/go-libp2p-quic-transport v0.8.2/go.mod h1:L+e0q15ZNaYm3seHgbsXjWP8kXLEqz+elLWKk9l8DhM= +github.com/libp2p/go-libp2p-quic-transport v0.9.0/go.mod h1:xyY+IgxL0qsW7Kiutab0+NlxM0/p9yRtrGTYsuMWf70= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -962,6 +1009,8 @@ github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA= github.com/libp2p/go-libp2p-swarm v0.2.8 h1:cIUUvytBzNQmGSjnXFlI6UpoBGsaud82mJPIJVfkDlg= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= +github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= +github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -970,6 +1019,7 @@ github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8 h1:v4dvk7YEW8buwCdIVWnhpv0Hp/AAJKRWIxBhmLRZrsk= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= +github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= @@ -990,6 +1040,8 @@ github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= github.com/libp2p/go-libp2p-yamux v0.2.8 h1:0s3ELSLu2O7hWKfX1YjzudBKCP0kZ+m9e2+0veXzkn4= github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= +github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= +github.com/libp2p/go-libp2p-yamux v0.4.1/go.mod h1:FA/NjRYRVNjqOzpGuGqcruH7jAU2mYIjtKBicVOL3dc= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= @@ -1001,6 +1053,7 @@ github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6 github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.1.2 h1:qOg1s+WdGLlpkrczDqmhYzyk3vCfsQ8+RxRTQjOZWwI= github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= +github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-msgio v0.0.1/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= @@ -1063,6 +1116,8 @@ github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZ github.com/libp2p/go-yamux v1.3.6/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI= github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= +github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= +github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= @@ -1204,6 +1259,8 @@ github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= github.com/multiformats/go-multistream v0.1.2 h1:knyamLYMPFPngQjGQ0lhnlys3jtVR/3xV6TREUJr+fE= github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= +github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= +github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -1567,6 +1624,7 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7V github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/c-for-go v0.0.0-20201002084316-c134bfab968f h1:nMhj+x/m7ZQsHBz0L3gpytp0v6ogokdbrQDnhB8Kh7s= github.com/xlab/c-for-go v0.0.0-20201002084316-c134bfab968f/go.mod h1:h/1PEBwj7Ym/8kOuMWvO2ujZ6Lt+TMbySEXNhjjR87I= +github.com/xlab/c-for-go v0.0.0-20201112171043-ea6dce5809cb/go.mod h1:pbNsDSxn1ICiNn9Ct4ZGNrwzfkkwYbx/lw8VuyutFIg= github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 h1:Sw125DKxZhPUI4JLlWugkzsrlB50jR9v2khiD9FxuSo= github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245/go.mod h1:C+diUUz7pxhNY6KAoLgrTYARGWnt82zWTylZlxT92vk= github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= @@ -1574,6 +1632,7 @@ github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 h1:oWgZJmC1DorFZD github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.12.1/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= @@ -1620,6 +1679,8 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= @@ -1659,6 +1720,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1736,6 +1798,8 @@ golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1753,6 +1817,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1820,11 +1885,15 @@ golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c h1:38q6VNPWR010vN82/SB121GujZNIfAUb4YttE2rhGuc= golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1869,6 +1938,7 @@ golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3 h1:r3P/5xOq/dK1991B65Oy6E1fRF/2d/fSYZJ/fXGVfJc= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1938,6 +2008,8 @@ google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1999,8 +2071,12 @@ howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCU launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= modernc.org/golex v1.0.0 h1:wWpDlbK8ejRfSyi0frMyhilD3JBvtcx2AdGDnU+JtsE= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/golex v1.0.1/go.mod h1:QCA53QtsT1NdGkaZZkF5ezFwk4IXh4BGNafAARTC254= +modernc.org/lex v1.0.0/go.mod h1:G6rxMTy3cH2iA0iXL/HRRv4Znu8MK4higxph/lE7ypk= +modernc.org/lexer v1.0.0/go.mod h1:F/Dld0YKYdZCLQ7bD0USbWL4YKCyTDRDHiDTOs0q0vk= modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc= From 8048055b6b398b8e0da98eac8cffd9307aba4ee3 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sat, 21 Nov 2020 03:18:38 +0100 Subject: [PATCH 04/21] Start (weak) attempt to integrate Qtum --- multichain.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/multichain.go b/multichain.go index aa3435b2..5c87a13c 100644 --- a/multichain.go +++ b/multichain.go @@ -108,6 +108,7 @@ const ( ETH = Asset("ETH") // Ether FIL = Asset("FIL") // Filecoin FTM = Asset("FTM") // Fantom + QTUM = Asset("QTUM") // DEZU: Added Qtum! SOL = Asset("SOL") // Solana LUNA = Asset("LUNA") // Luna ZEC = Asset("ZEC") // Zcash @@ -144,6 +145,8 @@ func (asset Asset) OriginChain() Chain { return Fantom case LUNA: return Terra + case QTUM: + return Qtum // DEZU: Added Qtum case SOL: return Solana case ZEC: @@ -167,7 +170,7 @@ func (asset Asset) OriginChain() Chain { // ChainType returns the chain-type (Account or UTXO) for the given asset func (asset Asset) ChainType() ChainType { switch asset { - case BCH, BTC, DGB, DOGE, ZEC: + case BCH, BTC, DGB, DOGE, ZEC, QTUM: // DEZU: Added Qtum. Is it really only UTX, or also account? return ChainTypeUTXOBased case BNB, ETH, FIL, LUNA: return ChainTypeAccountBased @@ -218,6 +221,7 @@ const ( Ethereum = Chain("Ethereum") Fantom = Chain("Fantom") Filecoin = Chain("Filecoin") + Qtum = Chain("Qtum") // DEZU: Added Qtum Solana = Chain("Solana") Terra = Chain("Terra") Zcash = Chain("Zcash") @@ -252,7 +256,7 @@ func (chain *Chain) Unmarshal(buf []byte, rem int) ([]byte, int, error) { // for the chain. func (chain Chain) ChainType() ChainType { switch chain { - case Bitcoin, BitcoinCash, DigiByte, Dogecoin, Zcash: + case Bitcoin, BitcoinCash, DigiByte, Dogecoin, Zcash, Qtum: // DEZU: Added Qtum. Is it really only UTX, or also account? return ChainTypeUTXOBased case BinanceSmartChain, Ethereum, Filecoin, Terra: return ChainTypeAccountBased @@ -302,6 +306,8 @@ func (chain Chain) NativeAsset() Asset { return FIL case Terra: return LUNA + case Qtum: + return QTUM // DEZU: Added Qtum case Zcash: return ZEC From d5c4d4ca3eb365976f89fe3e49b35245884bef09 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sun, 22 Nov 2020 17:08:15 +0100 Subject: [PATCH 05/21] Fix for Ubuntu shell not recognizing "source" command --- test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index ed0e2dba..e95ec8ac 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,5 @@ -source ./infra/.env +#source ./infra/.env +. ./infra/.env # DEZU: This is only because Ubuntu is a special boi GO=/usr/local/go/bin/go #DEZU: Added because the script hate on poor GO COMPOSE_PARALLEL_LIMIT=10 #DEZU: Added because of error, apparently some library has a thread limit of 10? docker-compose -f ./infra/docker-compose.yaml up --build -d From 02ddf2ff8f8ffe964afc07ec2a49cfcd2b4d178b Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sun, 22 Nov 2020 17:09:33 +0100 Subject: [PATCH 06/21] Define Qtum private key and address --- infra/.env | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/infra/.env b/infra/.env index 92ced4f5..97c93156 100644 --- a/infra/.env +++ b/infra/.env @@ -58,6 +58,18 @@ export ETHEREUM_ADDRESS=0xa0df350d2637096571F7A701CBc1C5fdE30dF76A export FILECOIN_PK=7b2254797065223a22736563703235366b31222c22507269766174654b6579223a22756d6a634e436a487a5438455757485849754a4c4b58745035437153323435666238626c656c756e5448493d227d export FILECOIN_ADDRESS=f1ej2tountzqwnu6uswhqdzvw6yy5xvcig6rxl2qa +# +# Qtum +# + +# DEZU: TODO +# Qtum Address that will have plenty funds. Generally, this is set to an +# address for which the private key is known by a test suite. This allows the test +# suite access to plenty of testing funds. +#export QTUM_MNEMONIC="hold mushroom planet ski feed exact monitor vacant move giggle mean tape" +export QTUM_PK=cT6skKBVREsDtjXv26YjgNHomJGPo9oMmTYugbTUc3YDQQLB4T4T +export QTUM_ADDRESS=qb15NCu3w4zyd14L21P99AdqmovHCiCEqC + # # Terra # From 5ee09f2612e43c7f6a8b635452247cb20ff3d21c Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sun, 22 Nov 2020 17:11:46 +0100 Subject: [PATCH 07/21] Add working docker for Qtum --- infra/docker-compose.yaml | 17 +++++++++++++++++ infra/qtum/Dockerfile | 20 ++++++++++++++++++++ infra/qtum/keygen.go | 28 ++++++++++++++++++++++++++++ infra/qtum/qtum.conf | 10 ++++++++++ infra/qtum/run.sh | 26 ++++++++++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 infra/qtum/Dockerfile create mode 100644 infra/qtum/keygen.go create mode 100644 infra/qtum/qtum.conf create mode 100644 infra/qtum/run.sh diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 20f9d859..6a8ca03f 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -114,6 +114,23 @@ services: entrypoint: - "/root/run.sh" + # + # Qtum + # + # DEZU; TODO + qtum: + build: + context: ./qtum + ports: + - "0.0.0.0:3888:3888" + - "0.0.0.0:3889:3889" + - "0.0.0.0:13888:13888" + - "0.0.0.0:13889:13889" + entrypoint: + - "./root/run.sh" + - "${QTUM_ADDRESS}" + - "${QTUM_PK}" + # # Solana # diff --git a/infra/qtum/Dockerfile b/infra/qtum/Dockerfile new file mode 100644 index 00000000..b647b962 --- /dev/null +++ b/infra/qtum/Dockerfile @@ -0,0 +1,20 @@ +# DEZU: Originally stolen from qtum-docker github page +FROM ubuntu +# MAINTAINER pandazwb + +RUN apt-get update && apt-get install --yes -qq --no-install-recommends ca-certificates curl wget apt-utils jq +RUN apt-get install --yes curl + +# install qtum binaries +RUN wget -c https://github.com/qtumproject/qtum/releases/download/mainnet-ignition-v0.20.1/qtum-0.20.1-x86_64-linux-gnu.tar.gz -O - | tar xz +RUN mv ./qtum-0.20.1 /app +RUN chmod +x /app/bin/qtumd +RUN chmod +x /app/bin/qtum-cli + +COPY qtum.conf /root/.qtum/ +COPY run.sh /root/ +RUN chmod +x /root/run.sh + +EXPOSE 3888 3889 13888 13889 + +ENTRYPOINT ["./root/run.sh"] diff --git a/infra/qtum/keygen.go b/infra/qtum/keygen.go new file mode 100644 index 00000000..2af5addc --- /dev/null +++ b/infra/qtum/keygen.go @@ -0,0 +1,28 @@ + +package main +/* +// DEZU: Literally dogecoin's function with dogecoin swapped for qtum. Very unlikely to work, but yoloswag etc +import ( + "fmt" + + "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcutil" + + "github.com/renproject/id" + "github.com/renproject/multichain/chain/qtum" +) + +func main() { + privKey := id.NewPrivKey() + wif, err := btcutil.NewWIF((*btcec.PrivateKey)(privKey), &qtum.RegressionNetParams, true) + if err != nil { + panic(err) + } + addrPubKeyHash, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.SerializePubKey()), &qtum.RegressionNetParams) + if err != nil { + panic(err) + } + fmt.Printf("QTUM_PK=%v\n", wif) + fmt.Printf("QTUM_ADDRESS=%v\n", addrPubKeyHash) +} +*/ diff --git a/infra/qtum/qtum.conf b/infra/qtum/qtum.conf new file mode 100644 index 00000000..efdd9136 --- /dev/null +++ b/infra/qtum/qtum.conf @@ -0,0 +1,10 @@ +daemon=1 +regtest=1 +rpcuser=qtum +rpcpassword=qtumtest +rpcallowip=0.0.0.0/0 +server=1 +txindex=1 + +[regtest] +rpcbind=0.0.0.0 diff --git a/infra/qtum/run.sh b/infra/qtum/run.sh new file mode 100644 index 00000000..d6ff9ec2 --- /dev/null +++ b/infra/qtum/run.sh @@ -0,0 +1,26 @@ +#!/bin/bash +ADDRESS=$1 +PRIV_KEY=$2 + +# Start +/app/bin/qtumd +sleep 10 + +# Print setup +echo "QTUM_ADDRESS=$ADDRESS" + +# Import the address +/app/bin/qtum-cli importaddress $ADDRESS + +# Import the private key to spend UTXOs +/app/bin/qtum-cli importprivkey $PRIV_KEY + +# Generate enough block to pass the maturation time +/app/bin/qtum-cli generatetoaddress 101 $ADDRESS + +# Simulate mining +while : +do + /app/bin/qtum-cli generatetoaddress 1 $ADDRESS + sleep 10 +done From bfdb3846c2c1d26cd7ff155baae9382c31a1e6a1 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sun, 22 Nov 2020 23:35:20 +0100 Subject: [PATCH 08/21] Move Qtum testing to execute first for debugging convenience --- test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index e95ec8ac..4aaef434 100755 --- a/test.sh +++ b/test.sh @@ -5,8 +5,9 @@ COMPOSE_PARALLEL_LIMIT=10 #DEZU: Added because of error, apparently some library docker-compose -f ./infra/docker-compose.yaml up --build -d echo "Waiting for multichain to boot..." sleep 30 -echo "Done waiting, running tests..." # DEZU: Added for debugging -$GO version # DEZU: Added for de lulz +echo "Done waiting, running tests omn Qtum..." # DEZU: Added for debugging +$GO test -v ./chain/qtum/... +echo "Done with Qtum, running all tests..." # DEZU: Added for debugging $GO test -v ./... echo "Done testing, closing..." # DEZU: Added for debugging docker-compose -f ./infra/docker-compose.yaml down From 5bffcc68a74e25ddbd55f358d57906e474532b39 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Mon, 23 Nov 2020 21:05:26 +0100 Subject: [PATCH 09/21] Tweak test files. Very messy, will clean later --- qtumtest.sh | 15 +++++++++++++++ test.sh | 7 +++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 qtumtest.sh diff --git a/qtumtest.sh b/qtumtest.sh new file mode 100755 index 00000000..4b17965a --- /dev/null +++ b/qtumtest.sh @@ -0,0 +1,15 @@ +#source ./infra/.env +. ./infra/.env # DEZU: This is only because Ubuntu is a special boi +GO=/usr/local/go/bin/go #DEZU: Added because the script hate on poor GO +COMPOSE_PARALLEL_LIMIT=10 #DEZU: Added because of error, apparently some library has a thread limit of 10? +#docker-compose -f ./infra/docker-compose.yaml up --build -d +#echo "Waiting for multichain to boot..." +#sleep 30 +echo "Done waiting, running tests on Qtum..." # DEZU: Added for debugging +#sh -e tcpdump -i docker0 -w ./packets.cap # DEZU: Aded for docker network package sniffing +$GO test -v ./chain/qtum/... +echo "Done with Qtum, running all tests..." # DEZU: Added for debugging +#$GO test -v ./... +echo "Done testing, closing..." # DEZU: Added for debugging +#docker-compose -f ./infra/docker-compose.yaml down +echo "Done!" diff --git a/test.sh b/test.sh index 4aaef434..5e6287c4 100755 --- a/test.sh +++ b/test.sh @@ -1,12 +1,15 @@ #source ./infra/.env . ./infra/.env # DEZU: This is only because Ubuntu is a special boi GO=/usr/local/go/bin/go #DEZU: Added because the script hate on poor GO -COMPOSE_PARALLEL_LIMIT=10 #DEZU: Added because of error, apparently some library has a thread limit of 10? +COMPOSE_PARALLEL_LIMIT=8 #DEZU: Added because of error, apparently some library has a thread limit? docker-compose -f ./infra/docker-compose.yaml up --build -d echo "Waiting for multichain to boot..." +docker logs --details infra_qtum_1 >> qtumdockerlog.txt sleep 30 -echo "Done waiting, running tests omn Qtum..." # DEZU: Added for debugging +docker logs --details infra_qtum_1 >> qtumdockerlog.txt +echo "Done waiting, running tests on Qtum..." # DEZU: Added for debugging $GO test -v ./chain/qtum/... +docker logs --details infra_qtum_1 >> qtumdockerlog.txt echo "Done with Qtum, running all tests..." # DEZU: Added for debugging $GO test -v ./... echo "Done testing, closing..." # DEZU: Added for debugging From e6c9e6a2db008e632511b11653d5cc71c516df3c Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Mon, 23 Nov 2020 21:09:18 +0100 Subject: [PATCH 10/21] Add tweaked copy of BTC API that passes unit test Lots of ugly debug stuff in there, beware --- chain/qtum/address.go | 14 ++ chain/qtum/address_test.go | 1 + chain/qtum/gas.go | 10 + chain/qtum/gas_test.go | 55 +++++ chain/qtum/qtum.go | 378 ++++++++++++++++++++++++++++++++++ chain/qtum/qtum_suite_test.go | 13 ++ chain/qtum/qtum_test.go | 147 +++++++++++++ chain/qtum/utxo.go | 32 +++ chain/qtum/utxo_test.go | 1 + infra/docker-compose.yaml | 3 - infra/qtum/Dockerfile | 10 +- infra/qtum/keygen.go | 34 ++- infra/qtum/qtum.conf | 4 +- infra/qtum/run.sh | 29 ++- 14 files changed, 709 insertions(+), 22 deletions(-) create mode 100644 chain/qtum/address.go create mode 100644 chain/qtum/address_test.go create mode 100644 chain/qtum/gas.go create mode 100644 chain/qtum/gas_test.go create mode 100644 chain/qtum/qtum.go create mode 100644 chain/qtum/qtum_suite_test.go create mode 100644 chain/qtum/qtum_test.go create mode 100644 chain/qtum/utxo.go create mode 100644 chain/qtum/utxo_test.go diff --git a/chain/qtum/address.go b/chain/qtum/address.go new file mode 100644 index 00000000..abac9215 --- /dev/null +++ b/chain/qtum/address.go @@ -0,0 +1,14 @@ +package qtum + +import "github.com/renproject/multichain/chain/bitcoin" + +type ( + // AddressEncoder re-exports bitcoin.AddressEncoder. + AddressEncoder = bitcoin.AddressEncoder + + // AddressDecoder re-exports bitcoin.AddressDecoder. + AddressDecoder = bitcoin.AddressDecoder + + // AddressEncodeDecoder re-exports bitcoin.AddressEncodeDecoder. + AddressEncodeDecoder = bitcoin.AddressEncodeDecoder +) diff --git a/chain/qtum/address_test.go b/chain/qtum/address_test.go new file mode 100644 index 00000000..2c162c04 --- /dev/null +++ b/chain/qtum/address_test.go @@ -0,0 +1 @@ +package qtum_test diff --git a/chain/qtum/gas.go b/chain/qtum/gas.go new file mode 100644 index 00000000..d9caadb7 --- /dev/null +++ b/chain/qtum/gas.go @@ -0,0 +1,10 @@ +package qtum +// DEZU: TODO: This should probably be replaced with something from Qtum + +import "github.com/renproject/multichain/chain/bitcoin" + +// GasEstimator re-exports bitcoin.GasEstimator. +type GasEstimator = bitcoin.GasEstimator + +// NewGasEstimator re-exports bitcoin.NewGasEstimator. +var NewGasEstimator = bitcoin.NewGasEstimator diff --git a/chain/qtum/gas_test.go b/chain/qtum/gas_test.go new file mode 100644 index 00000000..f6cc611b --- /dev/null +++ b/chain/qtum/gas_test.go @@ -0,0 +1,55 @@ +package qtum_test + +// DEZU: This is literally dogecoin's test with dogecoin replaced with qtum +// TODO: Check if it actually works? + +import ( + "context" + + "github.com/renproject/multichain/chain/qtum" + "github.com/renproject/pack" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("Gas", func() { + Context("when estimating qtum network fee", func() { + It("should work", func() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + client := qtum.NewClient(qtum.DefaultClientOptions()) + + // estimate fee to include tx within 1 block. + fallback1 := uint64(123) + gasEstimator1 := qtum.NewGasEstimator(client, 1, pack.NewU256FromUint64(fallback1)) + gasPrice1, _, err := gasEstimator1.EstimateGas(ctx) + if err != nil { + Expect(gasPrice1).To(Equal(pack.NewU256FromUint64(fallback1))) + } + + // estimate fee to include tx within 10 blocks. + fallback2 := uint64(234) + gasEstimator2 := qtum.NewGasEstimator(client, 10, pack.NewU256FromUint64(fallback2)) + gasPrice2, _, err := gasEstimator2.EstimateGas(ctx) + if err != nil { + Expect(gasPrice2).To(Equal(pack.NewU256FromUint64(fallback2))) + } + + // estimate fee to include tx within 100 blocks. + fallback3 := uint64(345) + gasEstimator3 := qtum.NewGasEstimator(client, 100, pack.NewU256FromUint64(fallback3)) + gasPrice3, _, err := gasEstimator3.EstimateGas(ctx) + if err != nil { + Expect(gasPrice3).To(Equal(pack.NewU256FromUint64(fallback3))) + } + + // expect fees in this order at the very least. + if err == nil { + Expect(gasPrice1.GreaterThanEqual(gasPrice2)).To(BeTrue()) + Expect(gasPrice2.GreaterThanEqual(gasPrice3)).To(BeTrue()) + } + }) + }) +}) diff --git a/chain/qtum/qtum.go b/chain/qtum/qtum.go new file mode 100644 index 00000000..5402013c --- /dev/null +++ b/chain/qtum/qtum.go @@ -0,0 +1,378 @@ +package qtum + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "log" + "math/rand" + "net/http" + "time" + + "strconv" // DEZU: TODO: Remove debug + + "github.com/btcsuite/btcd/btcjson" // DEZU: Not in qtumsuite, unsure how to handle it + "github.com/qtumproject/qtumsuite/chaincfg/chainhash" + "github.com/qtumproject/qtumsuite" + "github.com/renproject/multichain/api/address" + "github.com/renproject/multichain/api/utxo" + "github.com/renproject/pack" +) + +const ( + // DefaultClientTimeout used by the Client. + DefaultClientTimeout = time.Minute + // DefaultClientTimeoutRetry used by the Client. + DefaultClientTimeoutRetry = time.Second + // DefaultClientHost used by the Client. This should only be used for local + // deployments of the multichain. + DefaultClientHost = "http://0.0.0.0:13889" // DEZU: TODO: Change??? + // DefaultClientUser used by the Client. This is insecure, and should only + // be used for local — or publicly accessible — deployments of the + // multichain. + DefaultClientUser = "user" + // DefaultClientPassword used by the Client. This is insecure, and should + // only be used for local — or publicly accessible — deployments of the + // multichain. + DefaultClientPassword = "password" +) + +// ClientOptions are used to parameterise the behaviour of the Client. +type ClientOptions struct { + Timeout time.Duration + TimeoutRetry time.Duration + Host string + User string + Password string +} + +// DefaultClientOptions returns ClientOptions with the default settings. These +// settings are valid for use with the default local deployment of the +// multichain. In production, the host, user, and password should be changed. +func DefaultClientOptions() ClientOptions { + return ClientOptions{ + Timeout: DefaultClientTimeout, + TimeoutRetry: DefaultClientTimeoutRetry, + Host: DefaultClientHost, + User: DefaultClientUser, + Password: DefaultClientPassword, + } +} + +// WithHost sets the URL of the Bitcoin node. +func (opts ClientOptions) WithHost(host string) ClientOptions { + opts.Host = host + return opts +} + +// WithUser sets the username that will be used to authenticate with the Bitcoin +// node. +func (opts ClientOptions) WithUser(user string) ClientOptions { + opts.User = user + return opts +} + +// WithPassword sets the password that will be used to authenticate with the +// Bitcoin node. +func (opts ClientOptions) WithPassword(password string) ClientOptions { + opts.Password = password + return opts +} + +// A Client interacts with an instance of the Bitcoin network using the RPC +// interface exposed by a Bitcoin node. +type Client interface { + utxo.Client + // UnspentOutputs spendable by the given address. + UnspentOutputs(ctx context.Context, minConf, maxConf int64, address address.Address) ([]utxo.Output, error) + // Confirmations of a transaction in the Bitcoin network. + Confirmations(ctx context.Context, txHash pack.Bytes) (int64, error) + // EstimateSmartFee + EstimateSmartFee(ctx context.Context, numBlocks int64) (float64, error) + // EstimateFeeLegacy + EstimateFeeLegacy(ctx context.Context, numBlocks int64) (float64, error) +} + +type client struct { + opts ClientOptions + httpClient http.Client +} + +// NewClient returns a new Client. +func NewClient(opts ClientOptions) Client { + httpClient := http.Client{} + httpClient.Timeout = opts.Timeout + return &client{ + opts: opts, + httpClient: httpClient, + } +} + +// Output associated with an outpoint, and its number of confirmations. +func (client *client) Output(ctx context.Context, outpoint utxo.Outpoint) (utxo.Output, pack.U64, error) { + resp := btcjson.TxRawResult{} + hash := chainhash.Hash{} + copy(hash[:], outpoint.Hash) + if err := client.send(ctx, &resp, "getrawtransaction", hash.String(), 1); err != nil { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad \"getrawtransaction\": %v", err) + } + if outpoint.Index.Uint32() >= uint32(len(resp.Vout)) { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad index: %v is out of range", outpoint.Index) + } + vout := resp.Vout[outpoint.Index.Uint32()] + amount, err := qtumsuite.NewAmount(vout.Value) + if err != nil { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad amount: %v", err) + } + if amount < 0 { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad amount: %v", amount) + } + pubKeyScript, err := hex.DecodeString(vout.ScriptPubKey.Hex) + if err != nil { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad pubkey script: %v", err) + } + output := utxo.Output{ + Outpoint: outpoint, + Value: pack.NewU256FromU64(pack.NewU64(uint64(amount))), + PubKeyScript: pack.NewBytes(pubKeyScript), + } + return output, pack.NewU64(resp.Confirmations), nil +} + +// UnspentOutput returns the unspent transaction output identified by the +// given outpoint. It also returns the number of confirmations for the +// output. If the output cannot be found before the context is done, the +// output is invalid, or the output has been spent, then an error should be +// returned. +func (client *client) UnspentOutput(ctx context.Context, outpoint utxo.Outpoint) (utxo.Output, pack.U64, error) { + resp := btcjson.GetTxOutResult{} + hash := chainhash.Hash{} + copy(hash[:], outpoint.Hash) + if err := client.send(ctx, &resp, "gettxout", hash.String(), outpoint.Index.Uint32()); err != nil { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad \"gettxout\": %v", err) + } + amount, err := qtumsuite.NewAmount(resp.Value) + if err != nil { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad amount: %v", err) + } + if amount < 0 { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad amount: %v", amount) + } + if resp.Confirmations < 0 { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad confirmations: %v", resp.Confirmations) + } + pubKeyScript, err := hex.DecodeString(resp.ScriptPubKey.Hex) + if err != nil { + return utxo.Output{}, pack.NewU64(0), fmt.Errorf("bad pubkey script: %v", err) + } + output := utxo.Output{ + Outpoint: outpoint, + Value: pack.NewU256FromU64(pack.NewU64(uint64(amount))), + PubKeyScript: pack.NewBytes(pubKeyScript), + } + return output, pack.NewU64(uint64(resp.Confirmations)), nil +} + +// SubmitTx to the Bitcoin network. +func (client *client) SubmitTx(ctx context.Context, tx utxo.Tx) error { + serial, err := tx.Serialize() + if err != nil { + return fmt.Errorf("bad tx: %v", err) + } + resp := "" + if err := client.send(ctx, &resp, "sendrawtransaction", hex.EncodeToString(serial)); err != nil { + return fmt.Errorf("bad \"sendrawtransaction\": %v", err) + } + return nil +} + +// UnspentOutputs spendable by the given address. +func (client *client) UnspentOutputs(ctx context.Context, minConf, maxConf int64, addr address.Address) ([]utxo.Output, error) { + fmt.Println("(fun UnspentOutputs) Creating request: 'listunspent " + strconv.FormatInt(minConf, 10) + " " + strconv.FormatInt(maxConf, 10) + " " + string(addr) + "'") // DEZU: TODO: Remove debug + + resp := []btcjson.ListUnspentResult{} + if err := client.send(ctx, &resp, "listunspent", minConf, maxConf, []string{string(addr)}); err != nil && err != io.EOF { + return []utxo.Output{}, fmt.Errorf("bad \"listunspent\": %v", err) + } + outputs := make([]utxo.Output, len(resp)) + for i := range outputs { + amount, err := qtumsuite.NewAmount(resp[i].Amount) + if err != nil { + return []utxo.Output{}, fmt.Errorf("bad amount: %v", err) + } + if amount < 0 { + return []utxo.Output{}, fmt.Errorf("bad amount: %v", amount) + } + pubKeyScript, err := hex.DecodeString(resp[i].ScriptPubKey) + if err != nil { + return []utxo.Output{}, fmt.Errorf("bad pubkey script: %v", err) + } + txid, err := chainhash.NewHashFromStr(resp[i].TxID) + if err != nil { + return []utxo.Output{}, fmt.Errorf("bad txid: %v", err) + } + outputs[i] = utxo.Output{ + Outpoint: utxo.Outpoint{ + Hash: pack.NewBytes(txid[:]), + Index: pack.NewU32(resp[i].Vout), + }, + Value: pack.NewU256FromU64(pack.NewU64(uint64(amount))), + PubKeyScript: pack.NewBytes(pubKeyScript), + } + } + return outputs, nil +} + +// Confirmations of a transaction in the Bitcoin network. +func (client *client) Confirmations(ctx context.Context, txHash pack.Bytes) (int64, error) { + resp := btcjson.GetTransactionResult{} + + size := len(txHash) + txHashReversed := make([]byte, size) + copy(txHashReversed[:], txHash[:]) + for i := 0; i < size/2; i++ { + txHashReversed[i], txHashReversed[size-1-i] = txHashReversed[size-1-i], txHashReversed[i] + } + + if err := client.send(ctx, &resp, "gettransaction", hex.EncodeToString(txHashReversed)); err != nil { + return 0, fmt.Errorf("bad \"gettransaction\": %v", err) + } + confirmations := resp.Confirmations + if confirmations < 0 { + confirmations = 0 + } + return confirmations, nil +} + +// EstimateSmartFee fetches the estimated bitcoin network fees to be paid (in +// BTC per kilobyte) needed for a transaction to be confirmed within `numBlocks` +// blocks. An error will be returned if the bitcoin node hasn't observed enough +// blocks to make an estimate for the provided target `numBlocks`. +func (client *client) EstimateSmartFee(ctx context.Context, numBlocks int64) (float64, error) { + fmt.Println("(fun EstimateSmartFee) Creating request: 'estimatesmartfee " + strconv.FormatInt(numBlocks, 10) + " '") // DEZU: TODO: Remove debug + + resp := btcjson.EstimateSmartFeeResult{} + + if err := client.send(ctx, &resp, "estimatesmartfee", numBlocks); err != nil { + return 0.0, fmt.Errorf("estimating smart fee: %v", err) + } + + if resp.Errors != nil && len(resp.Errors) > 0 { + return 0.0, fmt.Errorf("estimating smart fee: %v", resp.Errors[0]) + } + + return *resp.FeeRate, nil +} + +func (client *client) EstimateFeeLegacy(ctx context.Context, numBlocks int64) (float64, error) { + var resp float64 + + switch numBlocks { + case int64(0): + if err := client.send(ctx, &resp, "estimatefee"); err != nil { + return 0.0, fmt.Errorf("estimating fee: %v", err) + } + default: + if err := client.send(ctx, &resp, "estimatefee", numBlocks); err != nil { + return 0.0, fmt.Errorf("estimating fee: %v", err) + } + } + + return resp, nil +} + +func (client *client) send(ctx context.Context, resp interface{}, method string, params ...interface{}) error { + // Encode the request. + data, err := encodeRequest(method, params) + if err != nil { + return err + } + + return retry(ctx, client.opts.TimeoutRetry, func() error { + // Create request and add basic authentication headers. The context is + // not attached to the request, and instead we all each attempt to run + // for the timeout duration, and we keep attempting until success, or + // the context is done. + req, err := http.NewRequest("POST", client.opts.Host, bytes.NewBuffer(data)) + if err != nil { + return fmt.Errorf("(fun send) building http request: %v", err) + } + req.SetBasicAuth(client.opts.User, client.opts.Password) + + // Send the request and decode the response. + res, err := client.httpClient.Do(req) + if err != nil { + return fmt.Errorf("(fun send) sending http request: %v", err) + } + defer res.Body.Close() + if err := decodeResponse(resp, res.Body); err != nil { + return fmt.Errorf("(fun send) decoding http response: %v", err) + } + return nil + }) +} + +func encodeRequest(method string, params []interface{}) ([]byte, error) { + fmt.Println("(fun encodeRequest) encoding request '" + method + "'") // DEZU: TODO: Remove debug + rawParams, err := json.Marshal(params) + if err != nil { + return nil, fmt.Errorf("encoding params: %v", err) + } + req := struct { + Version string `json:"version"` + ID int `json:"id"` + Method string `json:"method"` + Params json.RawMessage `json:"params"` + }{ + Version: "2.0", + ID: rand.Int(), + Method: method, + Params: rawParams, + } + rawReq, err := json.Marshal(req) + if err != nil { + return nil, fmt.Errorf("fun encodeRequest) encoding request: %v", err) + } + return rawReq, nil +} + +func decodeResponse(resp interface{}, r io.Reader) error { + res := struct { + Version string `json:"version"` + ID int `json:"id"` + Result *json.RawMessage `json:"result"` + Error *json.RawMessage `json:"error"` + }{} + + if err := json.NewDecoder(r).Decode(&res); err != nil { + return fmt.Errorf("(OPT1)decoding response: %v", err) // DEZU: TODO: Remove debug + } + if res.Error != nil { + return fmt.Errorf("(OPT2)decoding response: %v", string(*res.Error)) // DEZU: TODO: Remove debug + } + if res.Result == nil { + return fmt.Errorf("(OPT3)decoding result: result is nil") // DEZU: TODO: Remove debug + } + if err := json.Unmarshal(*res.Result, resp); err != nil { + return fmt.Errorf("(OPT4)decoding result: %v", err) // DEZU: TODO: Remove debug + } + return nil +} + +func retry(ctx context.Context, dur time.Duration, f func() error) error { + ticker := time.NewTicker(dur) + err := f() + for err != nil { + log.Printf("retrying: %v", err) + select { + case <-ctx.Done(): + return fmt.Errorf("%v: %v", ctx.Err(), err) + case <-ticker.C: + err = f() + } + } + return nil +} diff --git a/chain/qtum/qtum_suite_test.go b/chain/qtum/qtum_suite_test.go new file mode 100644 index 00000000..243cecde --- /dev/null +++ b/chain/qtum/qtum_suite_test.go @@ -0,0 +1,13 @@ +package qtum_test + +import ( + "testing" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +func TestQtum(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Qtum Suite") +} diff --git a/chain/qtum/qtum_test.go b/chain/qtum/qtum_test.go new file mode 100644 index 00000000..4845563b --- /dev/null +++ b/chain/qtum/qtum_test.go @@ -0,0 +1,147 @@ +package qtum_test + +// DEZU: This is a straight rip of dogecoin's implementation + +import ( + "context" + "log" + "os" + "reflect" + "time" + + "github.com/btcsuite/btcutil" + "github.com/btcsuite/btcd/chaincfg" + "github.com/renproject/id" + "github.com/renproject/multichain/api/address" + "github.com/renproject/multichain/api/utxo" + "github.com/renproject/multichain/chain/qtum" + "github.com/renproject/pack" + //"github.com/qtumproject/qtumsuite/chaincfg" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + + // DEZU: values take from from qtumsuit +var RegressionNetParams = chaincfg.Params{ + Name: "regtest", + DefaultPort: "23888", + + Net: 0xe1c6ddfd, + + // Address encoding magics + PubKeyHashAddrID: 120, // starts with m or n + ScriptHashAddrID: 110, // starts with 2 + PrivateKeyID: 239, // starts with 9 (uncompressed) or c (compressed) + + // BIP32 hierarchical deterministic extended key magics + HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv + HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub + + // Human-readable part for Bech32 encoded segwit addresses, as defined in BIP 173. + Bech32HRPSegwit: "qcrt", +} + +var _ = Describe("Qtum", func() { + Context("when submitting transactions", func() { + Context("when sending QTUM to multiple addresses", func() { + It("should work", func() { + // Load private key, and assume that the associated address has + // funds to spend. You can do this by setting QTUM_PK to the + // value specified in the `./multichaindeploy/.env` file. + pkEnv := os.Getenv("QTUM_PK") + if pkEnv == "" { + panic("QTUM_PK is undefined") + } + wif, err := btcutil.DecodeWIF(pkEnv) + Expect(err).ToNot(HaveOccurred()) + + // PKH + pkhAddr, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.PrivKey.PubKey().SerializeCompressed()), &RegressionNetParams) + Expect(err).ToNot(HaveOccurred()) + pkhAddrUncompressed, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.PrivKey.PubKey().SerializeUncompressed()), &RegressionNetParams) + Expect(err).ToNot(HaveOccurred()) + log.Printf("PKH %v", pkhAddr.EncodeAddress()) + log.Printf("PKH (uncompressed) %v", pkhAddrUncompressed.EncodeAddress()) + + // Setup the client and load the unspent transaction outputs. + client := qtum.NewClient(qtum.DefaultClientOptions().WithHost("http://127.0.0.1:13889")) // DEZU: TODO: This is QTUM's testnet address, is that the one? + outputs, err := client.UnspentOutputs(context.Background(), 0, 999999999, address.Address(pkhAddr.EncodeAddress())) + Expect(err).ToNot(HaveOccurred()) + Expect(len(outputs)).To(BeNumerically(">", 0)) + output := outputs[0] + + // Check that we can load the output and that it is equal. + // Otherwise, something strange is happening with the RPC + // client. + output2, _, err := client.Output(context.Background(), output.Outpoint) + Expect(err).ToNot(HaveOccurred()) + Expect(reflect.DeepEqual(output, output2)).To(BeTrue()) + + // Build the transaction by consuming the outputs and spending + // them to a set of recipients. + inputs := []utxo.Input{ + {Output: output}, + } + recipients := []utxo.Recipient{ + { + To: address.Address(pkhAddr.EncodeAddress()), + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: the constant fee here will cause error if too low, demand of > 90000 seems common + }, + { + To: address.Address(pkhAddrUncompressed.EncodeAddress()), + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: Ditto above + }, + } + tx, err := qtum.NewTxBuilder(&RegressionNetParams).BuildTx(inputs, recipients) + Expect(err).ToNot(HaveOccurred()) + + // Get the digests that need signing from the transaction, and + // sign them. In production, this would be done using the RZL + // MPC algorithm, but for the purposes of this test, using an + // explicit privkey is ok. + sighashes, err := tx.Sighashes() + signatures := make([]pack.Bytes65, len(sighashes)) + Expect(err).ToNot(HaveOccurred()) + for i := range sighashes { + hash := id.Hash(sighashes[i]) + privKey := (*id.PrivKey)(wif.PrivKey) + signature, err := privKey.Sign(&hash) + Expect(err).ToNot(HaveOccurred()) + signatures[i] = pack.NewBytes65(signature) + } + Expect(tx.Sign(signatures, pack.NewBytes(wif.SerializePubKey()))).To(Succeed()) + + // Submit the transaction to the Qtum node. Again, this + // should be running a la `./multichaindeploy`. + txHash, err := tx.Hash() + Expect(err).ToNot(HaveOccurred()) + err = client.SubmitTx(context.Background(), tx) + Expect(err).ToNot(HaveOccurred()) + log.Printf("TXID %v", txHash) + + for { + // Loop until the transaction has at least a few + // confirmations. This implies that the transaction is + // definitely valid, and the test has passed. We were + // successfully able to use the multichain to construct and + // submit a Qtum transaction! + confs, err := client.Confirmations(context.Background(), txHash) + Expect(err).ToNot(HaveOccurred()) + log.Printf(" %v/3 confirmations", confs) + if confs >= 3 { + break + } + time.Sleep(10 * time.Second) + } + + // Check that we can load the output and that it is equal. + // Otherwise, something strange is happening with the RPC + // client. + output2, _, err = client.Output(context.Background(), output.Outpoint) + Expect(err).ToNot(HaveOccurred()) + Expect(reflect.DeepEqual(output, output2)).To(BeTrue()) + }) + }) + }) +}) diff --git a/chain/qtum/utxo.go b/chain/qtum/utxo.go new file mode 100644 index 00000000..8c61b0fd --- /dev/null +++ b/chain/qtum/utxo.go @@ -0,0 +1,32 @@ +package qtum + +import "github.com/renproject/multichain/chain/bitcoin" + +type ( + // Tx re-exports bitcoin.Tx. + Tx = bitcoin.Tx + + // TxBuilder re-exports bitcoin.TxBuilder. + TxBuilder = bitcoin.TxBuilder + + // Client re-exports bitcoin.Client. + //Client = bitcoin.Client + + // ClientOptions re-exports bitcoin.ClientOptions. + //ClientOptions = bitcoin.ClientOptions +) + +var ( + // NewTxBuilder re-exports bitcoin.NewTxBuilder. + NewTxBuilder = bitcoin.NewTxBuilder + + // NewClient re-exports bitcoin.NewClient. + //NewClient = bitcoin.NewClient +) + +// DefaultClientOptions returns ClientOptions with the default settings. These +// settings are valid for use with the default local deployment of the +// multichain. In production, the host, user, and password should be changed. +//func DefaultClientOptions() ClientOptions { +// return bitcoin.DefaultClientOptions().WithHost("http://0.0.0.0:3888") // DEZU: This should probably be one of 3888, 3889, 13888, 13889 +//} diff --git a/chain/qtum/utxo_test.go b/chain/qtum/utxo_test.go new file mode 100644 index 00000000..2c162c04 --- /dev/null +++ b/chain/qtum/utxo_test.go @@ -0,0 +1 @@ +package qtum_test diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 6a8ca03f..701ce2c6 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -117,13 +117,10 @@ services: # # Qtum # - # DEZU; TODO qtum: build: context: ./qtum ports: - - "0.0.0.0:3888:3888" - - "0.0.0.0:3889:3889" - "0.0.0.0:13888:13888" - "0.0.0.0:13889:13889" entrypoint: diff --git a/infra/qtum/Dockerfile b/infra/qtum/Dockerfile index b647b962..3dfc5592 100644 --- a/infra/qtum/Dockerfile +++ b/infra/qtum/Dockerfile @@ -1,8 +1,7 @@ # DEZU: Originally stolen from qtum-docker github page FROM ubuntu -# MAINTAINER pandazwb -RUN apt-get update && apt-get install --yes -qq --no-install-recommends ca-certificates curl wget apt-utils jq +RUN apt-get update --fix-missing && apt-get install --yes -qq --no-install-recommends ca-certificates curl wget apt-utils jq RUN apt-get install --yes curl # install qtum binaries @@ -11,10 +10,11 @@ RUN mv ./qtum-0.20.1 /app RUN chmod +x /app/bin/qtumd RUN chmod +x /app/bin/qtum-cli -COPY qtum.conf /root/.qtum/ -COPY run.sh /root/ +COPY qtum.conf /root/.qtum/qtum.conf +COPY run.sh /root/run.sh RUN chmod +x /root/run.sh -EXPOSE 3888 3889 13888 13889 +# DEZU: Not sure if these are technically correct for regtest, but they work +EXPOSE 13888 13889 ENTRYPOINT ["./root/run.sh"] diff --git a/infra/qtum/keygen.go b/infra/qtum/keygen.go index 2af5addc..c794bd9b 100644 --- a/infra/qtum/keygen.go +++ b/infra/qtum/keygen.go @@ -1,28 +1,46 @@ - package main -/* -// DEZU: Literally dogecoin's function with dogecoin swapped for qtum. Very unlikely to work, but yoloswag etc + +// DEZU: Straight copy of bitcoin's implementation with Qtums chain configs tacked on + import ( "fmt" "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcutil" - "github.com/renproject/id" - "github.com/renproject/multichain/chain/qtum" ) +// DEZU: values take from from qtumsuit +var RegressionNetParams = chaincfg.Params{ + Name: "regtest", + DefaultPort: "23888", + + Net: 0xe1c6ddfd, + + // Address encoding magics + PubKeyHashAddrID: 120, // starts with m or n + ScriptHashAddrID: 110, // starts with 2 + PrivateKeyID: 239, // starts with 9 (uncompressed) or c (compressed) + + // BIP32 hierarchical deterministic extended key magics + HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv + HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub + + // Human-readable part for Bech32 encoded segwit addresses, as defined in BIP 173. + Bech32HRPSegwit: "qcrt", +} + func main() { privKey := id.NewPrivKey() - wif, err := btcutil.NewWIF((*btcec.PrivateKey)(privKey), &qtum.RegressionNetParams, true) + wif, err := btcutil.NewWIF((*btcec.PrivateKey)(privKey), &RegressionNetParams, true) if err != nil { panic(err) } - addrPubKeyHash, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.SerializePubKey()), &qtum.RegressionNetParams) + addrPubKeyHash, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.SerializePubKey()), &RegressionNetParams) if err != nil { panic(err) } fmt.Printf("QTUM_PK=%v\n", wif) fmt.Printf("QTUM_ADDRESS=%v\n", addrPubKeyHash) } -*/ diff --git a/infra/qtum/qtum.conf b/infra/qtum/qtum.conf index efdd9136..b04d1351 100644 --- a/infra/qtum/qtum.conf +++ b/infra/qtum/qtum.conf @@ -1,7 +1,7 @@ daemon=1 regtest=1 -rpcuser=qtum -rpcpassword=qtumtest +rpcuser=user +rpcpassword=password rpcallowip=0.0.0.0/0 server=1 txindex=1 diff --git a/infra/qtum/run.sh b/infra/qtum/run.sh index d6ff9ec2..64d19afd 100644 --- a/infra/qtum/run.sh +++ b/infra/qtum/run.sh @@ -7,7 +7,7 @@ PRIV_KEY=$2 sleep 10 # Print setup -echo "QTUM_ADDRESS=$ADDRESS" +echo "(QTUM): QTUM_ADDRESS=$ADDRESS" # Import the address /app/bin/qtum-cli importaddress $ADDRESS @@ -15,12 +15,33 @@ echo "QTUM_ADDRESS=$ADDRESS" # Import the private key to spend UTXOs /app/bin/qtum-cli importprivkey $PRIV_KEY -# Generate enough block to pass the maturation time -/app/bin/qtum-cli generatetoaddress 101 $ADDRESS +echo "(QTUM): Trying to generate 501 blocks..." # DEZU: TODO: Remove debug +# Generate enough block to pass the maturation time (500 for Qtum) +/app/bin/qtum-cli generatetoaddress 501 $ADDRESS +echo "(QTUM): Blocks (hopefully) generated!" # DEZU: TODO: Remove debug + +echo "(QTUM): Running 'getbalance'..." # DEZU: TODO: Remove debug +/app/bin/qtum-cli getbalance + +echo "(QTUM): Running 'getwalletinfo'..." # DEZU: TODO: Remove debug +/app/bin/qtum-cli getwalletinfo + +echo "(QTUM): Running 'estimatesmartfee 10'..." # DEZU: TODO: Remove debug +/app/bin/qtum-cli estimatesmartfee 10 + +#echo "(QTUM): Running 'listunspent 0 999999999 qb15NCu3w4zyd14L21P99AdqmovHCiCEqC'..." # DEZU: TODO: Remove debug +#/app/bin/qtum-cli listunspent 0 999999999 qb15NCu3w4zyd14L21P99AdqmovHCiCEqC | cat # Simulate mining while : do + echo "(QTUM): Running 'generatetoaddress 1'..." # DEZU: TODO: Remove debug /app/bin/qtum-cli generatetoaddress 1 $ADDRESS - sleep 10 + sleep 1 + # send tx to own address while paying fee to the miner + echo "(QTUM): Running 'sendtoaddress $ADDRESS 0.5 "" "" true'..." # DEZU: TODO: Remove debug + /app/bin/qtum-cli sendtoaddress $ADDRESS 0.5 "" "" true + sleep 1 + echo "(QTUM): Running 'estimatesmartfee 15'..." # DEZU: TODO: Remove debug + /app/bin/qtum-cli estimatesmartfee 10 done From bae46925d5cbf0f9c0393b533188c639314235b6 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Mon, 23 Nov 2020 21:09:48 +0100 Subject: [PATCH 11/21] I really need to learn gitignore --- go.mod | 1 + go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 14b2407c..1bbcfc83 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/multiformats/go-varint v0.0.6 github.com/onsi/ginkgo v1.14.0 github.com/onsi/gomega v1.10.1 + github.com/qtumproject/qtumsuite v0.0.0-20191105052314-80f1a6a75e13 github.com/renproject/id v0.4.2 github.com/renproject/pack v0.2.5 github.com/renproject/surge v1.2.6 diff --git a/go.sum b/go.sum index 2137e7ef..6075dfc1 100644 --- a/go.sum +++ b/go.sum @@ -1395,6 +1395,8 @@ github.com/prometheus/procfs v0.1.0 h1:jhMy6QXfi3y2HEzFoyuCj40z4OZIIHHPtFyCMftmv github.com/prometheus/procfs v0.1.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/qtumproject/qtumsuite v0.0.0-20191105052314-80f1a6a75e13 h1:3fxP1D+f2TMX40UwBZ9RxEv6GsZj9zOcQFelbuX3BZI= +github.com/qtumproject/qtumsuite v0.0.0-20191105052314-80f1a6a75e13/go.mod h1:ZfvUvGS7v5iZTFQsBTCV1Z3yxEG7EO+IjB1NChEI4nE= github.com/rakyll/statik v0.1.6/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= github.com/raulk/clock v1.1.0 h1:dpb29+UKMbLqiU/jqIJptgLR1nn23HLgMY0sTCDza5Y= github.com/raulk/clock v1.1.0/go.mod h1:3MpVxdZ/ODBQDxbN+kzshf5OSZwPjtMDx6BBXBmOeY0= From faaf79a5471dbef58b511d09b021d9e1b778b143 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Mon, 23 Nov 2020 21:25:14 +0100 Subject: [PATCH 12/21] Add comment on weirdly high tx fee --- chain/qtum/qtum_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chain/qtum/qtum_test.go b/chain/qtum/qtum_test.go index 4845563b..eb66f338 100644 --- a/chain/qtum/qtum_test.go +++ b/chain/qtum/qtum_test.go @@ -86,11 +86,11 @@ var _ = Describe("Qtum", func() { recipients := []utxo.Recipient{ { To: address.Address(pkhAddr.EncodeAddress()), - Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: the constant fee here will cause error if too low, demand of > 90000 seems common - }, + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: the constant fee here will cause test error if too low, demand of > 90000 seems common + }, // TODO: Examinate why this value needs to be so high for Qtum (was 1000 for BTC) { To: address.Address(pkhAddrUncompressed.EncodeAddress()), - Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: Ditto above + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: Ditto above }, } tx, err := qtum.NewTxBuilder(&RegressionNetParams).BuildTx(inputs, recipients) From 4e4c1bae321b92ab81b08fad6f9af0a1d85837fd Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Mon, 23 Nov 2020 21:26:12 +0100 Subject: [PATCH 13/21] Clean up the docker-side script a bit --- infra/qtum/run.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/infra/qtum/run.sh b/infra/qtum/run.sh index 64d19afd..9a85ca8c 100644 --- a/infra/qtum/run.sh +++ b/infra/qtum/run.sh @@ -20,14 +20,14 @@ echo "(QTUM): Trying to generate 501 blocks..." # DEZU: TODO: Remove debug /app/bin/qtum-cli generatetoaddress 501 $ADDRESS echo "(QTUM): Blocks (hopefully) generated!" # DEZU: TODO: Remove debug -echo "(QTUM): Running 'getbalance'..." # DEZU: TODO: Remove debug -/app/bin/qtum-cli getbalance +#echo "(QTUM): Running 'getbalance'..." # DEZU: TODO: Remove debug +#/app/bin/qtum-cli getbalance -echo "(QTUM): Running 'getwalletinfo'..." # DEZU: TODO: Remove debug -/app/bin/qtum-cli getwalletinfo +#echo "(QTUM): Running 'getwalletinfo'..." # DEZU: TODO: Remove debug +#/app/bin/qtum-cli getwalletinfo -echo "(QTUM): Running 'estimatesmartfee 10'..." # DEZU: TODO: Remove debug -/app/bin/qtum-cli estimatesmartfee 10 +#echo "(QTUM): Running 'estimatesmartfee 10'..." # DEZU: TODO: Remove debug +#/app/bin/qtum-cli estimatesmartfee 10 #echo "(QTUM): Running 'listunspent 0 999999999 qb15NCu3w4zyd14L21P99AdqmovHCiCEqC'..." # DEZU: TODO: Remove debug #/app/bin/qtum-cli listunspent 0 999999999 qb15NCu3w4zyd14L21P99AdqmovHCiCEqC | cat @@ -37,11 +37,11 @@ while : do echo "(QTUM): Running 'generatetoaddress 1'..." # DEZU: TODO: Remove debug /app/bin/qtum-cli generatetoaddress 1 $ADDRESS - sleep 1 + sleep 5 # send tx to own address while paying fee to the miner echo "(QTUM): Running 'sendtoaddress $ADDRESS 0.5 "" "" true'..." # DEZU: TODO: Remove debug /app/bin/qtum-cli sendtoaddress $ADDRESS 0.5 "" "" true - sleep 1 - echo "(QTUM): Running 'estimatesmartfee 15'..." # DEZU: TODO: Remove debug - /app/bin/qtum-cli estimatesmartfee 10 + sleep 5 + #echo "(QTUM): Running 'estimatesmartfee 15'..." # DEZU: TODO: Remove debug + #/app/bin/qtum-cli estimatesmartfee 10 done From fc54cfb8f1de317b240bc8871832caa7f10938f4 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 01:39:11 +0100 Subject: [PATCH 14/21] Prettify docker stuff --- infra/docker-compose.yaml | 4 ++-- infra/qtum/Dockerfile | 5 +++-- infra/qtum/keygen.go | 13 +++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 701ce2c6..853adb13 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -121,8 +121,8 @@ services: build: context: ./qtum ports: - - "0.0.0.0:13888:13888" - - "0.0.0.0:13889:13889" + - "0.0.0.0:13888:13888" # These addresses are actually for testnet, + - "0.0.0.0:13889:13889" # but they work in regtest too apparently entrypoint: - "./root/run.sh" - "${QTUM_ADDRESS}" diff --git a/infra/qtum/Dockerfile b/infra/qtum/Dockerfile index 3dfc5592..a7ee6b4c 100644 --- a/infra/qtum/Dockerfile +++ b/infra/qtum/Dockerfile @@ -1,4 +1,5 @@ -# DEZU: Originally stolen from qtum-docker github page +# DEZU: Modified version of file from qtum-docker github page +# I'm not 100% sure if all commands here are necessary, I've done a lot of copypasta FROM ubuntu RUN apt-get update --fix-missing && apt-get install --yes -qq --no-install-recommends ca-certificates curl wget apt-utils jq @@ -14,7 +15,7 @@ COPY qtum.conf /root/.qtum/qtum.conf COPY run.sh /root/run.sh RUN chmod +x /root/run.sh -# DEZU: Not sure if these are technically correct for regtest, but they work +# These addresses are actually for testnet, but they work in regtest too apparently EXPOSE 13888 13889 ENTRYPOINT ["./root/run.sh"] diff --git a/infra/qtum/keygen.go b/infra/qtum/keygen.go index c794bd9b..f9bb9496 100644 --- a/infra/qtum/keygen.go +++ b/infra/qtum/keygen.go @@ -11,13 +11,13 @@ import ( "github.com/renproject/id" ) -// DEZU: values take from from qtumsuit +// Copied from multichain/chain/qtum/qtum.go +// RegressionNetParams returns the chain configuration for regression net. var RegressionNetParams = chaincfg.Params{ - Name: "regtest", + Name: "regtest", + Net: 0xe1c6ddfd, DefaultPort: "23888", - Net: 0xe1c6ddfd, - // Address encoding magics PubKeyHashAddrID: 120, // starts with m or n ScriptHashAddrID: 110, // starts with 2 @@ -27,8 +27,9 @@ var RegressionNetParams = chaincfg.Params{ HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub - // Human-readable part for Bech32 encoded segwit addresses, as defined in BIP 173. - Bech32HRPSegwit: "qcrt", + // Human-readable part for Bech32 encoded segwit addresses, as defined in + // BIP 173. + Bech32HRPSegwit: "qcrt", // always bcrt for reg test net } func main() { From 79d1c0692c40a85414e1edd99e393816eb66458e Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 01:49:59 +0100 Subject: [PATCH 15/21] Prettify some files, remove comments etc --- chain/qtum/gas.go | 3 ++- chain/qtum/gas_test.go | 3 +-- chain/qtum/utxo.go | 16 ---------------- multichain.go | 12 ++++++------ 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/chain/qtum/gas.go b/chain/qtum/gas.go index d9caadb7..231e025d 100644 --- a/chain/qtum/gas.go +++ b/chain/qtum/gas.go @@ -1,5 +1,6 @@ package qtum -// DEZU: TODO: This should probably be replaced with something from Qtum + +// I *Think* it is fine to simply use Bitcoin's estimator here import "github.com/renproject/multichain/chain/bitcoin" diff --git a/chain/qtum/gas_test.go b/chain/qtum/gas_test.go index f6cc611b..7b750127 100644 --- a/chain/qtum/gas_test.go +++ b/chain/qtum/gas_test.go @@ -1,7 +1,6 @@ package qtum_test -// DEZU: This is literally dogecoin's test with dogecoin replaced with qtum -// TODO: Check if it actually works? +// Shamelessly stolen from Dogecoin's re-export of bitcoin's implementation. Steal-ception! import ( "context" diff --git a/chain/qtum/utxo.go b/chain/qtum/utxo.go index 8c61b0fd..1bd535f3 100644 --- a/chain/qtum/utxo.go +++ b/chain/qtum/utxo.go @@ -8,25 +8,9 @@ type ( // TxBuilder re-exports bitcoin.TxBuilder. TxBuilder = bitcoin.TxBuilder - - // Client re-exports bitcoin.Client. - //Client = bitcoin.Client - - // ClientOptions re-exports bitcoin.ClientOptions. - //ClientOptions = bitcoin.ClientOptions ) var ( // NewTxBuilder re-exports bitcoin.NewTxBuilder. NewTxBuilder = bitcoin.NewTxBuilder - - // NewClient re-exports bitcoin.NewClient. - //NewClient = bitcoin.NewClient ) - -// DefaultClientOptions returns ClientOptions with the default settings. These -// settings are valid for use with the default local deployment of the -// multichain. In production, the host, user, and password should be changed. -//func DefaultClientOptions() ClientOptions { -// return bitcoin.DefaultClientOptions().WithHost("http://0.0.0.0:3888") // DEZU: This should probably be one of 3888, 3889, 13888, 13889 -//} diff --git a/multichain.go b/multichain.go index 5c87a13c..ea023439 100644 --- a/multichain.go +++ b/multichain.go @@ -108,7 +108,7 @@ const ( ETH = Asset("ETH") // Ether FIL = Asset("FIL") // Filecoin FTM = Asset("FTM") // Fantom - QTUM = Asset("QTUM") // DEZU: Added Qtum! + QTUM = Asset("QTUM") // Qtum SOL = Asset("SOL") // Solana LUNA = Asset("LUNA") // Luna ZEC = Asset("ZEC") // Zcash @@ -146,7 +146,7 @@ func (asset Asset) OriginChain() Chain { case LUNA: return Terra case QTUM: - return Qtum // DEZU: Added Qtum + return Qtum case SOL: return Solana case ZEC: @@ -170,7 +170,7 @@ func (asset Asset) OriginChain() Chain { // ChainType returns the chain-type (Account or UTXO) for the given asset func (asset Asset) ChainType() ChainType { switch asset { - case BCH, BTC, DGB, DOGE, ZEC, QTUM: // DEZU: Added Qtum. Is it really only UTX, or also account? + case BCH, BTC, DGB, DOGE, ZEC, QTUM: return ChainTypeUTXOBased case BNB, ETH, FIL, LUNA: return ChainTypeAccountBased @@ -221,7 +221,7 @@ const ( Ethereum = Chain("Ethereum") Fantom = Chain("Fantom") Filecoin = Chain("Filecoin") - Qtum = Chain("Qtum") // DEZU: Added Qtum + Qtum = Chain("Qtum") Solana = Chain("Solana") Terra = Chain("Terra") Zcash = Chain("Zcash") @@ -256,7 +256,7 @@ func (chain *Chain) Unmarshal(buf []byte, rem int) ([]byte, int, error) { // for the chain. func (chain Chain) ChainType() ChainType { switch chain { - case Bitcoin, BitcoinCash, DigiByte, Dogecoin, Zcash, Qtum: // DEZU: Added Qtum. Is it really only UTX, or also account? + case Bitcoin, BitcoinCash, DigiByte, Dogecoin, Zcash, Qtum: return ChainTypeUTXOBased case BinanceSmartChain, Ethereum, Filecoin, Terra: return ChainTypeAccountBased @@ -307,7 +307,7 @@ func (chain Chain) NativeAsset() Asset { case Terra: return LUNA case Qtum: - return QTUM // DEZU: Added Qtum + return QTUM case Zcash: return ZEC From bec793cf927c5b9a954e829878a88abaacd61630 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 04:02:00 +0100 Subject: [PATCH 16/21] Refactor functions to use qtumsuite, add some stuff from btc's version --- chain/qtum/address.go | 86 ++++++++++++++-- chain/qtum/qtum.go | 7 +- chain/qtum/qtum_test.go | 81 ++++++++------- chain/qtum/utxo.go | 222 ++++++++++++++++++++++++++++++++++++++-- 4 files changed, 337 insertions(+), 59 deletions(-) diff --git a/chain/qtum/address.go b/chain/qtum/address.go index abac9215..43f61744 100644 --- a/chain/qtum/address.go +++ b/chain/qtum/address.go @@ -1,14 +1,82 @@ package qtum -import "github.com/renproject/multichain/chain/bitcoin" +// This is a copy of Bitcoin's version with btcsuite swapped to qtumsuite -type ( - // AddressEncoder re-exports bitcoin.AddressEncoder. - AddressEncoder = bitcoin.AddressEncoder +import ( + "fmt" - // AddressDecoder re-exports bitcoin.AddressDecoder. - AddressDecoder = bitcoin.AddressDecoder - - // AddressEncodeDecoder re-exports bitcoin.AddressEncodeDecoder. - AddressEncodeDecoder = bitcoin.AddressEncodeDecoder + "github.com/qtumproject/qtumsuite/chaincfg" + "github.com/qtumproject/qtumsuite" + "github.com/qtumproject/qtumsuite/base58" + "github.com/renproject/multichain/api/address" ) + +// AddressEncodeDecoder implements the address.EncodeDecoder interface +type AddressEncodeDecoder struct { + AddressEncoder + AddressDecoder +} + +// NewAddressEncodeDecoder constructs a new AddressEncodeDecoder with the +// chain specific configurations +func NewAddressEncodeDecoder(params *chaincfg.Params) AddressEncodeDecoder { + return AddressEncodeDecoder{ + AddressEncoder: NewAddressEncoder(params), + AddressDecoder: NewAddressDecoder(params), + } +} + +// AddressEncoder encapsulates the chain specific configurations and implements +// the address.Encoder interface +type AddressEncoder struct { + params *chaincfg.Params +} + +// NewAddressEncoder constructs a new AddressEncoder with the chain specific +// configurations +func NewAddressEncoder(params *chaincfg.Params) AddressEncoder { + return AddressEncoder{params: params} +} + +// EncodeAddress implements the address.Encoder interface +func (encoder AddressEncoder) EncodeAddress(rawAddr address.RawAddress) (address.Address, error) { + // Validate that the base58 address is in fact in correct format. + encodedAddr := base58.Encode([]byte(rawAddr)) + if _, err := qtumsuite.DecodeAddress(encodedAddr, encoder.params); err != nil { + return address.Address(""), err + } + + return address.Address(encodedAddr), nil +} + +// AddressDecoder encapsulates the chain specific configurations and implements +// the address.Decoder interface +type AddressDecoder struct { + params *chaincfg.Params +} + +// NewAddressDecoder constructs a new AddressDecoder with the chain specific +// configurations +func NewAddressDecoder(params *chaincfg.Params) AddressDecoder { + return AddressDecoder{params: params} +} + +// DecodeAddress implements the address.Decoder interface +func (decoder AddressDecoder) DecodeAddress(addr address.Address) (address.RawAddress, error) { + // Decode the checksummed base58 format address. + decoded, ver, err := base58.CheckDecode(string(addr)) + if err != nil { + return nil, fmt.Errorf("checking: %v", err) + } + if len(decoded) != 20 { + return nil, fmt.Errorf("expected len 20, got len %v", len(decoded)) + } + + // Validate the address format. + switch ver { + case decoder.params.PubKeyHashAddrID, decoder.params.ScriptHashAddrID: + return address.RawAddress(base58.Decode(string(addr))), nil + default: + return nil, fmt.Errorf("unexpected address prefix") + } +} diff --git a/chain/qtum/qtum.go b/chain/qtum/qtum.go index 5402013c..80fc8b5b 100644 --- a/chain/qtum/qtum.go +++ b/chain/qtum/qtum.go @@ -1,5 +1,8 @@ package qtum +// This is a copy of Bitcoin's implementation with btcsuite swapped for qtumquite, +// along with some minimal additional changes + import ( "bytes" "context" @@ -14,7 +17,7 @@ import ( "strconv" // DEZU: TODO: Remove debug - "github.com/btcsuite/btcd/btcjson" // DEZU: Not in qtumsuite, unsure how to handle it + "github.com/btcsuite/btcd/btcjson" "github.com/qtumproject/qtumsuite/chaincfg/chainhash" "github.com/qtumproject/qtumsuite" "github.com/renproject/multichain/api/address" @@ -29,7 +32,7 @@ const ( DefaultClientTimeoutRetry = time.Second // DefaultClientHost used by the Client. This should only be used for local // deployments of the multichain. - DefaultClientHost = "http://0.0.0.0:13889" // DEZU: TODO: Change??? + DefaultClientHost = "http://0.0.0.0:13889" // This should be testnet address, but works for regtest apparently // DefaultClientUser used by the Client. This is insecure, and should only // be used for local — or publicly accessible — deployments of the // multichain. diff --git a/chain/qtum/qtum_test.go b/chain/qtum/qtum_test.go index eb66f338..863ce0dd 100644 --- a/chain/qtum/qtum_test.go +++ b/chain/qtum/qtum_test.go @@ -1,6 +1,7 @@ package qtum_test -// DEZU: This is a straight rip of dogecoin's implementation +// This is a copy of Bitcoin's implementation with btcsuite swapped for qtumsuite, +// along with some minimal additional changes import ( "context" @@ -9,63 +10,47 @@ import ( "reflect" "time" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcd/chaincfg" + "github.com/qtumproject/qtumsuite/chaincfg" + "github.com/qtumproject/qtumsuite" "github.com/renproject/id" "github.com/renproject/multichain/api/address" "github.com/renproject/multichain/api/utxo" "github.com/renproject/multichain/chain/qtum" "github.com/renproject/pack" - //"github.com/qtumproject/qtumsuite/chaincfg" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) - // DEZU: values take from from qtumsuit -var RegressionNetParams = chaincfg.Params{ - Name: "regtest", - DefaultPort: "23888", - - Net: 0xe1c6ddfd, - - // Address encoding magics - PubKeyHashAddrID: 120, // starts with m or n - ScriptHashAddrID: 110, // starts with 2 - PrivateKeyID: 239, // starts with 9 (uncompressed) or c (compressed) - - // BIP32 hierarchical deterministic extended key magics - HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv - HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub - - // Human-readable part for Bech32 encoded segwit addresses, as defined in BIP 173. - Bech32HRPSegwit: "qcrt", -} - var _ = Describe("Qtum", func() { Context("when submitting transactions", func() { Context("when sending QTUM to multiple addresses", func() { It("should work", func() { // Load private key, and assume that the associated address has - // funds to spend. You can do this by setting QTUM_PK to the + // funds to spend. You can do this by setting BITCOIN_PK to the // value specified in the `./multichaindeploy/.env` file. pkEnv := os.Getenv("QTUM_PK") if pkEnv == "" { panic("QTUM_PK is undefined") } - wif, err := btcutil.DecodeWIF(pkEnv) + wif, err := qtumsuite.DecodeWIF(pkEnv) Expect(err).ToNot(HaveOccurred()) // PKH - pkhAddr, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.PrivKey.PubKey().SerializeCompressed()), &RegressionNetParams) + pkhAddr, err := qtumsuite.NewAddressPubKeyHash(qtumsuite.Hash160(wif.PrivKey.PubKey().SerializeCompressed()), &chaincfg.RegressionNetParams) Expect(err).ToNot(HaveOccurred()) - pkhAddrUncompressed, err := btcutil.NewAddressPubKeyHash(btcutil.Hash160(wif.PrivKey.PubKey().SerializeUncompressed()), &RegressionNetParams) + pkhAddrUncompressed, err := qtumsuite.NewAddressPubKeyHash(qtumsuite.Hash160(wif.PrivKey.PubKey().SerializeUncompressed()), &chaincfg.RegressionNetParams) Expect(err).ToNot(HaveOccurred()) log.Printf("PKH %v", pkhAddr.EncodeAddress()) log.Printf("PKH (uncompressed) %v", pkhAddrUncompressed.EncodeAddress()) + // WPKH + wpkAddr, err := qtumsuite.NewAddressWitnessPubKeyHash([]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19}, &chaincfg.RegressionNetParams) + Expect(err).ToNot(HaveOccurred()) + log.Printf("WPKH %v", wpkAddr.EncodeAddress()) + // Setup the client and load the unspent transaction outputs. - client := qtum.NewClient(qtum.DefaultClientOptions().WithHost("http://127.0.0.1:13889")) // DEZU: TODO: This is QTUM's testnet address, is that the one? + client := qtum.NewClient(qtum.DefaultClientOptions().WithHost("http://127.0.0.1:13889")) // This is actually supposed to be Qtum's testnet port, but it seems to work outputs, err := client.UnspentOutputs(context.Background(), 0, 999999999, address.Address(pkhAddr.EncodeAddress())) Expect(err).ToNot(HaveOccurred()) Expect(len(outputs)).To(BeNumerically(">", 0)) @@ -77,23 +62,39 @@ var _ = Describe("Qtum", func() { output2, _, err := client.Output(context.Background(), output.Outpoint) Expect(err).ToNot(HaveOccurred()) Expect(reflect.DeepEqual(output, output2)).To(BeTrue()) + output2, _, err = client.UnspentOutput(context.Background(), output.Outpoint) + Expect(err).ToNot(HaveOccurred()) + Expect(reflect.DeepEqual(output, output2)).To(BeTrue()) // Build the transaction by consuming the outputs and spending // them to a set of recipients. inputs := []utxo.Input{ - {Output: output}, + {Output: utxo.Output{ + Outpoint: utxo.Outpoint{ + Hash: output.Outpoint.Hash[:], + Index: output.Outpoint.Index, + }, + PubKeyScript: output.PubKeyScript, + Value: output.Value, + }}, } + // The constant (relay fee) subtracted below should really be derived by + // an estimatesmartfee call to the node, but if BTC is lazy we can be too recipients := []utxo.Recipient{ { To: address.Address(pkhAddr.EncodeAddress()), - Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: the constant fee here will cause test error if too low, demand of > 90000 seems common - }, // TODO: Examinate why this value needs to be so high for Qtum (was 1000 for BTC) + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 150000) / 3)), + }, { To: address.Address(pkhAddrUncompressed.EncodeAddress()), - Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 100000) / 2)), // DEZU: Ditto above + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 150000) / 3)), + }, + { + To: address.Address(wpkAddr.EncodeAddress()), + Value: pack.NewU256FromU64(pack.NewU64((output.Value.Int().Uint64() - 150000) / 3)), }, } - tx, err := qtum.NewTxBuilder(&RegressionNetParams).BuildTx(inputs, recipients) + tx, err := qtum.NewTxBuilder(&chaincfg.RegressionNetParams).BuildTx(inputs, recipients) Expect(err).ToNot(HaveOccurred()) // Get the digests that need signing from the transaction, and @@ -112,7 +113,7 @@ var _ = Describe("Qtum", func() { } Expect(tx.Sign(signatures, pack.NewBytes(wif.SerializePubKey()))).To(Succeed()) - // Submit the transaction to the Qtum node. Again, this + // Submit the transaction to the Bitcoin node. Again, this // should be running a la `./multichaindeploy`. txHash, err := tx.Hash() Expect(err).ToNot(HaveOccurred()) @@ -125,15 +126,19 @@ var _ = Describe("Qtum", func() { // confirmations. This implies that the transaction is // definitely valid, and the test has passed. We were // successfully able to use the multichain to construct and - // submit a Qtum transaction! + // submit a Bitcoin transaction! confs, err := client.Confirmations(context.Background(), txHash) Expect(err).ToNot(HaveOccurred()) - log.Printf(" %v/3 confirmations", confs) - if confs >= 3 { + log.Printf(" %v/1 confirmations", confs) + if confs >= 1 { // Only wait for 1 conf to cut 20 sec of test time break } time.Sleep(10 * time.Second) } + ctxWithTimeout, cancelCtxWithTimeout := context.WithTimeout(context.Background(), time.Second) + defer cancelCtxWithTimeout() + _, _, err = client.UnspentOutput(ctxWithTimeout, output.Outpoint) + Expect(err).To(HaveOccurred()) // Check that we can load the output and that it is equal. // Otherwise, something strange is happening with the RPC diff --git a/chain/qtum/utxo.go b/chain/qtum/utxo.go index 1bd535f3..dc0a3fcc 100644 --- a/chain/qtum/utxo.go +++ b/chain/qtum/utxo.go @@ -1,16 +1,218 @@ package qtum -import "github.com/renproject/multichain/chain/bitcoin" +// This is a copy of Bitcoin's version with btcsuite swapped to qtumsuite -type ( - // Tx re-exports bitcoin.Tx. - Tx = bitcoin.Tx +import ( + "bytes" + "fmt" + "math/big" - // TxBuilder re-exports bitcoin.TxBuilder. - TxBuilder = bitcoin.TxBuilder + "github.com/btcsuite/btcd/btcec" + "github.com/qtumproject/qtumsuite/chaincfg" + "github.com/qtumproject/qtumsuite/chaincfg/chainhash" + "github.com/qtumproject/qtumsuite/txscript" + "github.com/qtumproject/qtumsuite/wire" + "github.com/qtumproject/qtumsuite" + "github.com/renproject/multichain/api/utxo" + "github.com/renproject/pack" ) -var ( - // NewTxBuilder re-exports bitcoin.NewTxBuilder. - NewTxBuilder = bitcoin.NewTxBuilder -) +// Version of Bitcoin transactions supported by the multichain. +const Version int32 = 2 + +// The TxBuilder is an implementation of a UTXO-compatible transaction builder +// for Bitcoin. +type TxBuilder struct { + params *chaincfg.Params +} + +// NewTxBuilder returns a transaction builder that builds UTXO-compatible +// Bitcoin transactions for the given chain configuration (this means that it +// can be used for regnet, testnet, and mainnet, but also for networks that are +// minimally modified forks of the Bitcoin network). +func NewTxBuilder(params *chaincfg.Params) TxBuilder { + return TxBuilder{params: params} +} + +// BuildTx returns a Bitcoin transaction that consumes funds from the given +// inputs, and sends them to the given recipients. The difference in the sum +// value of the inputs and the sum value of the recipients is paid as a fee to +// the Bitcoin network. This fee must be calculated independently of this +// function. Outputs produced for recipients will use P2PKH, P2SH, P2WPKH, or +// P2WSH scripts as the pubkey script, based on the format of the recipient +// address. +func (txBuilder TxBuilder) BuildTx(inputs []utxo.Input, recipients []utxo.Recipient) (utxo.Tx, error) { + msgTx := wire.NewMsgTx(Version) + + // Inputs + for _, input := range inputs { + hash := chainhash.Hash{} + copy(hash[:], input.Hash) + index := input.Index.Uint32() + msgTx.AddTxIn(wire.NewTxIn(wire.NewOutPoint(&hash, index), nil, nil)) + } + + // Outputs + for _, recipient := range recipients { + addr, err := qtumsuite.DecodeAddress(string(recipient.To), txBuilder.params) + if err != nil { + return nil, err + } + script, err := txscript.PayToAddrScript(addr) + if err != nil { + return nil, err + } + value := recipient.Value.Int().Int64() + if value < 0 { + return nil, fmt.Errorf("expected value >= 0, got value %v", value) + } + msgTx.AddTxOut(wire.NewTxOut(value, script)) + } + + return &Tx{inputs: inputs, recipients: recipients, msgTx: msgTx, signed: false}, nil +} + +// Tx represents a simple Bitcoin transaction that implements the Bitcoin Compat +// API. +type Tx struct { + inputs []utxo.Input + recipients []utxo.Recipient + + msgTx *wire.MsgTx + + signed bool +} + +// Hash returns the transaction hash of the given underlying transaction. +func (tx *Tx) Hash() (pack.Bytes, error) { + txhash := tx.msgTx.TxHash() + return pack.NewBytes(txhash[:]), nil +} + +// Inputs returns the UTXO inputs in the underlying transaction. +func (tx *Tx) Inputs() ([]utxo.Input, error) { + return tx.inputs, nil +} + +// Outputs returns the UTXO outputs in the underlying transaction. +func (tx *Tx) Outputs() ([]utxo.Output, error) { + hash, err := tx.Hash() + if err != nil { + return nil, fmt.Errorf("bad hash: %v", err) + } + outputs := make([]utxo.Output, len(tx.msgTx.TxOut)) + for i := range outputs { + outputs[i].Outpoint = utxo.Outpoint{ + Hash: hash, + Index: pack.NewU32(uint32(i)), + } + outputs[i].PubKeyScript = pack.Bytes(tx.msgTx.TxOut[i].PkScript) + if tx.msgTx.TxOut[i].Value < 0 { + return nil, fmt.Errorf("bad output %v: value is less than zero", i) + } + outputs[i].Value = pack.NewU256FromU64(pack.NewU64(uint64(tx.msgTx.TxOut[i].Value))) + } + return outputs, nil +} + +// Sighashes returns the digests that must be signed before the transaction +// can be submitted by the client. +func (tx *Tx) Sighashes() ([]pack.Bytes32, error) { + sighashes := make([]pack.Bytes32, len(tx.inputs)) + + for i, txin := range tx.inputs { + pubKeyScript := txin.PubKeyScript + sigScript := txin.SigScript + value := txin.Value.Int().Int64() + if value < 0 { + return []pack.Bytes32{}, fmt.Errorf("expected value >= 0, got value %v", value) + } + + var hash []byte + var err error + if sigScript == nil { + if txscript.IsPayToWitnessPubKeyHash(pubKeyScript) { + hash, err = txscript.CalcWitnessSigHash(pubKeyScript, txscript.NewTxSigHashes(tx.msgTx), txscript.SigHashAll, tx.msgTx, i, value) + } else { + hash, err = txscript.CalcSignatureHash(pubKeyScript, txscript.SigHashAll, tx.msgTx, i) + } + } else { + if txscript.IsPayToWitnessScriptHash(pubKeyScript) { + hash, err = txscript.CalcWitnessSigHash(sigScript, txscript.NewTxSigHashes(tx.msgTx), txscript.SigHashAll, tx.msgTx, i, value) + } else { + hash, err = txscript.CalcSignatureHash(sigScript, txscript.SigHashAll, tx.msgTx, i) + } + } + if err != nil { + return []pack.Bytes32{}, err + } + + sighash := [32]byte{} + copy(sighash[:], hash) + sighashes[i] = pack.NewBytes32(sighash) + } + + return sighashes, nil +} + +// Sign consumes a list of signatures, and adds them to the list of UTXOs in +// the underlying transactions. +func (tx *Tx) Sign(signatures []pack.Bytes65, pubKey pack.Bytes) error { + if tx.signed { + return fmt.Errorf("already signed") + } + if len(signatures) != len(tx.msgTx.TxIn) { + return fmt.Errorf("expected %v signatures, got %v signatures", len(tx.msgTx.TxIn), len(signatures)) + } + + for i, rsv := range signatures { + var err error + + // Decode the signature and the pubkey script. + r := new(big.Int).SetBytes(rsv[:32]) + s := new(big.Int).SetBytes(rsv[32:64]) + signature := btcec.Signature{ + R: r, + S: s, + } + pubKeyScript := tx.inputs[i].Output.PubKeyScript + sigScript := tx.inputs[i].SigScript + + // Support segwit. + if sigScript == nil { + if txscript.IsPayToWitnessPubKeyHash(pubKeyScript) || txscript.IsPayToWitnessScriptHash(pubKeyScript) { + tx.msgTx.TxIn[i].Witness = wire.TxWitness([][]byte{append(signature.Serialize(), byte(txscript.SigHashAll)), pubKey}) + continue + } + } else { + if txscript.IsPayToWitnessScriptHash(sigScript) || txscript.IsPayToWitnessScriptHash(sigScript) { + tx.msgTx.TxIn[i].Witness = wire.TxWitness([][]byte{append(signature.Serialize(), byte(txscript.SigHashAll)), pubKey, sigScript}) + continue + } + } + + // Support non-segwit + builder := txscript.NewScriptBuilder() + builder.AddData(append(signature.Serialize(), byte(txscript.SigHashAll))) + builder.AddData(pubKey) + if sigScript != nil { + builder.AddData(sigScript) + } + tx.msgTx.TxIn[i].SignatureScript, err = builder.Script() + if err != nil { + return err + } + } + + tx.signed = true + return nil +} + +// Serialize serializes the UTXO transaction to bytes +func (tx *Tx) Serialize() (pack.Bytes, error) { + buf := new(bytes.Buffer) + if err := tx.msgTx.Serialize(buf); err != nil { + return pack.Bytes{}, err + } + return pack.NewBytes(buf.Bytes()), nil +} From ded126c3287f8b3e6f0042b01a91afd7b742f48a Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 04:23:15 +0100 Subject: [PATCH 17/21] Remove some debug prints --- chain/qtum/qtum.go | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/chain/qtum/qtum.go b/chain/qtum/qtum.go index 80fc8b5b..8cf22ab9 100644 --- a/chain/qtum/qtum.go +++ b/chain/qtum/qtum.go @@ -15,8 +15,6 @@ import ( "net/http" "time" - "strconv" // DEZU: TODO: Remove debug - "github.com/btcsuite/btcd/btcjson" "github.com/qtumproject/qtumsuite/chaincfg/chainhash" "github.com/qtumproject/qtumsuite" @@ -194,7 +192,6 @@ func (client *client) SubmitTx(ctx context.Context, tx utxo.Tx) error { // UnspentOutputs spendable by the given address. func (client *client) UnspentOutputs(ctx context.Context, minConf, maxConf int64, addr address.Address) ([]utxo.Output, error) { - fmt.Println("(fun UnspentOutputs) Creating request: 'listunspent " + strconv.FormatInt(minConf, 10) + " " + strconv.FormatInt(maxConf, 10) + " " + string(addr) + "'") // DEZU: TODO: Remove debug resp := []btcjson.ListUnspentResult{} if err := client.send(ctx, &resp, "listunspent", minConf, maxConf, []string{string(addr)}); err != nil && err != io.EOF { @@ -255,7 +252,6 @@ func (client *client) Confirmations(ctx context.Context, txHash pack.Bytes) (int // blocks. An error will be returned if the bitcoin node hasn't observed enough // blocks to make an estimate for the provided target `numBlocks`. func (client *client) EstimateSmartFee(ctx context.Context, numBlocks int64) (float64, error) { - fmt.Println("(fun EstimateSmartFee) Creating request: 'estimatesmartfee " + strconv.FormatInt(numBlocks, 10) + " '") // DEZU: TODO: Remove debug resp := btcjson.EstimateSmartFeeResult{} @@ -301,25 +297,24 @@ func (client *client) send(ctx context.Context, resp interface{}, method string, // the context is done. req, err := http.NewRequest("POST", client.opts.Host, bytes.NewBuffer(data)) if err != nil { - return fmt.Errorf("(fun send) building http request: %v", err) + return fmt.Errorf("building http request: %v", err) } req.SetBasicAuth(client.opts.User, client.opts.Password) // Send the request and decode the response. res, err := client.httpClient.Do(req) if err != nil { - return fmt.Errorf("(fun send) sending http request: %v", err) + return fmt.Errorf("sending http request: %v", err) } defer res.Body.Close() if err := decodeResponse(resp, res.Body); err != nil { - return fmt.Errorf("(fun send) decoding http response: %v", err) + return fmt.Errorf("decoding http response: %v", err) } return nil }) } func encodeRequest(method string, params []interface{}) ([]byte, error) { - fmt.Println("(fun encodeRequest) encoding request '" + method + "'") // DEZU: TODO: Remove debug rawParams, err := json.Marshal(params) if err != nil { return nil, fmt.Errorf("encoding params: %v", err) @@ -337,7 +332,7 @@ func encodeRequest(method string, params []interface{}) ([]byte, error) { } rawReq, err := json.Marshal(req) if err != nil { - return nil, fmt.Errorf("fun encodeRequest) encoding request: %v", err) + return nil, fmt.Errorf("encoding request: %v", err) } return rawReq, nil } @@ -351,16 +346,16 @@ func decodeResponse(resp interface{}, r io.Reader) error { }{} if err := json.NewDecoder(r).Decode(&res); err != nil { - return fmt.Errorf("(OPT1)decoding response: %v", err) // DEZU: TODO: Remove debug + return fmt.Errorf("decoding response: %v", err) } if res.Error != nil { - return fmt.Errorf("(OPT2)decoding response: %v", string(*res.Error)) // DEZU: TODO: Remove debug + return fmt.Errorf("decoding response: %v", string(*res.Error)) } if res.Result == nil { - return fmt.Errorf("(OPT3)decoding result: result is nil") // DEZU: TODO: Remove debug + return fmt.Errorf("decoding result: result is nil") } if err := json.Unmarshal(*res.Result, resp); err != nil { - return fmt.Errorf("(OPT4)decoding result: %v", err) // DEZU: TODO: Remove debug + return fmt.Errorf("decoding result: %v", err) } return nil } From 05d1610ab085f2c9019c5171980a2c34c383ee25 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 05:05:43 +0100 Subject: [PATCH 18/21] Restore test files to mint condition --- qtumtest.sh | 15 --------------- test.sh | 14 ++------------ 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100755 qtumtest.sh diff --git a/qtumtest.sh b/qtumtest.sh deleted file mode 100755 index 4b17965a..00000000 --- a/qtumtest.sh +++ /dev/null @@ -1,15 +0,0 @@ -#source ./infra/.env -. ./infra/.env # DEZU: This is only because Ubuntu is a special boi -GO=/usr/local/go/bin/go #DEZU: Added because the script hate on poor GO -COMPOSE_PARALLEL_LIMIT=10 #DEZU: Added because of error, apparently some library has a thread limit of 10? -#docker-compose -f ./infra/docker-compose.yaml up --build -d -#echo "Waiting for multichain to boot..." -#sleep 30 -echo "Done waiting, running tests on Qtum..." # DEZU: Added for debugging -#sh -e tcpdump -i docker0 -w ./packets.cap # DEZU: Aded for docker network package sniffing -$GO test -v ./chain/qtum/... -echo "Done with Qtum, running all tests..." # DEZU: Added for debugging -#$GO test -v ./... -echo "Done testing, closing..." # DEZU: Added for debugging -#docker-compose -f ./infra/docker-compose.yaml down -echo "Done!" diff --git a/test.sh b/test.sh index 5e6287c4..3e7747f7 100755 --- a/test.sh +++ b/test.sh @@ -1,17 +1,7 @@ -#source ./infra/.env -. ./infra/.env # DEZU: This is only because Ubuntu is a special boi -GO=/usr/local/go/bin/go #DEZU: Added because the script hate on poor GO -COMPOSE_PARALLEL_LIMIT=8 #DEZU: Added because of error, apparently some library has a thread limit? +source ./infra/.env docker-compose -f ./infra/docker-compose.yaml up --build -d echo "Waiting for multichain to boot..." -docker logs --details infra_qtum_1 >> qtumdockerlog.txt sleep 30 -docker logs --details infra_qtum_1 >> qtumdockerlog.txt -echo "Done waiting, running tests on Qtum..." # DEZU: Added for debugging -$GO test -v ./chain/qtum/... -docker logs --details infra_qtum_1 >> qtumdockerlog.txt -echo "Done with Qtum, running all tests..." # DEZU: Added for debugging -$GO test -v ./... -echo "Done testing, closing..." # DEZU: Added for debugging +go test -v ./... docker-compose -f ./infra/docker-compose.yaml down echo "Done!" From 3b3060926ce1b0118318adb4ca137dd9df352ce6 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Sat, 21 Nov 2020 03:14:10 +0100 Subject: [PATCH 19/21] Revert "Make initial hacks to get Dockers to run" This reverts commit eec814f541daf6b135fd2d42c63119661658f4e1. --- infra/acala/Dockerfile | 7 +++---- infra/docker-compose.yaml | 20 +++++++++----------- multichain.go | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/infra/acala/Dockerfile b/infra/acala/Dockerfile index 3c156dac..a988fb74 100644 --- a/infra/acala/Dockerfile +++ b/infra/acala/Dockerfile @@ -15,10 +15,9 @@ WORKDIR /app # TEMPORARY: use the branch that has a good reference to the submodules # TODO: remove when the `master` branch of Acala is updated -# DEZU: commented out because it fails -#RUN git fetch -#RUN git checkout update-orml -#RUN git pull +RUN git fetch +RUN git checkout update-orml +RUN git pull # Make sure submodule.recurse is set to true to make life with submodule easier. RUN git config --global submodule.recurse true diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 853adb13..47e937bf 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -1,19 +1,17 @@ version: "2" services: - - # DEZU; Commented out because break build etc etc, notice colons too # # Acala # - # acala - # build - # context ./acala - # ports - # - "0.0.0.0:9933:9933" - # - "0.0.0.0:9944:9944" - # entrypoint - # - "./root/run.sh" - # - "${ACALA_ADDRESS}" + acala: + build: + context: ./acala + ports: + - "0.0.0.0:9933:9933" + - "0.0.0.0:9944:9944" + entrypoint: + - "./root/run.sh" + - "${ACALA_ADDRESS}" # # Binance Smart Chain diff --git a/multichain.go b/multichain.go index ea023439..9026e605 100644 --- a/multichain.go +++ b/multichain.go @@ -211,7 +211,7 @@ type Chain string // human-readable string to this set of enumerated values. Chains must be listed // in alphabetical order. const ( - //Acala = Chain("Acala") // DEZU: Commented out because it breaks the docker build process, #progamermove (#pro-grammermove?) + Acala = Chain("Acala") BinanceSmartChain = Chain("BinanceSmartChain") Bitcoin = Chain("Bitcoin") BitcoinCash = Chain("BitcoinCash") From 3dd24b2c3a35a5c41f7b0595a275cebf428a3ad4 Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 05:15:57 +0100 Subject: [PATCH 20/21] Restore some generated files --- go.mod | 7 +++--- go.sum | 78 ---------------------------------------------------------- 2 files changed, 3 insertions(+), 82 deletions(-) diff --git a/go.mod b/go.mod index 1bbcfc83..0b489eae 100644 --- a/go.mod +++ b/go.mod @@ -8,22 +8,21 @@ require ( github.com/codahale/blake2 v0.0.0-20150924215134-8d10d0420cbf github.com/cosmos/cosmos-sdk v0.39.1 github.com/ethereum/go-ethereum v1.9.20 - github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb + github.com/filecoin-project/go-address v0.0.4 github.com/filecoin-project/go-jsonrpc v0.1.2-0.20201008195726-68c6a2704e49 - github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc + github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f github.com/filecoin-project/lotus v1.1.2 github.com/ipfs/go-cid v0.0.7 github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 github.com/multiformats/go-varint v0.0.6 github.com/onsi/ginkgo v1.14.0 github.com/onsi/gomega v1.10.1 - github.com/qtumproject/qtumsuite v0.0.0-20191105052314-80f1a6a75e13 github.com/renproject/id v0.4.2 github.com/renproject/pack v0.2.5 github.com/renproject/surge v1.2.6 github.com/tendermint/tendermint v0.33.8 github.com/terra-project/core v0.4.0-rc.4 - go.uber.org/zap v1.16.0 + go.uber.org/zap v1.15.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a ) diff --git a/go.sum b/go.sum index 6075dfc1..83c8ff33 100644 --- a/go.sum +++ b/go.sum @@ -273,33 +273,24 @@ github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6 github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-address v0.0.4 h1:gSNMv0qWwH16fGQs7ycOUrDjY6YCSsgLUl0I0KLjo8w= github.com/filecoin-project/go-address v0.0.4/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= -github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb h1:Cbu7YYsXHtVlPEJ+eqbBx2S3ElmWCB0NjpGPYvvvCrA= -github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 h1:pIuR0dnMD0i+as8wNnjjHyQrnhP5O5bmba/lmgQeRgU= github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349/go.mod h1:vgmwKBkx+ca5OIeEvstiQgzAZnb7R6QaqE1oEDSqa6g= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.1 h1:S6Uuqcspqu81sWJ0He4OAfFLm1tSwPdVjtKTkl5m/xQ= github.com/filecoin-project/go-bitfield v0.2.1/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= -github.com/filecoin-project/go-bitfield v0.2.3-0.20201110211213-fe2c1862e816 h1:RMdzMqe3mu2Z/3N3b9UEfkbGZxukstmZgNC024ybWhA= -github.com/filecoin-project/go-bitfield v0.2.3-0.20201110211213-fe2c1862e816/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-data-transfer v0.9.0 h1:nTT8j7Hu3TM0wRWrGy83/ctawG7sleJGdFWtIsUsKgY= github.com/filecoin-project/go-data-transfer v0.9.0/go.mod h1:i2CqUy7TMQGKukj9BgqIxiP8nDHDXU2VLd771KVaCaQ= -github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo= -github.com/filecoin-project/go-data-transfer v1.2.0 h1:LM+K+J+y9t8e3gYskJHWDlyHJsF6aaxoHOP+HIiVE1U= -github.com/filecoin-project/go-data-transfer v1.2.0/go.mod h1:ZAH51JZFR8NZC4FPiDPG+swjgui0q6zTMJbztc6pHhY= github.com/filecoin-project/go-ds-versioning v0.1.0 h1:y/X6UksYTsK8TLCI7rttCKEvl8btmWxyFMEeeWGUxIQ= github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f h1:GxJzR3oRIMTPtpZ0b7QF8FKPK6/iPAc7trhlL5k/g+s= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-markets v1.0.0 h1:np9+tlnWXh9xYG4oZfha6HZFLYOaAZoMGR3V4w6DM48= github.com/filecoin-project/go-fil-markets v1.0.0/go.mod h1:lXExJyYHwpMMddCqhEdNrc7euYJKNkp04K76NZqJLGg= -github.com/filecoin-project/go-fil-markets v1.0.5 h1:g1EEdSJfi7nbVS2MhhUTRwNU+FHMOgvytTmKQqu6p0M= -github.com/filecoin-project/go-fil-markets v1.0.5/go.mod h1:lt96/KQb5r+YxV31kVGHUVIbQa7zLbxSP6ZBX+ruzDA= github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM= github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM= @@ -317,8 +308,6 @@ github.com/filecoin-project/go-state-types v0.0.0-20200904021452-1883f36ca2f4/go github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f h1:TZDTu4MtBKSFLXWGKLy+cvC3nHfMFIrVgWLAz/+GgZQ= github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= -github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc h1:+hbMY4Pcx2oizrfH08VWXwrj5mU8aJT6g0UNxGHFCGU= -github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe h1:dF8u+LEWeIcTcfUcCf3WFVlc81Fr2JKg8zPzIbBDKDw= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statestore v0.1.0 h1:t56reH59843TwXHkMcwyuayStBIiWBRilQjQ+5IiwdQ= @@ -330,17 +319,11 @@ github.com/filecoin-project/lotus v1.1.2/go.mod h1:jSlQv+/+WGox3TdEzBEfmXzvbot4O github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4= github.com/filecoin-project/specs-actors v0.9.12 h1:iIvk58tuMtmloFNHhAOQHG+4Gci6Lui0n7DYQGi3cJk= github.com/filecoin-project/specs-actors v0.9.12/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= -github.com/filecoin-project/specs-actors v0.9.13 h1:rUEOQouefi9fuVY/2HOroROJlZbOzWYXXeIh41KF2M4= -github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors/v2 v2.0.1/go.mod h1:v2NZVYinNIKA9acEMBm5wWXxqv5+frFEbekBFemYghY= github.com/filecoin-project/specs-actors/v2 v2.2.0 h1:IyCICb0NHYeD0sdSqjVGwWydn/7r7xXuxdpvGAcRCGY= github.com/filecoin-project/specs-actors/v2 v2.2.0/go.mod h1:rlv5Mx9wUhV8Qsz+vUezZNm+zL4tK08O0HreKKPB2Wc= -github.com/filecoin-project/specs-actors/v2 v2.3.2 h1:2Vcf4CGa29kRh4JJ02m+FbvD/p3YNnLGsaHfw7Uj49g= -github.com/filecoin-project/specs-actors/v2 v2.3.2/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y= github.com/filecoin-project/specs-storage v0.1.1-0.20200907031224-ed2e5cd13796 h1:dJsTPWpG2pcTeojO2pyn0c6l+x/3MZYCBgo/9d11JEk= github.com/filecoin-project/specs-storage v0.1.1-0.20200907031224-ed2e5cd13796/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= -github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 h1:Ur/l2+6qN+lQiqjozWWc5p9UDaAMDZKTlDS98oRnlIw= -github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -457,8 +440,6 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -558,7 +539,6 @@ github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiL github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= github.com/ipfs/go-bitswap v0.2.20 h1:Zfi5jDUoqxDThORUznqdeL77DdGniAzlccNJ4vr+Itc= github.com/ipfs/go-bitswap v0.2.20/go.mod h1:C7TwBgHnu89Q8sHsTJP7IhUqF9XYLe71P4tT5adgmYo= -github.com/ipfs/go-bitswap v0.3.2/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= @@ -568,8 +548,6 @@ github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7s github.com/ipfs/go-blockservice v0.1.3/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= github.com/ipfs/go-blockservice v0.1.4-0.20200624145336-a978cec6e834 h1:hFJoI1D2a3MqiNkSb4nKwrdkhCngUxUTFNwVwovZX2s= github.com/ipfs/go-blockservice v0.1.4-0.20200624145336-a978cec6e834/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= -github.com/ipfs/go-blockservice v0.1.4 h1:Vq+MlsH8000KbbUciRyYMEw/NNP8UAGmcqKi4uWmFGA= -github.com/ipfs/go-blockservice v0.1.4/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -615,10 +593,6 @@ github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CE github.com/ipfs/go-graphsync v0.3.0/go.mod h1:gEBvJUNelzMkaRPJTpg/jaKN4AQW/7wDWu0K92D8o10= github.com/ipfs/go-graphsync v0.3.1 h1:dJLYrck4oyJDfMVhGEKiWHxaY8oYMWko4m2Fi+4bofo= github.com/ipfs/go-graphsync v0.3.1/go.mod h1:bw4LiLM5Oq/uLdzEtih9LK8GrwSijv+XqYiWCTxHMqs= -github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0= -github.com/ipfs/go-graphsync v0.4.3/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY= -github.com/ipfs/go-graphsync v0.5.0 h1:iaByvxq88Ys1KcaQzTS1wmRhNsNEo3SaUiSGqTSbGmM= -github.com/ipfs/go-graphsync v0.5.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= @@ -626,8 +600,6 @@ github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86 github.com/ipfs/go-ipfs-blockstore v1.0.0/go.mod h1:knLVdhVU9L7CC4T+T4nvGdeUIPAXlnd9zmXfp+9MIjU= github.com/ipfs/go-ipfs-blockstore v1.0.1 h1:fnuVj4XdZp4yExhd0CnUwAiMNJHiPnfInhiuwz4lW1w= github.com/ipfs/go-ipfs-blockstore v1.0.1/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= -github.com/ipfs/go-ipfs-blockstore v1.0.3 h1:RDhK6fdg5YsonkpMuMpdvk/pRtOQlrIRIybuQfkvB2M= -github.com/ipfs/go-ipfs-blockstore v1.0.3/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= @@ -671,8 +643,6 @@ github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9 github.com/ipfs/go-ipld-cbor v0.0.5-0.20200204214505-252690b78669/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf h1:PRCy+w3GocY77CBEwTprp6hn7PLiEU1YToKe7B+1FVk= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= -github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= -github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= @@ -721,16 +691,12 @@ github.com/ipfs/iptb v1.4.0/go.mod h1:1rzHpCYtNp87/+hTxG5TfCVn/yMY3dKnLn8tBiMfdm github.com/ipfs/iptb-plugins v0.2.1/go.mod h1:QXMbtIWZ+jRsW8a4h13qAKU7jcM7qaittO8wOsTP0Rs= github.com/ipld/go-car v0.1.1-0.20200923150018-8cdef32e2da4 h1:6phjU3kXvCEWOZpu+Ob0w6DzgPFZmDLgLPxJhD8RxEY= github.com/ipld/go-car v0.1.1-0.20200923150018-8cdef32e2da4/go.mod h1:xrMEcuSq+D1vEwl+YAXsg/JfA98XGpXDwnkIL4Aimqw= -github.com/ipld/go-car v0.1.1-0.20201119040415-11b6074b6d4d/go.mod h1:2Gys8L8MJ6zkh1gktTSXreY63t4UbyvNp5JaudTyxHQ= github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f h1:XpOuNQ5GbXxUcSukbQcW9jkE7REpaFGJU2/T00fo9kA= github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018 h1:RbRHv8epkmvBYA5cGfz68GUSbOgx5j/7ObLIl4Rsif0= -github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6 h1:6Mq+tZGSEMEoJJ1NbJRhddeelkXZcU8yfH/ZRYUo/Es= github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0= -github.com/ipld/go-ipld-prime-proto v0.1.0/go.mod h1:11zp8f3sHVgIqtb/c9Kr5ZGqpnCLF1IVTNOez9TopzE= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= github.com/jackpal/gateway v1.0.4/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= @@ -812,7 +778,6 @@ github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwn github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= -github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= @@ -843,8 +808,6 @@ github.com/libp2p/go-libp2p v0.9.2/go.mod h1:cunHNLDVus66Ct9iXXcjKRLdmHdFdHVe1TA github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8= github.com/libp2p/go-libp2p v0.11.0 h1:jb5mqdqYEBAybTEhD8io43Cz5LzVKuWxOK7znSN69jE= github.com/libp2p/go-libp2p v0.11.0/go.mod h1:3/ogJDXsbbepEfqtZKBR/DedzxJXCeK17t2Z9RE9bEE= -github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= -github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= github.com/libp2p/go-libp2p-autonat v0.0.2/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= @@ -855,7 +818,6 @@ github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/ github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= github.com/libp2p/go-libp2p-autonat v0.3.2 h1:OhDSwVVaq7liTaRIsFFYvsaPp0pn2yi0WazejZ4DUmo= github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= -github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-autonat-svc v0.1.0/go.mod h1:fqi8Obl/z3R4PFVLm8xFtZ6PBL9MlV/xumymRFkKq5A= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= @@ -875,7 +837,6 @@ github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCy github.com/libp2p/go-libp2p-circuit v0.2.3/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= github.com/libp2p/go-libp2p-circuit v0.3.1 h1:69ENDoGnNN45BNDnBd+8SXSetDuw0eJFcGmOvvtOgBw= github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= -github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-connmgr v0.1.1/go.mod h1:wZxh8veAmU5qdrfJ0ZBLcU8oJe9L82ciVP/fl1VHjXk= github.com/libp2p/go-libp2p-connmgr v0.2.3/go.mod h1:Gqjg29zI8CwXX21zRxy6gOg8VYu3zVerJRt2KyktzH4= github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= @@ -904,8 +865,6 @@ github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.7.0 h1:4a0TMjrWNTZlNvcqxZmrMRDi/NQWrhwO2pkTuLSQ/IQ= -github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= @@ -926,10 +885,8 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= github.com/libp2p/go-libp2p-kad-dht v0.2.1/go.mod h1:k7ONOlup7HKzQ68dE6lSnp07cdxdkmnRa+6B4Fh9/w0= github.com/libp2p/go-libp2p-kad-dht v0.8.3/go.mod h1:HnYYy8taJWESkqiESd1ngb9XX/XGGsMA5G0Vj2HoSh4= -github.com/libp2p/go-libp2p-kad-dht v0.11.0/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= github.com/libp2p/go-libp2p-kbucket v0.2.1/go.mod h1:/Rtu8tqbJ4WQ2KTCOMJhggMukOLNLNPY1EtEWWLxUvc= github.com/libp2p/go-libp2p-kbucket v0.4.2/go.mod h1:7sCeZx2GkNK1S6lQnGUW5JYZCFPnXzAZCCBBS70lytY= -github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= github.com/libp2p/go-libp2p-loggables v0.0.1/go.mod h1:lDipDlBNYbpyqyPX/KcoO+eq0sJYEVR2JgOexcivchg= github.com/libp2p/go-libp2p-loggables v0.1.0 h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8= github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= @@ -941,7 +898,6 @@ github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= github.com/libp2p/go-libp2p-mplex v0.2.4 h1:XFFXaN4jhqnIuJVjYOR3k6bnRj0mFfJOlIuDVww+4Zo= github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= -github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= @@ -978,12 +934,9 @@ github.com/libp2p/go-libp2p-pubsub v0.1.1/go.mod h1:ZwlKzRSe1eGvSIdU5bD7+8RZN/Uz github.com/libp2p/go-libp2p-pubsub v0.3.2-0.20200527132641-c0712c6e92cf/go.mod h1:TxPOBuo1FPdsTjFnv+FGZbNbWYsp74Culx+4ViQpato= github.com/libp2p/go-libp2p-pubsub v0.3.6 h1:9oO8W7qIWCYQYyz5z8nUsPcb3rrFehBlkbqvbSVjBxY= github.com/libp2p/go-libp2p-pubsub v0.3.6/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= -github.com/libp2p/go-libp2p-pubsub v0.4.0 h1:YNVRyXqBgv9i4RG88jzoTtkSOaSB45CqHkL29NNBZb4= -github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU= github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= github.com/libp2p/go-libp2p-quic-transport v0.8.2/go.mod h1:L+e0q15ZNaYm3seHgbsXjWP8kXLEqz+elLWKk9l8DhM= -github.com/libp2p/go-libp2p-quic-transport v0.9.0/go.mod h1:xyY+IgxL0qsW7Kiutab0+NlxM0/p9yRtrGTYsuMWf70= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -1009,8 +962,6 @@ github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA= github.com/libp2p/go-libp2p-swarm v0.2.8 h1:cIUUvytBzNQmGSjnXFlI6UpoBGsaud82mJPIJVfkDlg= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= -github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -1019,7 +970,6 @@ github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8 h1:v4dvk7YEW8buwCdIVWnhpv0Hp/AAJKRWIxBhmLRZrsk= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= -github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= @@ -1040,8 +990,6 @@ github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= github.com/libp2p/go-libp2p-yamux v0.2.8 h1:0s3ELSLu2O7hWKfX1YjzudBKCP0kZ+m9e2+0veXzkn4= github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= -github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= -github.com/libp2p/go-libp2p-yamux v0.4.1/go.mod h1:FA/NjRYRVNjqOzpGuGqcruH7jAU2mYIjtKBicVOL3dc= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= @@ -1053,7 +1001,6 @@ github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6 github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.1.2 h1:qOg1s+WdGLlpkrczDqmhYzyk3vCfsQ8+RxRTQjOZWwI= github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-msgio v0.0.1/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= @@ -1116,8 +1063,6 @@ github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZ github.com/libp2p/go-yamux v1.3.6/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI= github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= @@ -1259,8 +1204,6 @@ github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= github.com/multiformats/go-multistream v0.1.2 h1:knyamLYMPFPngQjGQ0lhnlys3jtVR/3xV6TREUJr+fE= github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= -github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= -github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -1395,8 +1338,6 @@ github.com/prometheus/procfs v0.1.0 h1:jhMy6QXfi3y2HEzFoyuCj40z4OZIIHHPtFyCMftmv github.com/prometheus/procfs v0.1.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/qtumproject/qtumsuite v0.0.0-20191105052314-80f1a6a75e13 h1:3fxP1D+f2TMX40UwBZ9RxEv6GsZj9zOcQFelbuX3BZI= -github.com/qtumproject/qtumsuite v0.0.0-20191105052314-80f1a6a75e13/go.mod h1:ZfvUvGS7v5iZTFQsBTCV1Z3yxEG7EO+IjB1NChEI4nE= github.com/rakyll/statik v0.1.6/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= github.com/raulk/clock v1.1.0 h1:dpb29+UKMbLqiU/jqIJptgLR1nn23HLgMY0sTCDza5Y= github.com/raulk/clock v1.1.0/go.mod h1:3MpVxdZ/ODBQDxbN+kzshf5OSZwPjtMDx6BBXBmOeY0= @@ -1626,7 +1567,6 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7V github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/c-for-go v0.0.0-20201002084316-c134bfab968f h1:nMhj+x/m7ZQsHBz0L3gpytp0v6ogokdbrQDnhB8Kh7s= github.com/xlab/c-for-go v0.0.0-20201002084316-c134bfab968f/go.mod h1:h/1PEBwj7Ym/8kOuMWvO2ujZ6Lt+TMbySEXNhjjR87I= -github.com/xlab/c-for-go v0.0.0-20201112171043-ea6dce5809cb/go.mod h1:pbNsDSxn1ICiNn9Ct4ZGNrwzfkkwYbx/lw8VuyutFIg= github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 h1:Sw125DKxZhPUI4JLlWugkzsrlB50jR9v2khiD9FxuSo= github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245/go.mod h1:C+diUUz7pxhNY6KAoLgrTYARGWnt82zWTylZlxT92vk= github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= @@ -1634,7 +1574,6 @@ github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 h1:oWgZJmC1DorFZD github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.12.1/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= @@ -1681,8 +1620,6 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= @@ -1722,7 +1659,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1800,8 +1736,6 @@ golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1819,7 +1753,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1887,15 +1820,11 @@ golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c h1:38q6VNPWR010vN82/SB121GujZNIfAUb4YttE2rhGuc= golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1940,7 +1869,6 @@ golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3 h1:r3P/5xOq/dK1991B65Oy6E1fRF/2d/fSYZJ/fXGVfJc= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2010,8 +1938,6 @@ google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2073,12 +1999,8 @@ howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCU launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= modernc.org/golex v1.0.0 h1:wWpDlbK8ejRfSyi0frMyhilD3JBvtcx2AdGDnU+JtsE= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/golex v1.0.1/go.mod h1:QCA53QtsT1NdGkaZZkF5ezFwk4IXh4BGNafAARTC254= -modernc.org/lex v1.0.0/go.mod h1:G6rxMTy3cH2iA0iXL/HRRv4Znu8MK4higxph/lE7ypk= -modernc.org/lexer v1.0.0/go.mod h1:F/Dld0YKYdZCLQ7bD0USbWL4YKCyTDRDHiDTOs0q0vk= modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc= From 657e3a70a78a5c28d952c77296c7bda26e031afe Mon Sep 17 00:00:00 2001 From: Johannes Borg Date: Wed, 25 Nov 2020 05:48:16 +0100 Subject: [PATCH 21/21] Add tweaked variants of btcsuite's chaincfg netparams just in case --- chain/qtum/qtum.go | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/chain/qtum/qtum.go b/chain/qtum/qtum.go index 8cf22ab9..7d5ec8f4 100644 --- a/chain/qtum/qtum.go +++ b/chain/qtum/qtum.go @@ -15,6 +15,7 @@ import ( "net/http" "time" + "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/btcjson" "github.com/qtumproject/qtumsuite/chaincfg/chainhash" "github.com/qtumproject/qtumsuite" @@ -41,6 +42,89 @@ const ( DefaultClientPassword = "password" ) +// Added the below because the other chains do, haven't tested them though. +// Don't really know which parameters are important, we'll see +// If you get type errors using these, try importing +// "github.com/qtumproject/qtumsuite/chaincfg" +// And use those parameters instead + +// MainNetParams returns the chain configuration for mainnet. +var MainNetParams = chaincfg.Params{ + Name: "mainnet", + Net: 0xd3a6cff1, + DefaultPort: "3888", + + // Human-readable part for Bech32 encoded segwit addresses, as defined in + // BIP 173. + Bech32HRPSegwit: "qc", // always bc for main net + + // Address encoding magics + PubKeyHashAddrID: 58, // starts with Q + ScriptHashAddrID: 50, // starts with M + PrivateKeyID: 128, // starts with 5 (uncompressed) or K (compressed) + WitnessPubKeyHashAddrID: 0x06, // starts with p2 + WitnessScriptHashAddrID: 0x0A, // starts with 7Xh + + // BIP32 hierarchical deterministic extended key magics + HDPrivateKeyID: [4]byte{0x04, 0x88, 0xad, 0xe4}, // starts with xprv + HDPublicKeyID: [4]byte{0x04, 0x88, 0xb2, 0x1e}, // starts with xpub + + // BIP44 coin type used in the hierarchical deterministic path for + // address generation. + HDCoinType: 2301, +} + +// TestNetParams returns the chain configuration for testnet. +var TestNetParams = chaincfg.Params{ + Name: "testnet3", + Net: 0x0615220d, + DefaultPort: "13888", + + + // Human-readable part for Bech32 encoded segwit addresses, as defined in + // BIP 173. + Bech32HRPSegwit: "tq", // always tb for test net + + // Address encoding magics + PubKeyHashAddrID: 120, // starts with m or n + ScriptHashAddrID: 110, // starts with 2 + WitnessPubKeyHashAddrID: 0x03, // starts with QW + WitnessScriptHashAddrID: 0x28, // starts with T7n + PrivateKeyID: 239, // starts with 9 (uncompressed) or c (compressed) + + // BIP32 hierarchical deterministic extended key magics + HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv + HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub + + // BIP44 coin type used in the hierarchical deterministic path for + // address generation. + HDCoinType: 1, +} + +// RegressionNetParams returns the chain configuration for regression net. +var RegressionNetParams = chaincfg.Params{ + Name: "regtest", + Net: 0xe1c6ddfd, + DefaultPort: "23888", + + // Human-readable part for Bech32 encoded segwit addresses, as defined in + // BIP 173. + Bech32HRPSegwit: "qcrt", // always bcrt for reg test net + + // Address encoding magics + PubKeyHashAddrID: 120, // starts with m or n + ScriptHashAddrID: 110, // starts with 2 + PrivateKeyID: 239, // starts with 9 (uncompressed) or c (compressed) + + // BIP32 hierarchical deterministic extended key magics + HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv + HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub + + // BIP44 coin type used in the hierarchical deterministic path for + // address generation. + HDCoinType: 1, +} + // ClientOptions are used to parameterise the behaviour of the Client. type ClientOptions struct { Timeout time.Duration