Skip to content

Commit

Permalink
update README && make circulation check optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Jan 11, 2023
1 parent 3a946cf commit d1ac916
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,23 @@ Replace the `rpcurl` with the .onion address of your node.
Make sure you've read the [requirements](#requirements) first, and that your node is configured properly.
Here's the recommended configuration for `bitcoin.conf`:

Don't use rpcuser/rpcpassword on your full node because they are insecure. Bitcoin-core changed to rpcauth.
It is not recommended to use rpcuser/rpcpassword in the bitcoin.conf of your full node use rpcauth instead.
If you still want to use it make sure the following settings are in your bitcoin.conf file:

```
# Enable RPC server
server=1
# Enable indexes
txindex=1
blockfilterindex=1
# Set RPC credentials
rpcuser=<user>
rpcpassword=<password>
```

If you want to use the newest security standard recommended by the core-devs then read the following paragraph.
Get the rpcauth.py script from the bitcoin repo and create a new user for satstack.

```
Expand Down Expand Up @@ -157,7 +173,7 @@ page (Linux, Windows, MacOS). Extract the tarball, and launch it as:
```sh
./lss
```
There are some cmd handle which can be useful when setting up the setup the first time you can list them with
There are some cmd handles which can be useful when configuring the setup the first time. List them with

`./lss -h` or `./lss --help`

Expand Down
6 changes: 3 additions & 3 deletions bus/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func runTheNumbers(b *Bus) error {
return nil
}

func (b *Bus) Worker(config *config.Configuration, skipCirculationCheck bool,
func (b *Bus) Worker(config *config.Configuration, circulationCheck bool,
forceImportDesc bool) {
importDone := make(chan bool)

Expand Down Expand Up @@ -252,7 +252,7 @@ func (b *Bus) Worker(config *config.Configuration, skipCirculationCheck bool,
return
}

if !skipCirculationCheck {
if circulationCheck {
b.IsPendingScan = true

if err := runTheNumbers(b); err != nil {
Expand All @@ -272,7 +272,7 @@ func (b *Bus) Worker(config *config.Configuration, skipCirculationCheck bool,
// We check whether the lss_rescan.json exists
startHeight, err := getPreviousRescanBlock()
if err != nil {
log.Debugf("No lss_rescan.json file found %s", err)
log.Debugf("No lss_rescan.json was found: %s", err)
}

// We allow the user to force an import of all descriptors
Expand Down
13 changes: 7 additions & 6 deletions cmd/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
func init() {
rootCmd.PersistentFlags().String("port", "20000", "Port")
rootCmd.PersistentFlags().Bool("unload-wallet", false, "whether SatStack should unload wallet")
rootCmd.PersistentFlags().Bool("skip-circulation-check", false, "skip the circulation check")
rootCmd.PersistentFlags().Bool("force-importdescriptors", false, "this will force importing descriptors although the wallet does already exist")
rootCmd.PersistentFlags().Bool("circulation-check", false, "performs inflation checks against the connected full node")
rootCmd.PersistentFlags().Bool("force-importdescriptors", false, "this will force importing descriptors although the wallet does already exist "+
"which will force the wallet to rescan from the brithday date")

}

Expand All @@ -33,10 +34,10 @@ var rootCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
port, _ := cmd.Flags().GetString("port")
unloadWallet, _ := cmd.Flags().GetBool("unload-wallet")
skipCirculationCheck, _ := cmd.Flags().GetBool("skip-circulation-check")
circulationCheck, _ := cmd.Flags().GetBool("circulation-check")
forceImportDesc, _ := cmd.Flags().GetBool("force-importdescriptors")

s := startup(unloadWallet, skipCirculationCheck, forceImportDesc)
s := startup(unloadWallet, circulationCheck, forceImportDesc)
if s == nil {
return
}
Expand Down Expand Up @@ -122,7 +123,7 @@ func Execute() {
}
}

func startup(unloadWallet bool, skipCirculationCheck bool, forceImportDesc bool) *svc.Service {
func startup(unloadWallet bool, circulationCheck bool, forceImportDesc bool) *svc.Service {

if version.Build == "development" {
log.SetLevel(log.DebugLevel)
Expand Down Expand Up @@ -178,7 +179,7 @@ func startup(unloadWallet bool, skipCirculationCheck bool, forceImportDesc bool)

fortunes.Fortune()

s.Bus.Worker(configuration, skipCirculationCheck, forceImportDesc)
s.Bus.Worker(configuration, circulationCheck, forceImportDesc)

return s
}

0 comments on commit d1ac916

Please sign in to comment.