diff --git a/books/architecture/src/SUMMARY.md b/books/architecture/src/SUMMARY.md index ad521df..d97d223 100644 --- a/books/architecture/src/SUMMARY.md +++ b/books/architecture/src/SUMMARY.md @@ -93,17 +93,20 @@ --- -- [⚪️ Resource model](resource-model/intro.md) - - [⚪️ File system](resource-model/file-system.md) - - [⚪️ Sockets](resource-model/sockets.md) - - [⚪️ Memory](resource-model/memory.md) - - [🟡 Concurrency and parallelism](resource-model/concurrency-and-parallelism/intro.md) - - [⚪️ Map](resource-model/concurrency-and-parallelism/map.md) - - [⚪️ The RPC server](resource-model/concurrency-and-parallelism/the-rpc-server.md) - - [⚪️ The database](resource-model/concurrency-and-parallelism/the-database.md) - - [⚪️ The block downloader](resource-model/concurrency-and-parallelism/the-block-downloader.md) - - [⚪️ The verifier](resource-model/concurrency-and-parallelism/the-verifier.md) - - [⚪️ Thread exit](resource-model/concurrency-and-parallelism/thread-exit.md) +- [⚪️ Resources](resources/intro.md) + - [⚪️ File system](resources/fs/intro.md) + - [🟡 Index of PATHs](resources/fs/paths.md) + - [⚪️ Sockets](resources/sockets/index.md) + - [🔴 Index of ports](resources/sockets/ports.md) + - [⚪️ Memory](resources/memory.md) + - [🟡 Concurrency and parallelism](resources/cap/intro.md) + - [⚪️ Map](resources/cap/map.md) + - [⚪️ The RPC server](resources/cap/the-rpc-server.md) + - [⚪️ The database](resources/cap/the-database.md) + - [⚪️ The block downloader](resources/cap/the-block-downloader.md) + - [⚪️ The verifier](resources/cap/the-verifier.md) + - [⚪️ Thread exit](resources/cap/thread-exit.md) + - [🔴 Index of threads](resources/cap/threads.md) --- diff --git a/books/architecture/src/resource-model/intro.md b/books/architecture/src/resource-model/intro.md deleted file mode 100644 index 28d1dd6..0000000 --- a/books/architecture/src/resource-model/intro.md +++ /dev/null @@ -1 +0,0 @@ -# ⚪️ Resource model diff --git a/books/architecture/src/resource-model/sockets.md b/books/architecture/src/resource-model/sockets.md deleted file mode 100644 index 0d590ca..0000000 --- a/books/architecture/src/resource-model/sockets.md +++ /dev/null @@ -1 +0,0 @@ -# ⚪️ Sockets diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/intro.md b/books/architecture/src/resources/cap/intro.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/intro.md rename to books/architecture/src/resources/cap/intro.md diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/map.md b/books/architecture/src/resources/cap/map.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/map.md rename to books/architecture/src/resources/cap/map.md diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/the-block-downloader.md b/books/architecture/src/resources/cap/the-block-downloader.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/the-block-downloader.md rename to books/architecture/src/resources/cap/the-block-downloader.md diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/the-database.md b/books/architecture/src/resources/cap/the-database.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/the-database.md rename to books/architecture/src/resources/cap/the-database.md diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/the-rpc-server.md b/books/architecture/src/resources/cap/the-rpc-server.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/the-rpc-server.md rename to books/architecture/src/resources/cap/the-rpc-server.md diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/the-verifier.md b/books/architecture/src/resources/cap/the-verifier.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/the-verifier.md rename to books/architecture/src/resources/cap/the-verifier.md diff --git a/books/architecture/src/resource-model/concurrency-and-parallelism/thread-exit.md b/books/architecture/src/resources/cap/thread-exit.md similarity index 100% rename from books/architecture/src/resource-model/concurrency-and-parallelism/thread-exit.md rename to books/architecture/src/resources/cap/thread-exit.md diff --git a/books/architecture/src/resources/cap/threads.md b/books/architecture/src/resources/cap/threads.md new file mode 100644 index 0000000..e40f2c7 --- /dev/null +++ b/books/architecture/src/resources/cap/threads.md @@ -0,0 +1,2 @@ +# Index of threads +This is an index of all of the system threads Cuprate actively uses. \ No newline at end of file diff --git a/books/architecture/src/resource-model/file-system.md b/books/architecture/src/resources/fs/intro.md similarity index 100% rename from books/architecture/src/resource-model/file-system.md rename to books/architecture/src/resources/fs/intro.md diff --git a/books/architecture/src/resources/fs/paths.md b/books/architecture/src/resources/fs/paths.md new file mode 100644 index 0000000..0e5dc3d --- /dev/null +++ b/books/architecture/src/resources/fs/paths.md @@ -0,0 +1,87 @@ +# Index of PATHs +This is an index of all of the filesystem PATHs Cuprate actively uses. + +The [`cuprate_helper::fs`](https://doc.cuprate.org/cuprate_helper/fs/index.html) +module defines the general locations used throughout Cuprate. + +[`dirs`](https://docs.rs/dirs) is used internally, which follows +the PATH standards/conventions on each OS Cuprate supports, i.e.: +- the [XDG base directory](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) and the [XDG user directory](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/) specifications on Linux +- the [Known Folder](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx) system on Windows +- the [Standard Directories](https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW6) on macOS + +## Cache +Cuprate's cache directory. + +| OS | PATH | +|---------|-----------------------------------------| +| Windows | `C:\Users\Alice\AppData\Local\Cuprate\` | +| macOS | `/Users/Alice/Library/Caches/Cuprate/` | +| Linux | `/home/alice/.cache/cuprate/` | + +## Config +Cuprate's config directory. + +| OS | PATH | +|---------|-----------------------------------------------------| +| Windows | `C:\Users\Alice\AppData\Roaming\Cuprate\` | +| macOS | `/Users/Alice/Library/Application Support/Cuprate/` | +| Linux | `/home/alice/.config/cuprate/` | + +## Data +Cuprate's data directory. + +| OS | PATH | +|---------|-----------------------------------------------------| +| Windows | `C:\Users\Alice\AppData\Roaming\Cuprate\` | +| macOS | `/Users/Alice/Library/Application Support/Cuprate/` | +| Linux | `/home/alice/.local/share/cuprate/` | + +## Blockchain +Cuprate's blockchain directory. + +| OS | PATH | +|---------|----------------------------------------------------------------| +| Windows | `C:\Users\Alice\AppData\Roaming\Cuprate\blockchain\` | +| macOS | `/Users/Alice/Library/Application Support/Cuprate/blockchain/` | +| Linux | `/home/alice/.local/share/cuprate/blockchain/` | + +## Transaction pool +Cuprate's transaction pool directory. + +| OS | PATH | +|---------|------------------------------------------------------------| +| Windows | `C:\Users\Alice\AppData\Roaming\Cuprate\txpool\` | +| macOS | `/Users/Alice/Library/Application Support/Cuprate/txpool/` | +| Linux | `/home/alice/.local/share/cuprate/txpool/` | + +## Database +Cuprate's database location/filenames depend on: + +- Which database it is +- Which backend is being used + +--- + +`cuprate_blockchain` files are in the above mentioned `blockchain` folder. + +`cuprate_txpool` files are in the above mentioned `txpool` folder. + +--- + +If the `heed` backend is being used, these files will be created: + +| Filename | Purpose | +|------------|--------------------| +| `data.mdb` | Main data file | +| `lock.mdb` | Database lock file | + +For example: `/home/alice/.local/share/cuprate/blockchain/lock.mdb`. + +If the `redb` backend is being used, these files will be created: + +| Filename | Purpose | +|-------------|--------------------| +| `data.redb` | Main data file | + +For example: `/home/alice/.local/share/cuprate/txpool/data.redb`. \ No newline at end of file diff --git a/books/architecture/src/resources/intro.md b/books/architecture/src/resources/intro.md new file mode 100644 index 0000000..3c1229e --- /dev/null +++ b/books/architecture/src/resources/intro.md @@ -0,0 +1 @@ +# Resources diff --git a/books/architecture/src/resource-model/memory.md b/books/architecture/src/resources/memory.md similarity index 100% rename from books/architecture/src/resource-model/memory.md rename to books/architecture/src/resources/memory.md diff --git a/books/architecture/src/resources/sockets/index.md b/books/architecture/src/resources/sockets/index.md new file mode 100644 index 0000000..1e65ffc --- /dev/null +++ b/books/architecture/src/resources/sockets/index.md @@ -0,0 +1 @@ +# Sockets diff --git a/books/architecture/src/resources/sockets/ports.md b/books/architecture/src/resources/sockets/ports.md new file mode 100644 index 0000000..38ebc1d --- /dev/null +++ b/books/architecture/src/resources/sockets/ports.md @@ -0,0 +1,2 @@ +# Index of ports +This is an index of all of the network sockets Cuprate actively uses. \ No newline at end of file