Comments (5)
Here's a one-liner to perform history compact operations. It should work on any system that has docker installed and that has r/w access to the electrum data set.
docker run --rm --env COIN=BitcoinSegwit --env DB_DIRECTORY=/data -v "${PWD}/electrumx:/data" --entrypoint=/usr/local/bin/electrumx_compact_history lukechilds/electrumx:v1.16.0
Regarding long term solution, I don't think this has much to do with lukechilds' container, it might be helpful to comment on the issue on the electrumx repo, and maybe even the issue on the upstream repo.
from docker-electrumx.
This looks like the same problem. But without any long term solution..
#60
from docker-electrumx.
OK, how I solved this (super hacky)
- Stop the container
- Clone this git repo onto your server/computer
- Change the init file to run the compaction (change last line to this:
exec /electrumx/electrumx_compact_history
) - Build a new image from the clone from using (for example
docker build -t lukechilds/electrumx_temp
) - Then run this new image, and it will do everything needed. Shut down when finished (check logs to make sure it is finished)
- Revert back to the normal image.
from docker-electrumx.
@maltokyo Thanks, I found another way to do that is just do a one-off docker run -it
(interactive shell) on the same image. I ran into issues but this was because I forgot to mount my /data
volume.
docker run -v /path/to/electrum/data:/data -it electrumx /bin/sh
Then inside the container:
cd /electrumx
# You can avoid this if you pass these to your `docker run -it ....` command
export DAEMON_URL="http://rpcuser:[email protected]:8332
export COIN=BitcoinSegWit
export NET=mainnet
export PEER_ANNOUNCE=""
export PEER_DISCOVERY=""
export SERVICES="ssl://172.20.0.2:50002"
export REPORT_SERVICES=""
export INITIAL_CONCURRENT=100
export COST_SOFT_LIMIT=100000
export COST_HARD_LIMIT=1000000
export REQUEST_SLEEP=30000
./electrumx_compact_history
from docker-electrumx.
If someone is running this on kubernetes with helm charts Id recommend the following with a compacting.enabled set to True in the value files of
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "service.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: volume-mount-hack
image: busybox
command: ["sh", "-c", "chown -R 999:999 /var/lib/electrumx"]
volumeMounts:
- name: electrumx-data
mountPath: /var/lib/electrumx
{{- if .Values.compacting.enabled }}
- name: compacting-hack
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["/usr/local/bin/electrumx_compact_history"]
volumeMounts:
- name: electrumx-data
mountPath: /var/lib/electrumx
envFrom:
- secretRef:
name: {{ include "service.fullname" . }}-secrets
- configMapRef:
name: {{ include "service.fullname" . }}-configmap
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: ssl-key
mountPath: "/etc/electrumx.key"
subPath: "electrumx.key"
readOnly: true
- name: ssl-cert
mountPath: "/etc/electrumx.cert"
subPath: "electrumx.cert"
readOnly: true
- name: electrumx-data
mountPath: /var/lib/electrumx
envFrom:
- secretRef:
name: {{ include "service.fullname" . }}-secrets
- configMapRef:
name: {{ include "service.fullname" . }}-configmap
ports:
- name: rpc
containerPort: {{ .Values.config.service.rpcPort }}
- name: tcp
containerPort: {{ .Values.config.service.tcpPort }}
from docker-electrumx.
Related Issues (20)
- error while building on tinkerboard ( arm 32 ) HOT 2
- Integration with BTCPay Server - Please help on that PR HOT 4
- Can only connect from Electrum Wallet via hostname, not ip address (internal nor external) HOT 4
- Multiarch support HOT 2
- What database does this Docker use by default? HOT 4
- Drop down to electrumx user
- Specify versions by commit hash not version tag
- Document RPC usage
- Symlink binaries into /usr/bin
- docker-electrumx immediately drops incoming RPC connections from Electrum HOT 8
- Plans to update to latest ElectrumX version? HOT 3
- standard_init_linux.go:211: exec user process caused "exec format error" HOT 44
- ERROR:electrumx:ElectrumX server terminated abnormally HOT 1
- How to compact the database? (struct.error: 'H' format requires 0 <= number <= 65535) HOT 6
- cannot access it from outsite
- not listening on port 50001
- Error Connecting To Polar's Regtest Node HOT 2
- long time to sync HOT 1
- ElectrumX server keeps crashing randomly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-electrumx.