trezor / blockbook

:blue_book: Trezor address/account balance backend
https://trezor.io
GNU Affero General Public License v3.0
669 stars 655 forks source link

changing instance type #1119

Closed dev-dantealighieri closed 3 months ago

dev-dantealighieri commented 3 months ago

hi

i deployed my litecoin indexer on aws, can i change aws ec2 instance type from x86 to arm, rebuild the blockbook, and continue with already indexed data?

thanks, dante

vdovhanych commented 3 months ago

It should be possible technically, but this is not something we've had experience with.

martinboehm commented 3 months ago

Sure, there is no problem. Database format is compatible across platforms.

dev-dantealighieri commented 3 months ago

thanks!

dante

dev-dantealighieri commented 3 months ago

@martinboehm

i change my ravencoin instances type from x86 to aarch64, i didnt changed the data, but currently i cannot even build, i get the following error

➜  blockbook git:(master) ✗ make all-ravencoin
rm -rf build/pkg-defs
rm -f build/*.deb
docker rmi blockbook-build
Error response from daemon: No such image: blockbook-build:latest
make: [Makefile:78: clean-bin-image] Error 1 (ignored)
docker rmi blockbook-build-deb
Error response from daemon: No such image: blockbook-build-deb:latest
make: [Makefile:81: clean-deb-image] Error 1 (ignored)
rm -f .bin-image .deb-image  # remove obsolete tag files
make .bin-image .deb-image
make[1]: Entering directory '/root/blockbook'
Building image blockbook-build from ubuntu:22.04
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  6.656kB
Step 1/29 : ARG BASE_IMAGE
Step 2/29 : FROM $BASE_IMAGE
 ---> 52882761a72a
Step 3/29 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> a91322b0284a
Step 4/29 : ARG PORTABLE_ROCKSDB
 ---> Using cache
 ---> db35a9160d00
Step 5/29 : RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y build-essential git wget pkg-config lxc-dev libzmq3-dev                        libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev                        libzstd-dev liblz4-dev graphviz &&     apt-get clean
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 2c9f82f1b860
exec /bin/sh: exec format error
The command '/bin/sh -c apt-get update &&     apt-get upgrade -y &&     apt-get install -y build-essential git wget pkg-config lxc-dev libzmq3-dev                        libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev                        libzstd-dev liblz4-dev graphviz &&     apt-get clean' returned a non-zero code: 1
make[1]: *** [Makefile:48: .bin-image] Error 1
make[1]: Leaving directory '/root/blockbook'
make: *** [Makefile:45: build-images] Error 2

is there anything else i need to now for building to arm?

thanks

vdovhanych commented 3 months ago

Take a look at Bitcoin configuration, especially regtest. There are binaries being downloaded during the build, and I believe it downloads x86 binaries. That's why it fails for you with an exec format error.

dev-dantealighieri commented 3 months ago

hey,

how can i fix this, i just want to install onto arm64 machine, can you privde help on this topic?

vdovhanych commented 3 months ago

Add platform configuration to the coin config as I send you with the Bitcoin example. After that, you can just run the build, and it should build the arm version for you.