Compare commits
14 Commits
7cc19efbe8
...
v1.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
f211e422b0
|
|||
|
67d27f0c96
|
|||
|
2460fa3e00
|
|||
|
1c7397708c
|
|||
|
058a5ab81d
|
|||
|
8ab18d8d0c
|
|||
|
41566ed81f
|
|||
|
e9363bd28f
|
|||
|
a647c4bd95
|
|||
|
f6162ea46c
|
|||
|
246e86902a
|
|||
|
0efc6d835f
|
|||
|
79180f211d
|
|||
|
01c45cf7be
|
BIN
assets/examples/webm/client-plugins-bitcoin.webm
Normal file
BIN
assets/examples/webm/client-plugins-bitcoin.webm
Normal file
Binary file not shown.
BIN
assets/examples/webm/container-root-plugins-bitcoin_cli.webm
Normal file
BIN
assets/examples/webm/container-root-plugins-bitcoin_cli.webm
Normal file
Binary file not shown.
BIN
assets/examples/webm/container-root-plugins-bitcoin_web.webm
Normal file
BIN
assets/examples/webm/container-root-plugins-bitcoin_web.webm
Normal file
Binary file not shown.
@@ -25,7 +25,7 @@
|
||||
|
||||
## How do I get started?
|
||||
|
||||
docker-finance (`dfi`) is not your typical Docker image in which you simply pull and containerize. `dfi` is an *image-based* accounting system that operates translucently between your client (host) and container; keeping your finances containerized (with all the benefits of containerization).
|
||||
docker-finance (`dfi`) is not your typical Docker image in which you simply pull and containerize: `dfi` is an *image-based* accounting system that operates translucently between your client (host) and container; keeping your financial world containerized (and with all the benefits of containerization).
|
||||
|
||||
To get started, you'll only need a modern Linux client (host) with a working Docker installation.
|
||||
|
||||
@@ -64,7 +64,7 @@ To get started, you'll only need a modern Linux client (host) with a working Doc
|
||||
```bash
|
||||
# NOTE: you can change the domain to `gitea.com`, as this repository is also mirrored there
|
||||
if hash git &>/dev/null; then
|
||||
if ! git clone --depth=1 https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance docker-finance/repo -b v1.2.0; then
|
||||
if ! git clone --depth=1 https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance docker-finance/repo -b v1.4.1; then
|
||||
echo "FATAL: docker-finance repo not cloned" >&2
|
||||
fi
|
||||
else
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* [Mostly-Unified CLI](#mostly-unified-cli)
|
||||
* [Flow Layout](#flow-layout)
|
||||
* [Plugins](#plugins)
|
||||
* [FAQ](#faq)
|
||||
* [Caveats & Oddities](#caveats--oddities)
|
||||
|
||||
## How do I use it?
|
||||
@@ -172,7 +173,9 @@ See the container `times help` command for details.
|
||||
|
||||
Plugins (pluggables) allow you to leverage `dfi` client/container APIs, libraries and environments to meet your unique needs.
|
||||
|
||||
For more information and examples, see some of the various existing plugins (pluggables) and respective help usage, i.e.;
|
||||
Checkout this two-part client/container set of [Bitcoin plugins](#plugins-bitcoin) to see how all APIs/libraries/environments can work together in unison.
|
||||
|
||||
For more information and other examples, see some of the various existing plugins (pluggables) and respective help usage, i.e.;
|
||||
|
||||
- Client-side (host): `dfi <platform/user:tag> plugins help`
|
||||
- Container-side: `dfi <profile/subprofile> plugins help`
|
||||
@@ -230,6 +233,135 @@ To mirror these categories, a client-side `custom` plugin directory layout is ge
|
||||
* NOTE: `root` pluggable auto-(un)loading requires a parent directory as the callable namespace (and more)
|
||||
- See docs for details: `dfi dev-tools/${USER}:default doxygen gen`
|
||||
|
||||
#### Plugins: Bitcoin
|
||||
|
||||
`dfi`'s bitcoin plugin is a two-part client/container set of plugins that gives you direct access to bitcoin's libbitcoinkernel (and related headers/symbols).
|
||||
|
||||
The following demo assumes that you'll be using a fresh setup and that you've at least satisfied the required dependencies in [Installation](How-do-I-get-started.md#installation) (Docker Engine/Compose/Buildx, Bash, Git).
|
||||
|
||||
If you're a first-time user and/or developer who simply wants a quickstart, run the following before proceeding:
|
||||
|
||||
```bash
|
||||
git clone --depth=1 https://gitea.com/EvergreenCrypto/docker-finance docker-finance/repo
|
||||
./docker-finance/repo/client/install.bash && source ~/.bashrc
|
||||
dfi archlinux/${USER}:default gen all=all profile=testprofile/testuser confirm=no dev=on
|
||||
```
|
||||
|
||||
##### Plugins: Bitcoin: Client
|
||||
|
||||
Here, we prepare client-side dependencies and build everything needed for the container-side plugin:
|
||||
|
||||
<video src="../assets/examples/webm/client-plugins-bitcoin.webm" controls></video>
|
||||
|
||||
Shell 1:
|
||||
|
||||
```bash
|
||||
# NOTE: editing will only be required once (unless you `gen type=build` in the future)
|
||||
dfi archlinux/${USER}:default edit type=build
|
||||
dfi archlinux/${USER}:default build type=default
|
||||
```
|
||||
|
||||
Shell 2:
|
||||
|
||||
```bash
|
||||
dfi archlinux/${USER}:default up
|
||||
```
|
||||
|
||||
Shell 1:
|
||||
|
||||
```bash
|
||||
dfi archlinux/${USER}:default plugins repo/bitcoin.bash get
|
||||
dfi archlinux/${USER}:default plugins repo/bitcoin.bash build
|
||||
```
|
||||
|
||||
##### Plugins: Bitcoin: Container
|
||||
|
||||
Here, we see the multiple ways the container-side plugin can be loaded and also test its functionality:
|
||||
|
||||
<video src="../assets/examples/webm/container-root-plugins-bitcoin_cli.webm" controls></video>
|
||||
|
||||
Shell 2 (or open a new shell into container, as seen in the demo):
|
||||
|
||||
```bash
|
||||
dfi testprofile/testuser root
|
||||
```
|
||||
|
||||
Within `root` interpreter:
|
||||
|
||||
```cpp
|
||||
// NOTE:
|
||||
// - The demo shows `btck` tab completion (which can't be put here)
|
||||
// - semicolons are not needed, since the following is executed per line
|
||||
GetRandHash()
|
||||
dfi::plugin::load("repo/bitcoin/bitcoin.cc")
|
||||
GetRandHash()
|
||||
dfi::macro::load("repo/test/unit.C", "Random*")
|
||||
.quit
|
||||
```
|
||||
|
||||
Shell 2:
|
||||
|
||||
```bash
|
||||
BENCHMARK_FILTER="^Random" dfi testprofile/testuser root plugins/repo/bitcoin/bitcoin.cc 'dfi::macro::load(\"repo/test/benchmark.C\"); dfi::common::exit(0);'
|
||||
dfi testprofile/testuser root plugins/repo/bitcoin/bitcoin.cc 'dfi::macro::load(\"repo/web/server.C\")'
|
||||
```
|
||||
|
||||
##### Plugins: Bitcoin: Web browser
|
||||
|
||||
Here, we see a real-world visualization of what the container-side plugin can produce. In this example, with the plugin previously loaded (as seen above), we sample bitcoin's RNG:
|
||||
|
||||
<video src="../assets/examples/webm/container-root-plugins-bitcoin_web.webm" controls></video>
|
||||
|
||||
- Open browser to `http://127.0.0.1:8080`
|
||||
* Default port can be changed with client-side command: `dfi archlinux/${USER}:default edit type=env`
|
||||
- Click `rng_sample` -> Enter sample amount
|
||||
- Click `reload`
|
||||
|
||||
### FAQ
|
||||
|
||||
> Q. Are there two versions of the `dfi` script? Or a single script that gathers all functionality under various subcommands?
|
||||
|
||||
The `dfi` command has different functionality depending on its [context](#mostly-unified-cli). The client-side (host) command only operates client-side (but can also operate *on* a container) while the container-side `dfi` command only operates within the container.
|
||||
|
||||
This pairing is part of that "translucent" quality of the system where the "same" command behaves differently, depending on the context. It allows for a fluid transition between the dual worlds of the docker-finance system. A good visual example of how the two can work together can be seen in this [demo](#plugins-bitcoin).
|
||||
|
||||
> Q. Is this dual world of docker images essential to docker-finance? Could it work with just 1 docker image, or 0 images?
|
||||
|
||||
The "dual world" aspect only describes the client (host) and container system. Currently, there are 2 `finance` images ([only 1 is actively maintained (`archlinux`)](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/issues/239)) and 1 optional `dev-tools` (developer) image.
|
||||
|
||||
The client (host) is *not* an image: these terms only describe the supported host (currently Linux). You can run `dfi` on an Ubuntu host, a Debian host, an Arch Linux host etc. When you see `archlinux` in the documentation, that only describes what the `finance` image is based - *not* what the client (host) is.
|
||||
|
||||
As for 0 image, well that would defeat the purpose! :) And although I think the world ran fine before Docker existed, the benefits of Docker (at least in this case) far outweigh the cost of the overhead.
|
||||
|
||||
> Q. What's the essential need for docker here? Is it just a packaging/distribution choice?
|
||||
|
||||
`dfi` is an all-in-one accounting system; a privacy-aware, security-aware, modern-finance-aware accounting system; a system of operating within an operating system; a financial framework for power-users.
|
||||
|
||||
But why does `dfi` (docker-finance) exist? Perhaps it's easier to ask the following:
|
||||
|
||||
1. How can I manage my own accounting locally and privately, without the need for 3rd party hosting but also using features provided by 3rd parties?
|
||||
2. How can I use [hledger-suite](https://hub.docker.com/r/evergreencrypto/hledger-suite/) to account for transactions fetched by [ccxt](https://github.com/ccxt/ccxt/) then generate privacy-aware tax reports for a [cost-basis calculator](https://bitcoin.tax/) and perform local analysis using [root](https://root.cern/) while simultaneously tracking the [time](https://taskwarrior.org/) to then bill a client with a [custom billing invoice/email plugin](#plugins); all with a single command issued from the commandline to a single locally administered system?
|
||||
3. How can the previous question be applied to multiple client profiles who's accounting must be technologically, mathematically, financially and ethically separated; while also enjoying the benefits of this all-in-one system?
|
||||
4. How can the previous question's execution be generic enough and templated enough to work for all other `dfi` project end-users without every end-user needing to maintain their own dependencies, their own locations for all relevant data or even their own functional needs (e.g., "I don't need `root` but I need to `fetch` my data and use `hledger`") but also simultaneously allow them the flexibility to do so (should they choose)?
|
||||
5. How does one provide a baseline accounting system and [workflow](#flow-layout) for users to work with that also allows them the freedom and flexibility of Docker, while also allowing the API contracts required by the aforementioned dependencies to communicate with each other across multiple languages and environments, in order to produce useful data aggregation, bookkeeping and analysis?
|
||||
6. How does one stay in line with the spirit of file-based accounting for all of the aforementioned while also avoiding a traditional DBMS and the language/UI overhead that's usually involved?
|
||||
7. How does one manage the dependencies and upstream requirements of these many different languages and environments without putting that burden on an end-user other than them running a single `update` command?
|
||||
8. How does one do all of this without compiling any code? Or rather; no compiling outside of a JIT compiler or interpreter outside of a commonly used native Linux shell?
|
||||
9. How are all of the aforementioned dependencies contained within a single system, without needing to manage packages across multiple Linux distributions?
|
||||
10. How does one do all of this with only 2 runtime dependencies for the end-user? Meaning, end-users only need to concern themselves with having `bash` and `docker` installed on their client (host) in order to run?
|
||||
|
||||
I believe `dfi` (docker-finance) answers all of these questions; satisfies all of these requirements and more.
|
||||
|
||||
> Q. Why not just provide some Dockerfiles and compose files and be done with it?
|
||||
|
||||
The docker-finance system is not that simple, but that simplicity is offered to end-users. You can work with your own custom Dockerfile and docker-compose.yml while still working within the system: simply run the client-side `dfi` command with `edit type=build,compose`.
|
||||
|
||||
This style of extensibility allows you to add or remove what you need without needing to submit a pull request (or if your need is entirely personal/unique and shouldn't be applied to other `dfi` end-users).
|
||||
|
||||
> Q. Can I use my own custom container-side `dfi` implementation?
|
||||
|
||||
Yes! Simply edit your client-side (host) environment with `edit type=env` and update `DOCKER_FINANCE_CONTAINER_CMD` to point to your own command.
|
||||
|
||||
### Caveats & Oddities
|
||||
|
||||
#### Caveats & Oddities: Flow
|
||||
@@ -240,6 +372,14 @@ Your `flow` directory will contain a symlink called `src` which links to code th
|
||||
|
||||
Before you try to infer market prices, be sure to fetch prices *before* you do your first import (or first import of the year). If you do not fetch, the prices journal will **not** be included within the import and, if you have a previous year of prices, **you will unwittingly infer against that previous year instead of your expected year!**
|
||||
|
||||
##### Caveats & Oddities: Flow: Accounts: Ledger
|
||||
|
||||
In the "Ledger Live" desktop app, change your wallet name to reflect your subaccount(s). They SHOULD be named with the format: `device_supertype:device_subtype:wallet_name-counter` in order to future-proof the number of devices and wallets that have the same name. For example:
|
||||
|
||||
1. You have 1 Ledger Nano S device with 2 bitcoin wallets ("spending" and "savings"). They would be named `nano:s-1:spending-1` and `nano:s-1:savings-1`
|
||||
2. You have 1 Ledger Nano X device with 1 bitcoin wallet ("spending") and 1 ethereum wallet ("staking"). They would be named `nano:x-1:spending-1` and `nano:x-1:staking-1`
|
||||
> Note: you can reuse "Ledger Live" wallet names across all chains because chains and symbols are added internally through `dfi` (i.e., you can name your bitcoin and ethereum wallets both `nano:x-1:spending-1`
|
||||
|
||||
##### Caveats & Oddities: Flow: Accounts: Trezor
|
||||
|
||||
In the "Trezor Suite" app, change your wallet name to your subaccount(s). For example, to delineate between your Trezor One from several Trezor T devices, and to delineate between their separate wallets *within* every device, follow these steps:
|
||||
|
||||
Reference in New Issue
Block a user