Update core. The config now defines the location of the blockchain and warehouse user directory. Close #9

This commit is contained in:
Kleissner
2021-11-17 19:15:15 +01:00
parent 7d0b4d685d
commit 62909aa64f
4 changed files with 18 additions and 8 deletions

4
.gitignore vendored
View File

@@ -1,7 +1,5 @@
*.exe *.exe
log.txt
*debug_bin *debug_bin
*.yaml *.yaml
.vscode .vscode
self.* data/
warehouse

View File

@@ -28,8 +28,6 @@ go build -trimpath -ldflags "-H=windowsgui -s"
## Use ## Use
The config filename is hard-coded to `Config.yaml` and is created on the first run. Please see the core library for individual settings to change.
Simply start it and then use the listed commands: Simply start it and then use the listed commands:
``` ```
@@ -46,6 +44,19 @@ debug key create Create Public-Private Key pair
debug key self List current Public-Private Key pair debug key self List current Public-Private Key pair
``` ```
## Config
The config filename is hard-coded to `Config.yaml` and is created on the first run. Please see the [core library](https://github.com/PeernetOfficial/core#configuration) for individual settings to change.
The config contains the locations of important files and folders.
```yaml
LogFile: "data/log.txt" # Log file. It contains informational and error messages.
BlockchainMain: "data/blockchain main/" # Blockchain main stores the end-users blockchain data. It contains meta data of shared files, profile data, and social interactions.
BlockchainGlobal: "data/blockchain global/" # Blockchain global stores blockchain data from global users.
WarehouseMain: "data/warehouse main/" # Warehouse main stores the actual data of files shared by the end-user.
```
## Web API ## Web API
The web API described in the [core library](https://github.com/PeernetOfficial/core/tree/master/webapi#web-api) is only available if the listen parameter is specified either via command line parameter or via the settings file. The web API described in the [core library](https://github.com/PeernetOfficial/core/tree/master/webapi#web-api) is only available if the listen parameter is specified either via command line parameter or via the settings file.
@@ -153,6 +164,7 @@ The application exits in case of the errors listed below and uses the specified
| 7 | ExitPrivateKeyCreate | Cannot create a new private key. | | 7 | ExitPrivateKeyCreate | Cannot create a new private key. |
| 8 | ExitBlockchainCorrupt | Blockchain is corrupt. | | 8 | ExitBlockchainCorrupt | Blockchain is corrupt. |
| 9 | ExitGraceful | Graceful shutdown. | | 9 | ExitGraceful | Graceful shutdown. |
| 10 | ExitParamApiKeyInvalid | API key parameter is invalid. |
| 0xC000013A | STATUS_CONTROL_C_EXIT | The application terminated as a result of a CTRL+C. | | 0xC000013A | STATUS_CONTROL_C_EXIT | The application terminated as a result of a CTRL+C. |
## Windows User Privileges ## Windows User Privileges

2
go.mod
View File

@@ -3,7 +3,7 @@ module github.com/PeernetOfficial/Cmd
go 1.16 go 1.16
require ( require (
github.com/PeernetOfficial/core v0.0.0-20211116210418-83e6e5fb62f3 github.com/PeernetOfficial/core v0.0.0-20211117163704-446c62bcd9e4
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7 github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7
) )

4
go.sum
View File

@@ -1,5 +1,5 @@
github.com/PeernetOfficial/core v0.0.0-20211116210418-83e6e5fb62f3 h1:IzkdQYr/GNE4ejWs/oDYWT8VEjkXNAtB4TpQ+w5+Iy8= github.com/PeernetOfficial/core v0.0.0-20211117163704-446c62bcd9e4 h1:l+TBEIYpdL1YxT/iQ9BZXYBiogHuhebqtBN1jjayb/c=
github.com/PeernetOfficial/core v0.0.0-20211116210418-83e6e5fb62f3/go.mod h1:0D/jIDYdV0WXg5WACS+fR5keafLhYB89WUs6ZEE8t4Y= github.com/PeernetOfficial/core v0.0.0-20211117163704-446c62bcd9e4/go.mod h1:0D/jIDYdV0WXg5WACS+fR5keafLhYB89WUs6ZEE8t4Y=
github.com/akrylysov/pogreb v0.10.1 h1:FqlR8VR7uCbJdfUob916tPM+idpKgeESDXOA1K0DK4w= github.com/akrylysov/pogreb v0.10.1 h1:FqlR8VR7uCbJdfUob916tPM+idpKgeESDXOA1K0DK4w=
github.com/akrylysov/pogreb v0.10.1/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI= github.com/akrylysov/pogreb v0.10.1/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=