Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions books/architecture/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---

Expand Down
1 change: 0 additions & 1 deletion books/architecture/src/resource-model/intro.md

This file was deleted.

1 change: 0 additions & 1 deletion books/architecture/src/resource-model/sockets.md

This file was deleted.

2 changes: 2 additions & 0 deletions books/architecture/src/resources/cap/threads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Index of threads
This is an index of all of the system threads Cuprate actively uses.
Comment on lines +1 to +2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, is this just global rayon + global tokio + blockchain + txpool?

@Boog900 are there any threads (ephemeral/persistent) spawned in any of your code? Or any code that we call out to?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are going to have a thread that listens to Stdin and handles commands. Also the blockchain + txpool will use the same threadpool

87 changes: 87 additions & 0 deletions books/architecture/src/resources/fs/paths.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Index of PATHs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only save database files currently?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also save a p2p_state file, which I should add to helper

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`.
1 change: 1 addition & 0 deletions books/architecture/src/resources/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Resources
1 change: 1 addition & 0 deletions books/architecture/src/resources/sockets/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Sockets
2 changes: 2 additions & 0 deletions books/architecture/src/resources/sockets/ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Index of ports
This is an index of all of the network sockets Cuprate actively uses.
Comment on lines +1 to +2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we open any right now, right? Maybe networking ones in the alpha binary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah not yet, we would need #176. For the initial alpha binary I would be ok with not accepting inbound connections

Loading