ord
ord copied to clipboard
ord index is very slow
Hey,
my index is syncing for 2 days already and each second only 1 point of the 775k gets added. this would take 190 days to full sync the index. The first 100k starts to sync in 10 minutes and after it gets super slow.
I am on debian.
Any idea how to fix that or to speed that up?
Thanks
This can be fixed by merging #1516 and #1636 and then reverting #1357.
@andrewtoth I have merged https://github.com/casey/ord/pull/1516 and https://github.com/casey/ord/pull/1636 and reverted https://github.com/casey/ord/pull/1357. It gets to the value set in the --first-inscription-height parameter very quickly. However, afterwards it is extremely slow taking around 1 minute per block. I have built using the cargo build -r command. Any other ideas?
Did you start bitcoind with -rest
or add rest=1
in bitcoin.conf
?
Yes bitcoind is running with the -rest flag
If you run with RUST_LOG=warn
before the ord
command does it warn that it can't connect to REST?
No there are no warnings output at all. See below
Update: It does seem to be using the rest endpoint as when I stop bitcoind running I get the warning that it can't connect to REST.
Ok, the first blocks are the slowest because every input has to be fetched. As it indexes more blocks, it will already have the previous inputs so less inputs need to be fetched from disk. It is definitely slower than what I experienced though. 1 minute for a block is too long. What type of hard drive are you using?
It is a virtual HDD with google cloud. Seems to max out at around 80 MiB/s (~600mbps if I am correct), but ord and bitcoind are using a fraction of that. (5-15 MiB/s at most). cpu utilisation is about 1-3% for both processes together too. Ram is 16GB and only using around 600MB
got it working with compile 0.4.2 and using a bootrap file from community
@ChristianGrieger could you share further details please?
- git clone https://github.com/casey/ord
- cd folder
- git checkout 0.4.2
- cargo build -r
- download bootstrap file, rename it to index.redb.gz and place/unzip it in /root/.local/share/ord
wget 'https://s3.amazonaws.com/octal.eth/index.redb.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVY3HUS3MKQ7N5W5V%2F20230204%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230204T180540Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=db0cf7243e0cced65a5d228714db8fc13f483671bda2860d1264de2ecf84289d'
- run ord wallet balance
- done ✅😅
This can be fixed by merging #1516 and #1636 and then reverting #1357.
any chance we can get an executable for this? i'm on 2 days of indexing and its a pain in the ass
I cloned the repo with
git clone main repo link
After switched branche to 4.0.2 withgit checkout 4.0.2
build it after and added a bootstrap file from community for the db and started it. or what you want to know?
Where did you get the file from?
This can be fixed by merging #1516 and #1636 and then reverting #1357.
Any help for us git-illiterates?
Any help for us git-illiterates?
Added the speedup improvements in my branch https://github.com/andrewtoth/ord/tree/speedup-improvements if you'd like to help test/benchmark.
git clone https://github.com/andrewtoth/ord
cd ord
git checkout speedup-improvements
cargo build --release
Make sure you set rest=1
in bitcoin.conf
or run bitcoind -txindex -rest
git clone [email protected]:andrewtoth/ord
% git clone [email protected]:andrewtoth/ord Cloning into 'ord'... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Updated the post, use git clone https://github.com/andrewtoth/ord
instead.
Now
Updated the post, use
git clone https://github.com/andrewtoth/ord
instead.
now fails on cargo line with: zsh: command not found: cargo
Oh I assumed you'd have rust installed. Install rust first, which includes cargo. After the cargo build line you can find ord
at ./target/release/ord
.
Whoops had a bad merge in there. Fixed. Do a git pull
and try again.
Success!! Will report back.
I didn't get too far! Running ord:
error: Manual upgrade required. Expected file format version 109, but file is version 107
Ahh this has a newer db version. You'll have to nuke your previous index file. It should be in ~/.local/share/ord
if you're on linux. Just rm ~/.local/share/ord/index.redb
.
But... that's 3 day's worth of work! 🥴
Will this new one be fast enough to catch me up?
Ahh you can specify a new index file. Run ord --index ./index.redb index
and it will create one in your current directory.
Well! It just ran through all the indexing in ~10 seconds and returned:
error: Can't assign requested address (os error 49)
I think I'm wrong, it didn't quite finish all the indexing. It zipped right up to 766244/775968 and then crashed out. If I run it again it goes through a few more blocks and crashes out again.
Yeah it blows through everything until block 767430 in about 10 seconds, then it takes me a little over an hour to sync to tip. Are you running bitcoind on default port? Do you have rest enabled? Not sure haven't hit that error. Any other configs for your bitcoind?
Yes, default port. Yes to rest. txindex=1 in bitcoin.conf server: true in settings.json
Other than that, vanilla, I think.
Hmm not sure what's happening. What OS are you running? It's connecting properly to the P2P interface to be able to sync all headers. It might be breaking on REST. Try running bitcoind with rest=0
and see if it syncs. It will be much slower but if it doesn't break then there's a bug with my REST patch.