LBRY Updates
This commit is contained in:
Thomas Zarebczan 2020-12-08 00:08:02 -05:00
parent 0b1ea81c0f
commit 3ba4c37047
No known key found for this signature in database
GPG key ID: D505010BDB4364BC
51 changed files with 362 additions and 122 deletions

View file

@ -24,31 +24,32 @@ WORKDIR /app
RUN set -xe; \
apt-get update; \
apt-get install --no-install-recommends -y build-essential libtool autotools-dev automake pkg-config git wget apt-utils \
librsvg2-bin libtiff-tools cmake imagemagick libcap-dev libz-dev libbz2-dev python-setuptools python3-setuptools xz-utils ccache g++-multilib \
g++-mingw-w64-i686 mingw-w64-i686-dev bsdmainutils curl ca-certificates g++-mingw-w64-x86-64 mingw-w64-x86-64-dev \
clang-8 lldb-8 lld-8 libc++-8-dev libboost-all-dev libcurl4-openssl-dev libssl-devlibdb++-dev libevent-dev \
libssl-dev libtool pkg-config python python-pip libzmq3-dev; \
rm -rf /var/lib/apt/lists/*;
librsvg2-bin cmake libcap-dev libz-dev libbz2-dev python-setuptools python3-setuptools xz-utils ccache \
bsdmainutils curl ca-certificates; \
rm -rf /var/lib/apt/lists/*; \
/usr/sbin/update-ccache-symlinks;
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang-cpp-8 80; \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 80; \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 80; \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 80; \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; \
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix; \
/usr/sbin/update-ccache-symlinks; \
cd /usr/include/c++ && ln -s /usr/lib/llvm-8/include/c++/v1; \
cd /usr/lib/llvm-8/lib && ln -s libc++abi.so.1 libc++abi.so;
# VERSION: LBRYcrd 0.17.4.6
# VERSION: LBRYcrd 0.19.1.3
RUN git clone https://github.com/lbryio/lbrycrd \
&& cd lbrycrd \
&& git checkout v17_master
&& git checkout v0.19.1.3
ENV CXXFLAGS "${CXXFLAGS:--frecord-gcc-switches}"
RUN cd lbrycrd \
&& cd depends \
&& make -j$(getconf _NPROCESSORS_ONLN) HOST=x86_64-pc-linux-gnu NO_QT=1 V=1
ENV DEPS_DIR /app/lbrycrd/depends/x86_64-pc-linux-gnu
RUN echo $DEPS_DIR
ENV CONFIG_SITE ${DEPS_DIR}/share/config.site
RUN echo $CONFIG_SITE
RUN cd lbrycrd \
&& ./autogen.sh \
&& ./configure --enable-glibc-back-compat --disable-tests --without-miniupnpc --without-gui --with-incompatible-bdb --disable-hardening --disable-zmq --disable-bench --disable-wallet \
&& make
&& ./configure --enable-static --with-pic --disable-shared --enable-glibc-back-compat --disable-tests --without-miniupnpc --without-gui --with-incompatible-bdb --disable-hardening --disable-zmq --disable-bench --disable-wallet \
&& make -j$(getconf _NPROCESSORS_ONLN)
RUN mv lbrycrd/src/lbrycrdd /app/lbrycrdd \
&& rm -rf lbrycrd

View file

@ -31,13 +31,13 @@ build-release:
docker save rosetta-lbry:$(version) | gzip > rosetta-lbry-$(version).tar.gz;
run-mainnet-online:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/lbry-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-lbry:latest
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/lbry-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 9246:9246 rosetta-lbry:latest
run-mainnet-offline:
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 rosetta-lbry:latest
run-testnet-online:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/lbry-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 18333:18333 rosetta-lbry:latest
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/lbry-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 19246:19246 rosetta-lbry:latest
run-testnet-offline:
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 rosetta-lbry:latest

View file

@ -139,7 +139,7 @@ on your OS. There is a great tutorial for how to do this on Linux [here](https:/
## Architecture
`rosetta-bitcoin` uses the `syncer`, `storage`, `parser`, and `server` package
from [`rosetta-sdk-go`](https://github.com/coinbase/rosetta) instead
from [`rosetta-sdk-go`](https://github.com/coinbase/rosetta-sdk-go) instead
of a new Bitcoin-specific implementation of packages of similar functionality. Below
you can find a high-level overview of how everything fits together:

View file

@ -13,14 +13,15 @@ bind=0.0.0.0
rpcbind=0.0.0.0
bantime=15
rpcallowip=0.0.0.0/0
rpcthreads=16
rpcworkqueue=1000
rpcthreads=30
disablewallet=1
txindex=0
port=9246
rpcport=9245
rpcuser=rosetta
rpcpassword=rosetta
rpcworkqueue=3000
dbcache=3000
# allow manual pruning
prune=1

View file

@ -1,6 +1,6 @@
{
"network": {
"blockchain": "LBRY",
"blockchain": "lbry",
"network": "Mainnet"
},
"online_url": "http://localhost:8080",

View file

@ -25,8 +25,8 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
"github.com/btcsuite/btcd/chaincfg"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
)
// Mode is the setting that determines if

View file

@ -22,9 +22,9 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta/utils"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/coinbase/rosetta-sdk-go/utils"
"github.com/stretchr/testify/assert"
)
@ -143,7 +143,7 @@ func TestLoadConfiguration(t *testing.T) {
assert.Contains(t, err.Error(), test.err.Error())
} else {
test.cfg.IndexerPath = path.Join(newDir, "indexer")
test.cfg.lbrydPath = path.Join(newDir, "lbryd")
test.cfg.lbrycrddPath = path.Join(newDir, "lbrycrdd")
assert.Equal(t, test.cfg, cfg)
assert.NoError(t, err)
}

21
go.mod
View file

@ -3,14 +3,31 @@ module github.com/lbryio/rosetta-lbry
go 1.13
require (
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect
4d63.com/gochecknoinits v0.0.0-20200108094044-eb73b47b9fc4 // indirect
dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363 // indirect
github.com/alecthomas/gocyclo v0.0.0-20150208221726-aa8f8b160214 // indirect
github.com/alexkohler/nakedret v1.0.0 // indirect
github.com/btcsuite/btcd v0.21.0-beta
github.com/btcsuite/btcutil v1.0.2
github.com/client9/misspell v0.3.4 // indirect
github.com/coinbase/rosetta-sdk-go v0.6.1
github.com/dgraph-io/badger/v2 v2.2007.2
github.com/golang/lint v0.0.0-20200302205851-738671d3881b // indirect
github.com/gordonklaus/ineffassign v0.0.0-20201107091007-3b93a8888063 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/jgautheron/goconst v0.0.0-20201117150253-ccae5bf973f3 // indirect
github.com/mdempsky/maligned v0.0.0-20201101000000-d73c43cb16d0 // indirect
github.com/mdempsky/unconvert v0.0.0-20200228143138-95ecdbfc0b5f // indirect
github.com/mibk/dupl v1.0.0 // indirect
github.com/opennota/check v0.0.0-20180911053232-0c771f5545ff // indirect
github.com/stretchr/testify v1.6.1
github.com/stripe/safesql v0.2.0 // indirect
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9 // indirect
github.com/walle/lll v1.0.1 // indirect
go.uber.org/zap v1.16.0
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
golang.org/x/tools v0.0.0-20200904185747-39188db58858 // indirect
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
honnef.co/go/tools v0.0.1-2020.1.5 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7 // indirect
)

49
go.sum
View file

@ -1,4 +1,10 @@
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a h1:wFEQiK85fRsEVF0CRrPAos5LoAryUsIX1kPW/WrIqFw=
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a/go.mod h1:Sk40JNJmh0koZukOjJfaBNLZazbZthFfHnLHIcZNS6A=
4d63.com/gochecknoinits v0.0.0-20200108094044-eb73b47b9fc4 h1:bf5qocEKjrY58JO2GwywfLsb1199lIVs7qHkiplwHy0=
4d63.com/gochecknoinits v0.0.0-20200108094044-eb73b47b9fc4/go.mod h1:4o1i5aXtIF5tJFt3UD1knCVmWOXg7fLYdHVu6jeNcnM=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363 h1:o4lAkfETerCnr1kF9/qwkwjICnU+YLHNDCM8h2xj7as=
dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363/go.mod h1:WG7q7swWsS2f9PYpt5DoEP/EBYWx8We5UoRltn9vJl8=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
@ -25,8 +31,13 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/alecthomas/gocyclo v0.0.0-20150208221726-aa8f8b160214 h1:YI/8G3uLbYyowJeOPVL6BMKe2wbL54h0FdEKmncU6lU=
github.com/alecthomas/gocyclo v0.0.0-20150208221726-aa8f8b160214/go.mod h1:Ef5UOtJdJ5rVFObdOVsrNgKV/Wf4I+daTCSk8GTrHIk=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alexflint/go-arg v0.0.0-20160306200701-e71d6514f40a/go.mod h1:PHxo6ZWOLVMZZgWSAqBynb/KhIqoGO6WKwOVX7rM9dg=
github.com/alexkohler/nakedret v1.0.0 h1:S/bzOFhZHYUJp6qPmdXdFHS5nlWGFmLmoc8QOydvotE=
github.com/alexkohler/nakedret v1.0.0/go.mod h1:tfDQbtPt67HhBK/6P0yNktIX7peCxfOp0jO9007DrLE=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
@ -118,6 +129,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/lint v0.0.0-20200302205851-738671d3881b h1:BOvdkG2qv61G8DSvnEEgkjT/+tkEyHPPUfz0uGXXELY=
github.com/golang/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@ -145,6 +158,8 @@ github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/gordonklaus/ineffassign v0.0.0-20201107091007-3b93a8888063 h1:dKprcOvlsvqfWn/iGvz+oYuC2axESeSMuF8dDrWMNsE=
github.com/gordonklaus/ineffassign v0.0.0-20201107091007-3b93a8888063/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
@ -163,12 +178,16 @@ github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89 h1:12K8AlpT0/6QUXSfV0yi4Q0jkbq8NDtIKFtF61AoqV0=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jgautheron/goconst v0.0.0-20201117150253-ccae5bf973f3 h1:7nkB9fLPMwtn/R6qfPcHileL/x9ydlhw8XyDrLI1ZXg=
github.com/jgautheron/goconst v0.0.0-20201117150253-ccae5bf973f3/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
github.com/kisielk/errcheck v1.1.0 h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
@ -195,6 +214,12 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mdempsky/maligned v0.0.0-20201101000000-d73c43cb16d0 h1:+6XJvFZBYbNv/nSekNWFZyaGNMXcPnZ4n/HHoCXn+Ms=
github.com/mdempsky/maligned v0.0.0-20201101000000-d73c43cb16d0/go.mod h1:3UB4iTzhLciyWcrrvXSkrtCIU+IJ5GCfEmnleHRsxL4=
github.com/mdempsky/unconvert v0.0.0-20200228143138-95ecdbfc0b5f h1:Kc3s6QFyh9DLgInXpWKuG+8I7R7lXbnP7mcoOVIt6KY=
github.com/mdempsky/unconvert v0.0.0-20200228143138-95ecdbfc0b5f/go.mod h1:AmCV4WB3cDMZqgPk+OUQKumliiQS4ZYsBt3AXekyuAU=
github.com/mibk/dupl v1.0.0 h1:aZc3jqrF9n0tUHwHt/+jsRxA8cRgA0Gdl56M7W7PoqE=
github.com/mibk/dupl v1.0.0/go.mod h1:pCr4pNxxIbFGvtyCOi0c7LVjmV6duhKWV+ex5vh38ME=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
@ -214,6 +239,8 @@ github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/opennota/check v0.0.0-20180911053232-0c771f5545ff h1:lRHufowVGvUvxGsPveAZOpSa/9T5Gpxg6d7UbHCA9MQ=
github.com/opennota/check v0.0.0-20180911053232-0c771f5545ff/go.mod h1:tydB+MZxWpY8M/NRu7jQhND/mXuLAPsKcSV6JkzofsA=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@ -232,6 +259,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
@ -260,6 +288,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stripe/safesql v0.2.0 h1:xiefmCDd8c35PVSGrL2FhBiaKxviXnGziBDOpOejeBE=
github.com/stripe/safesql v0.2.0/go.mod h1:q7b2n0JmzM1mVGfcYpanfVb2j23cXZeWFxcILPn3JV4=
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM=
github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws=
github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
@ -271,6 +301,8 @@ github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/sjson v1.1.2 h1:NC5okI+tQ8OG/oyzchvwXXxRxCV/FVdhODbPKkQ25jQ=
github.com/tidwall/sjson v1.1.2/go.mod h1:SEzaDwxiPzKzNfUEO4HbYF/m4UCSJDsGgNqsS1LvdoY=
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9 h1:vY5WqiEon0ZSTGM3ayVVi+twaHKHDFUVloaQ/wug9/c=
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9/go.mod h1:q+QjxYvZ+fpjMXqs+XEriussHjSYqeXVnAdSV1tkMYk=
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
@ -278,8 +310,11 @@ github.com/vmihailenco/msgpack/v5 v5.0.0-beta.9 h1:iBRIniTnWOo0kqkg3k3XR8Vn6OCkV
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.9/go.mod h1:HVxBVPUK/+fZMonk4bi1islLa8V3cfnBug0+4dykPzo=
github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc=
github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/walle/lll v1.0.1 h1:lbK8008fOXbQNYt8daBGUrjvElvlwlE7D7N/9dLP5IQ=
github.com/walle/lll v1.0.1/go.mod h1:lYxcXzoPhiAHR9eaq+Yv7RYg1nIipLloBCIfPUzfaWQ=
github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
@ -324,6 +359,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b h1:GgiSbuUyC0BlbUmHQBgFqu32eiRR/CEYdjOjOd4zE6Y=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -335,6 +371,7 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4=
@ -343,12 +380,15 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
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/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/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-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -371,6 +411,7 @@ golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 h1:W0lCpv29Hv0UaM1LXb9QlBHLNP8UFfcKjblhVCWftOM=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/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=
@ -392,8 +433,12 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa h1:5E4dL8+NgFOgjwbTKz+OOEGGhP+ectTmF842l6KjupQ=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200225230052-807dcd883420/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200904185747-39188db58858 h1:xLt+iB5ksWcZVxqc+g9K41ZHy+6MKWfXCDsjSThnsPA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201030204249-4fc0492b8eca h1:KWfVIHfTHZf4IQhrLjrbG+kLyoSym7yYp0WgqtOVH9s=
golang.org/x/tools v0.0.0-20201030204249-4fc0492b8eca/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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
@ -449,3 +494,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7 h1:kAREL6MPwpsk1/PQPFD3Eg7WAQR5mPTWZJaBiG5LDbY=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc=

View file

@ -17,9 +17,9 @@ package indexer
import (
"context"
"github.com/coinbase/rosetta/parser"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/parser"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
)
var _ storage.BalanceStorageHandler = (*BalanceStorageHandler)(nil)

View file

@ -17,10 +17,10 @@ package indexer
import (
"context"
"github.com/coinbase/rosetta/asserter"
"github.com/coinbase/rosetta/parser"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/asserter"
"github.com/coinbase/rosetta-sdk-go/parser"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
)
var _ storage.BalanceStorageHelper = (*BalanceStorageHelper)(nil)

View file

@ -17,8 +17,8 @@ package indexer
import (
"context"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
)
var _ storage.CoinStorageHelper = (*CoinStorageHelper)(nil)

View file

@ -25,11 +25,11 @@ import (
"github.com/lbryio/rosetta-lbry/services"
"github.com/lbryio/rosetta-lbry/utils"
"github.com/coinbase/rosetta/asserter"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/syncer"
"github.com/coinbase/rosetta/types"
sdkUtils "github.com/coinbase/rosetta/utils"
"github.com/coinbase/rosetta-sdk-go/asserter"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/syncer"
"github.com/coinbase/rosetta-sdk-go/types"
sdkUtils "github.com/coinbase/rosetta-sdk-go/utils"
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
)
@ -219,7 +219,7 @@ func Initialize(
return i, nil
}
// waitForNode returns once lbryd is ready to serve
// waitForNode returns once lbrycrdd is ready to serve
// block queries.
func (i *Indexer) waitForNode(ctx context.Context) error {
logger := utils.ExtractLogger(ctx, "indexer")
@ -229,7 +229,7 @@ func (i *Indexer) waitForNode(ctx context.Context) error {
return nil
}
logger.Infow("waiting for lbryd...")
logger.Infow("waiting for lbrycrdd...")
if err := sdkUtils.ContextSleep(ctx, nodeWaitSleep); err != nil {
return err
}
@ -270,7 +270,7 @@ func (i *Indexer) Sync(ctx context.Context) error {
return syncer.Sync(ctx, startIndex, indexPlaceholder)
}
// Prune attempts to prune blocks in lbryd every
// Prune attempts to prune blocks in lbrycrdd every
// pruneFrequency.
func (i *Indexer) Prune(ctx context.Context) error {
logger := utils.ExtractLogger(ctx, "pruner")
@ -298,16 +298,16 @@ func (i *Indexer) Prune(ctx context.Context) error {
continue
}
logger.Infow("attempting to prune lbryd", "prune height", pruneHeight)
logger.Infow("attempting to prune lbrycrdd", "prune height", pruneHeight)
prunedHeight, err := i.client.PruneBlockchain(ctx, pruneHeight)
if err != nil {
logger.Warnw(
"unable to prune lbryd",
"unable to prune lbrycrdd",
"prune height", pruneHeight,
"error", err,
)
} else {
logger.Infow("pruned lbryd", "prune height", prunedHeight)
logger.Infow("pruned lbrycrdd", "prune height", prunedHeight)
}
}
}

View file

@ -27,9 +27,9 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
mocks "github.com/lbryio/rosetta-lbry/mocks/indexer"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta/utils"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/coinbase/rosetta-sdk-go/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
@ -75,7 +75,7 @@ func TestIndexer_Pruning(t *testing.T) {
i, err := Initialize(ctx, cancel, cfg, mockClient)
assert.NoError(t, err)
// Waiting for lbryd...
// Waiting for lbrycrdd...
mockClient.On("NetworkStatus", ctx).Return(nil, errors.New("not ready")).Once()
mockClient.On("NetworkStatus", ctx).Return(&types.NetworkStatusResponse{}, nil).Once()

View file

@ -29,9 +29,9 @@ import (
lbryUtils "github.com/lbryio/rosetta-lbry/utils"
"github.com/btcsuite/btcutil"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta/utils"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/coinbase/rosetta-sdk-go/utils"
)
const (
@ -94,7 +94,7 @@ const (
timeMultiplier = 1000
// rpc credentials are fixed in rosetta-lbry
// because we never expose access to the raw lbryd
// because we never expose access to the raw lbrycrdd
// endpoints (that could be used perform an attack, like
// changing our peers).
rpcUsername = "rosetta"
@ -110,7 +110,7 @@ var (
ErrJSONRPCError = errors.New("JSON-RPC error")
)
// Client is used to fetch blocks from lbryd and
// Client is used to fetch blocks from lbrycrdd and
// to parse lbry block data into Rosetta types.
//
// We opted not to use existing lbry RPC libraries
@ -162,7 +162,7 @@ func newHTTPClient(timeout time.Duration) *http.Client {
}
// NetworkStatus returns the *types.NetworkStatusResponse for
// lbryd.
// lbrycrdd.
func (b *Client) NetworkStatus(ctx context.Context) (*types.NetworkStatusResponse, error) {
rawBlock, err := b.getBlock(ctx, nil)
if err != nil {
@ -264,7 +264,7 @@ func (b *Client) ParseBlock(
}
// SendRawTransaction submits a serialized transaction
// to lbryd.
// to lbrycrdd.
func (b *Client) SendRawTransaction(
ctx context.Context,
serializedTx string,
@ -657,7 +657,7 @@ func (b *Client) parseOutputTransactionOperation(
CoinAction: types.CoinCreated,
}
// If we are unable to parse the output account (i.e. lbryd
// If we are unable to parse the output account (i.e. lbrycrdd
// returns a blank/nonstandard ScriptPubKey), we create an address as the
// concatenation of the tx hash and index.
//

View file

@ -24,8 +24,8 @@ import (
"net/http/httptest"
"testing"
"github.com/coinbase/rosetta/storage"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/assert"
)

172
lbry/config.go Normal file
View file

@ -0,0 +1,172 @@
package lbry
import (
"math/big"
"time"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)
func init() {
if err := chaincfg.Register(&LbryMainnetParams); err != nil {
panic(err)
}
if err := chaincfg.Register(&LbryTestnetParams); err != nil {
panic(err)
}
}
var (
bigOne = big.NewInt(1)
mainPowLimit = new(big.Int).Sub(new(big.Int).Lsh(bigOne, 224), bigOne)
)
const (
// DeploymentTestDummy ...
DeploymentTestDummy = iota
// DeploymentCSV ...
DeploymentCSV
// DeploymentSegwit ...
DeploymentSegwit
// DefinedDeployments ...
DefinedDeployments
)
// genesisCoinbaseTx is the coinbase transaction for the genesis blocks for
// the main network, regression test network, and test network (version 3).
var genesisCoinbaseTx = wire.MsgTx{
Version: 1,
TxIn: []*wire.TxIn{
{
PreviousOutPoint: wire.OutPoint{
Hash: chainhash.Hash{},
Index: 0xffffffff,
},
SignatureScript: []byte{
0x04, 0xff, 0xff, 0x00, 0x1d, 0x01, 0x04, 0x17,
0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x20, 0x74,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
},
Sequence: 0xffffffff,
},
},
TxOut: []*wire.TxOut{
{
Value: 0x12a05f200,
PkScript: []byte{ // ToDo
0x76, 0xa9, 0x14, 0x34, 0x59, 0x91, 0xdb, 0xf5,
0x7b, 0xfb, 0x01, 0x4b, 0x87, 0x00, 0x6a, 0xcd,
0xfa, 0xfb, 0xfc, 0x5f, 0xe8, 0x29, 0x2f, 0x88,
0xac,
},
},
},
LockTime: 0,
}
// https://github.com/lbryio/lbrycrd/blob/master/src/chainparams.cpp#L19
var genesisMerkleRoot = chainhash.Hash([chainhash.HashSize]byte{ // Make go vet happy.
0xcc, 0x59, 0xe5, 0x9f, 0xf9, 0x7a, 0xc0, 0x92,
0xb5, 0x5e, 0x42, 0x3a, 0xa5, 0x49, 0x51, 0x51,
0xed, 0x6f, 0xb8, 0x05, 0x70, 0xa5, 0xbb, 0x78,
0xcd, 0x5b, 0xd1, 0xc3, 0x82, 0x1c, 0x21, 0xb8,
})
var genesisBlock = wire.MsgBlock{
Header: wire.BlockHeader{
Version: 1,
PrevBlock: chainhash.Hash{}, // 0000000000000000000000000000000000000000000000000000000000000000
MerkleRoot: genesisMerkleRoot, // b8211c82c3d15bcd78bba57005b86fed515149a53a425eb592c07af99fe559cc
Timestamp: time.Unix(1446058291, 0), // Wednesday, October 28, 2015 6:51:31 PM GMT
Bits: 0x1f00ffff,
Nonce: 1287,
},
Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
}
var genesisHash = chainhash.Hash([chainhash.HashSize]byte{ // Make go vet happy.
0x63, 0xf4, 0x34, 0x6a, 0x4d, 0xb3, 0x4f, 0xdf,
0xce, 0x29, 0xa7, 0x0f, 0x5e, 0x8d, 0x11, 0xf0,
0x65, 0xf6, 0xb9, 0x16, 0x02, 0xb7, 0x03, 0x6c,
0x7f, 0x22, 0xf3, 0xa0, 0x3b, 0x28, 0x89, 0x9c,
})
func newHashFromStr(hexStr string) *chainhash.Hash {
hash, err := chainhash.NewHashFromStr(hexStr)
if err != nil {
panic(err)
}
return hash
}
// MainNetParams returns the chain configuration for mainnet
var LbryMainnetParams = chaincfg.Params{
Name: "mainnet",
Net: 0xfae4aaf1,
DefaultPort: "9246",
// Chain parameters
GenesisBlock: &genesisBlock,
GenesisHash: &genesisHash,
// Human-readable part for Bech32 encoded segwit addresses, as defined in
// BIP 173.
Bech32HRPSegwit: "lbc",
// Address encoding magics
PubKeyHashAddrID: 85,
ScriptHashAddrID: 122,
PrivateKeyID: 28,
WitnessPubKeyHashAddrID: 0x06, // starts with p2
WitnessScriptHashAddrID: 0x0A, // starts with 7Xh
BIP0034Height: 1,
BIP0065Height: 200000,
BIP0066Height: 200000,
// 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: 0x8c,
}
// TestnetParams returns the chain configuration for testnet
var LbryTestnetParams = chaincfg.Params{
Name: "testnet",
Net: 0xfae4aae1,
DefaultPort: "19246",
// Chain parameters
GenesisBlock: &genesisBlock,
GenesisHash: &genesisHash,
// Human-readable part for Bech32 encoded segwit addresses, as defined in
// BIP 173.
Bech32HRPSegwit: "tlbc", // always bc for main net
// Address encoding magics
PubKeyHashAddrID: 111,
ScriptHashAddrID: 196,
PrivateKeyID: 239,
WitnessPubKeyHashAddrID: 0x06, // starts with p2
WitnessScriptHashAddrID: 0x0A, // starts with 7Xh
BIP0034Height: 1,
BIP0065Height: 200000,
BIP0066Height: 200000,
// BIP32 hierarchical deterministic extended key magics
HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with xprv
HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with xpub
// BIP44 coin type used in the hierarchical deterministic path for
// address generation.
HDCoinType: 0x8c,
}

View file

@ -29,8 +29,8 @@ import (
)
const (
lbrydLogger = "lbryd"
lbrydStdErrLogger = "lbryd stderr"
lbrycrddLogger = "lbrycrdd"
lbrycrddStdErrLogger = "lbrycrdd stderr"
)
func logPipe(ctx context.Context, pipe io.ReadCloser, identifier string) error {
@ -51,8 +51,8 @@ func logPipe(ctx context.Context, pipe io.ReadCloser, identifier string) error {
message = messages[1]
}
// Print debug log if from lbrydLogger
if identifier == lbrydLogger {
// Print debug log if from lbrycrddLogger
if identifier == lbrycrddLogger {
logger.Debugw(message)
continue
}
@ -61,12 +61,12 @@ func logPipe(ctx context.Context, pipe io.ReadCloser, identifier string) error {
}
}
// Startlbryd starts a lbryd daemon in another goroutine
// Startlbrycrdd starts a lbrycrdd daemon in another goroutine
// and logs the results to the console.
func Startlbryd(ctx context.Context, configPath string, g *errgroup.Group) error {
logger := utils.ExtractLogger(ctx, "lbryd")
func Startlbrycrdd(ctx context.Context, configPath string, g *errgroup.Group) error {
logger := utils.ExtractLogger(ctx, "lbrycrdd")
cmd := exec.Command(
"/app/lbryd",
"/app/lbrycrdd",
fmt.Sprintf("--conf=%s", configPath),
) // #nosec G204
@ -81,21 +81,21 @@ func Startlbryd(ctx context.Context, configPath string, g *errgroup.Group) error
}
g.Go(func() error {
return logPipe(ctx, stdout, lbrydLogger)
return logPipe(ctx, stdout, lbrycrddLogger)
})
g.Go(func() error {
return logPipe(ctx, stderr, lbrydStdErrLogger)
return logPipe(ctx, stderr, lbrycrddStdErrLogger)
})
if err := cmd.Start(); err != nil {
return fmt.Errorf("%w: unable to start lbryd", err)
return fmt.Errorf("%w: unable to start lbrycrdd", err)
}
g.Go(func() error {
<-ctx.Done()
logger.Warnw("sending interrupt to lbryd")
logger.Warnw("sending interrupt to lbrycrdd")
return cmd.Process.Signal(os.Interrupt)
})

View file

@ -19,7 +19,7 @@ import (
"strings"
"github.com/btcsuite/btcd/chaincfg"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
)
const (
@ -39,7 +39,7 @@ const (
Decimals = 8
// SatoshisInlbry is the number of
// Satoshis in 1 BTC (10^8).
// Satoshis in 1 LBC (10^8).
SatoshisInlbry = 100000000
// InputOpType is used to describe
@ -69,7 +69,7 @@ const (
// of any transaction hash in lbry.
TransactionHashLength = 64
// NullData is returned by lbryd
// NullData is returned by lbrycrdd
// as the ScriptPubKey.Type for OP_RETURN
// locking scripts.
NullData = "nulldata"
@ -88,21 +88,21 @@ const (
var (
// MainnetGenesisBlockIdentifier is the genesis block for mainnet.
MainnetGenesisBlockIdentifier = &types.BlockIdentifier{
Hash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
Hash: "9c89283ba0f3227f6c03b70216b9f665f0118d5e0fa729cedf4fb34d6a34f463",
}
// MainnetParams are the params for mainnet.
MainnetParams = &chaincfg.MainNetParams
MainnetParams = &LbryMainnetParams
// MainnetCurrency is the *types.Currency for mainnet.
MainnetCurrency = &types.Currency{
Symbol: "BTC",
Symbol: "LBC",
Decimals: Decimals,
}
// TestnetGenesisBlockIdentifier is the genesis block for testnet.
TestnetGenesisBlockIdentifier = &types.BlockIdentifier{
Hash: "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
Hash: "9c89283ba0f3227f6c03b70216b9f665f0118d5e0fa729cedf4fb34d6a34f463",
}
// TestnetParams are the params for testnet.
@ -110,7 +110,7 @@ var (
// TestnetCurrency is the *types.Currency for testnet.
TestnetCurrency = &types.Currency{
Symbol: "tBTC",
Symbol: "tLBC",
Decimals: Decimals,
}

View file

@ -23,7 +23,7 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcutil"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
)
// ParseCoinIdentifier returns the corresponding hash and index associated

View file

@ -30,9 +30,9 @@ import (
"github.com/lbryio/rosetta-lbry/services"
"github.com/lbryio/rosetta-lbry/utils"
"github.com/coinbase/rosetta/asserter"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/asserter"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"

View file

@ -9,9 +9,9 @@ import (
mock "github.com/stretchr/testify/mock"
storage "github.com/coinbase/rosetta/storage"
storage "github.com/coinbase/rosetta-sdk-go/storage"
types "github.com/coinbase/rosetta/types"
types "github.com/coinbase/rosetta-sdk-go/types"
)
// Client is an autogenerated mock type for the Client type

View file

@ -7,7 +7,7 @@ import (
mock "github.com/stretchr/testify/mock"
types "github.com/coinbase/rosetta/types"
types "github.com/coinbase/rosetta-sdk-go/types"
)
// Client is an autogenerated mock type for the Client type

View file

@ -9,7 +9,7 @@ import (
mock "github.com/stretchr/testify/mock"
types "github.com/coinbase/rosetta/types"
types "github.com/coinbase/rosetta-sdk-go/types"
)
// Indexer is an autogenerated mock type for the Indexer type

View file

@ -1,6 +1,6 @@
{
"network": {
"blockchain": "LBRY",
"blockchain": "lbry",
"network": "Mainnet"
},
"data_directory": "cli-data",

View file

@ -1,6 +1,6 @@
{
"network": {
"blockchain": "LBRY",
"blockchain": "lbry",
"network": "Testnet3"
},
"data_directory": "cli-data",

View file

@ -19,8 +19,8 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
)
// AccountAPIService implements the server.AccountAPIServicer interface.
@ -83,7 +83,7 @@ func (s *AccountAPIService) AccountCoins(
// TODO: filter coins by request currencies
// TODO: support include_mempool query
// https://github.com/coinbase/rosetta-bitcoin/issues/36#issuecomment-724992022
// https://github.com/coinbase/rosetta-sdk-go-bitcoin/issues/36#issuecomment-724992022
// Once mempoolcoins are supported also change the bool service/types.go:MempoolCoins to true
coins, block, err := s.i.GetCoins(ctx, request.AccountIdentifier)

View file

@ -22,7 +22,7 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
mocks "github.com/lbryio/rosetta-lbry/mocks/services"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/assert"
)

View file

@ -19,8 +19,8 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
)
// BlockAPIService implements the server.BlockAPIServicer interface.

View file

@ -22,7 +22,7 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
mocks "github.com/lbryio/rosetta-lbry/mocks/services"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/assert"
)

View file

@ -31,9 +31,9 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/coinbase/rosetta/parser"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/parser"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
)
const (
@ -777,7 +777,7 @@ func (s *ConstructionAPIService) ConstructionSubmit(
txHash, err := s.client.SendRawTransaction(ctx, signed.Transaction)
if err != nil {
return nil, wrapErr(Errlbryd, fmt.Errorf("%w unable to submit transaction", err))
return nil, wrapErr(ErrLbrycrdd, fmt.Errorf("%w unable to submit transaction", err))
}
return &types.TransactionIdentifierResponse{

View file

@ -23,7 +23,7 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
mocks "github.com/lbryio/rosetta-lbry/mocks/services"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/assert"
)

View file

@ -15,7 +15,7 @@
package services
import (
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
)
var (

View file

@ -19,8 +19,8 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
)
// MempoolAPIService implements the server.MempoolAPIServicer interface.
@ -51,7 +51,7 @@ func (s *MempoolAPIService) Mempool(
mempoolTransactions, err := s.client.RawMempool(ctx)
if err != nil {
return nil, wrapErr(Errlbryd, err)
return nil, wrapErr(ErrLbrycrdd, err)
}
transactionIdentifiers := make([]*types.TransactionIdentifier, len(mempoolTransactions))

View file

@ -21,7 +21,7 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
mocks "github.com/lbryio/rosetta-lbry/mocks/services"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/assert"
)

View file

@ -20,8 +20,8 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
"github.com/lbryio/rosetta-lbry/lbry"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
)
// NetworkAPIService implements the server.NetworkAPIServicer interface.
@ -67,7 +67,7 @@ func (s *NetworkAPIService) NetworkStatus(
peers, err := s.client.GetPeers(ctx)
if err != nil {
return nil, wrapErr(Errlbryd, err)
return nil, wrapErr(ErrLbrycrdd, err)
}
cachedBlockResponse, err := s.i.GetBlockLazy(ctx, nil)

View file

@ -22,7 +22,7 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
mocks "github.com/lbryio/rosetta-lbry/mocks/services"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/assert"
)

View file

@ -19,8 +19,8 @@ import (
"github.com/lbryio/rosetta-lbry/configuration"
"github.com/coinbase/rosetta/asserter"
"github.com/coinbase/rosetta/server"
"github.com/coinbase/rosetta-sdk-go/asserter"
"github.com/coinbase/rosetta-sdk-go/server"
)
// NewBlockchainRouter creates a Mux http.Handler from a collection

View file

@ -19,7 +19,7 @@ import (
"github.com/lbryio/rosetta-lbry/lbry"
"github.com/coinbase/rosetta/types"
"github.com/coinbase/rosetta-sdk-go/types"
)
const (

View file

@ -18,7 +18,7 @@ import (
"context"
"time"
sdkUtils "github.com/coinbase/rosetta/utils"
sdkUtils "github.com/coinbase/rosetta-sdk-go/utils"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"
)