From 62909aa64fd27f71a02771974bf3c9a0caa3265d Mon Sep 17 00:00:00 2001 From: Kleissner Date: Wed, 17 Nov 2021 19:15:15 +0100 Subject: [PATCH] Update core. The config now defines the location of the blockchain and warehouse user directory. Close #9 --- .gitignore | 4 +--- README.md | 16 ++++++++++++++-- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 56bb211..2f480b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ *.exe -log.txt *debug_bin *.yaml .vscode -self.* -warehouse \ No newline at end of file +data/ \ No newline at end of file diff --git a/README.md b/README.md index 1edd0bd..1fdf971 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ go build -trimpath -ldflags "-H=windowsgui -s" ## 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: ``` @@ -46,6 +44,19 @@ debug key create Create 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 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. | | 8 | ExitBlockchainCorrupt | Blockchain is corrupt. | | 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. | ## Windows User Privileges diff --git a/go.mod b/go.mod index 8009265..71639fb 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/PeernetOfficial/Cmd go 1.16 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/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7 ) diff --git a/go.sum b/go.sum index d3e712c..aa64f63 100644 --- a/go.sum +++ b/go.sum @@ -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-20211116210418-83e6e5fb62f3/go.mod h1:0D/jIDYdV0WXg5WACS+fR5keafLhYB89WUs6ZEE8t4Y= +github.com/PeernetOfficial/core v0.0.0-20211117163704-446c62bcd9e4 h1:l+TBEIYpdL1YxT/iQ9BZXYBiogHuhebqtBN1jjayb/c= +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/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=