Skip to content

Commit 6803115

Browse files
committed
updated README.md and some base settings/configs
1 parent f6ec8f7 commit 6803115

File tree

4 files changed

+36
-42
lines changed

4 files changed

+36
-42
lines changed

README.md

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# BlindBit Backend
1+
# BlindBit Oracle
22

33
A GO implementation for a BIP0352 Silent Payments Indexing Server.
4-
This backend was focused on serving the BlindBit light clients with tweak data and other simplified data to spend and
5-
receive. The produced index matches that
6-
of [other implementations](https://github.com/bitcoin/bitcoin/pull/28241#issuecomment-2079270744).
4+
This backend was focused on serving the BlindBit light client suite with tweak data and other simplified data to spend
5+
and receive. The produced index
6+
matches [other implementations](https://github.com/bitcoin/bitcoin/pull/28241#issuecomment-2079270744).
77

88
## Setup
99

@@ -26,41 +26,34 @@ The installation process is still very manual. Will be improved based on feedbac
2626

2727
### Run
2828

29-
Set the necessary ENV variables. An example is shown below.
30-
All those should be set but the exact numbers depend on the machine the program is run on.
29+
Create a config file `blindbit.toml` in your data directory to run.
30+
An example [blindbit.toml](./blindbit.example.toml) is provided here.
31+
The settings in regard to parallelization have to be made in accordance to the cores on the Full node and host machine.
3132

32-
```text
33-
export BASE_DIRECTORY="./test"
34-
export MAX_PARALLEL_REQUESTS=4 (depends on max-rpc-workers of the underlying full node)
35-
export RPC_ENDPOINT="http://127.0.0.1:18443" (defaults to http://127.0.0.1:8332)
36-
export RPC_PASS="your-rpc-password"
37-
export RPC_USER="your-rpc-user"
38-
export SYNC_START_HEIGHT=1 (has to be >= 1)
39-
40-
export MAX_PARALLEL_TWEAK_COMPUTATIONS=4 (the default for this is 1, but should be set to a higher value to increase performance, one should set this in accordance to how many cores one wants to use)
41-
42-
[optional]
43-
export TWEAKS_ONLY=1 (default: 0; 1 to activate | will only generate tweaks)
33+
Once the data directory is set up you can run it as following.
34+
```console
35+
$ blindbit-oracle --datadir ./.blindbbit-oracle
4436
```
4537

46-
Once the ENV variables are set you can just run the binary.
38+
Note that the program will automatically default `--datadir` to `~/.blindbit-oracle` if not set.
39+
You still have to set up a config file in any case as the rpc users can't and **should** not be defaulted.
4740

4841
## Known Errors
4942

50-
- block 727506 no tweaks but still one utxo listed (this should not happen)
43+
- [Should be fixed] block 727506 no tweaks but still one utxo listed (this should not happen)
5144
- REASON: UTXOs are currently blindly added based on being taproot. There is no check whether the inputs are
5245
eligible. Will be fixed asap.
53-
- cleanup has an error on block 712,517 as per
46+
- [Should be fixed] cleanup has an error on block 712,517 as per
5447
this [issue](https://github.com/setavenger/BlindBit-Backend/issues/2#issuecomment-2069827679). Needs fixing asap.
5548
- program can only be run in tweak only mode for the time being
5649

5750
## Todos
5851

5952
- [ ] Add flags to control setup
60-
- reindex
61-
- headers only
62-
- tweaks only
63-
- move most env controls to config file or cli flags/args
53+
- [ ] reindex
54+
- [ ] headers only
55+
- [x] tweaks only
56+
- [x] move most env controls to config file or cli flags/args
6457
- [ ] Include [gobip352 module](https://github.com/setavenger/gobip352)
6558
- [ ] Refactor a bunch of stuff to use byte arrays or slices instead of strings for internal uses
6659
- Could potentially reduce the serialisation overhead
@@ -78,13 +71,13 @@ Once the ENV variables are set you can just run the binary.
7871
environment).
7972
- [ ] Review all duplicate key error exemptions and raise to error/warn from debug.
8073
- [ ] Remove unnecessary panics.
81-
- [ ] Future non priority: move tweak computation code into another repo
8274
- [ ] Convert hardcoded serialisation assertions into constants (?)
8375
- [ ] Use x-only 32 byte public keys instead of scriptPubKey
8476

8577
### Low Priority
78+
8679
- [ ] Index the next couple blocks in mempool
87-
- Every 1-3 minute or so?
80+
- Every 1-3 minute or so?
8881

8982
## Endpoints
9083

blindbit.example.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
# default "./.blindbit-oracle"
2-
base_directory="./blindbit-oracle"
3-
41
# 0.0.0.0:8000 to expose outside of localhost
5-
host="127.0.0.1:8000"
2+
# default: "127.0.0.1:8000"
3+
host = "127.0.0.1:8000"
64

75
# (defaults to http://127.0.0.1:8332)
8-
rpc_endpoint="http://127.0.0.1:18443"
6+
rpc_endpoint = "http://127.0.0.1:18443"
7+
98

10-
rpc_pass="your-rpc-password"
9+
# required
10+
rpc_pass = "your-rpc-password"
1111

12-
rpc_user="your-rpc-user"
12+
# required
13+
rpc_user = "your-rpc-user"
1314

14-
# (has to be >= 1)
15-
sync_start_height=1
15+
# required (has to be >= 1)
16+
sync_start_height = 1
1617

1718
# the default for this is 1, but should be set to a higher value to increase performance,
1819
# one should set this in accordance to how many cores one wants to use
19-
max_parallel_tweak_computations=4
20+
max_parallel_tweak_computations = 4
2021

2122
# (depends on max-rpc-workers of the underlying full node)
22-
max_parallel_requests=4
23+
max_parallel_requests = 4
2324

2425
#
25-
# optional - will only generate tweaks
26+
# optional - will only generate tweaks (still both cut-through and full-index)
2627
# default: 0 set to 1 to activate
27-
tweaks_only=1
28+
tweaks_only = 1

src/common/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func LoadConfigs(pathToConfig string) {
1717
/* set defaults */
1818
// network
1919
viper.SetDefault("max_parallel_requests", MaxParallelRequests)
20-
viper.SetDefault("port", Host)
20+
viper.SetDefault("host", Host)
2121

2222
// RPC endpoint only. Fails if others are not set
2323
viper.SetDefault("rpc_endpoint", RpcEndpoint)

src/common/vars.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package common
66
// is relevant for the height-to-hash lookup in the db
77
const TaprootActivation uint32 = 709632
88
const ConfigFileName string = "blindbit.toml"
9-
const DefaultBaseDirectory = "./.blindbit-oracle"
9+
const DefaultBaseDirectory = "~/.blindbit-oracle"
1010

1111
var TweaksOnly bool
1212

0 commit comments

Comments
 (0)