Skip to content

Commit

Permalink
Implemented firestore backend
Browse files Browse the repository at this point in the history
  • Loading branch information
tmrlvi committed May 27, 2024
1 parent 6344cc4 commit f2beddb
Show file tree
Hide file tree
Showing 9 changed files with 528 additions and 40 deletions.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/node_modules
.idea
node_modules/
.env
*.db
config.json
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
node_modules/
.env
*.db
*.db
config.json
42 changes: 31 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ Build the docker image
docker build . --tag k-wallet
```

Create a `.env` file as described in [#Settings], and run the docker
Create a `config.json` file as described in [#Settings], and run the docker
```shell
docker run --env-file .env k-wallet
docker run -v ./config.json:/app/config.json -e CONFIG_PATH=/app/config.json k-wallet
```

In case of using firestore, map the firestore key file to the desired location configured in `config.json`:
```
docker run -v keyfile.json:/app/firestore.json -v ./config.json:/app/config.json -e CONFIG_PATH=/app/config.json k-wallet
```

### Locally
Expand All @@ -27,13 +32,28 @@ npm run start

## Settings

The settings are in a `.env` file, containing the follwoing:

```
DISCORD_BOT_TOKEN=<BOT_TOKEN>
DISCORD_CLIENT_ID=<BOT_CLIENT_ID>
DISCORD_GUILD_ID=<GUILD_ID> # needed for deployment
KASPAD_ADDRESS=<ADDRESS>
OFFLINE=no # In case we have problem, and want a neat message explaining things
CUSTODIAL=<MNEMONIC>
The settings are in a json file, e.g. `config.json`. The path is determined by the environment variable `CONFIG_PATH`.
The file is of the following structure:
```json
{
"kaspad_address": <kaspad address>,
"custodial": <mnemonics for the custodial wallet>,

"storeType": <"firestore" or "keyv" (direct control)>,
"storeConfig": {
"projectId": <firestore project id>,
"databaseId": <database id>,
"keyFilename": <path to service account key file>
},
"userStore": <connection string or collection name (for firestore) of the user store>,
"custodyStore": <connection string or collection name (for firestore) or the custody store>,

"offline": <use "no", "yes" or "admin" enables more debug logging directly in discord>,
"admin": <user ids which are allowed to see the direct logging if opted to admin>,
"discord_token": <bot token>,

"enableAutoForward": false,
"enableFaucet": false,
"minAllowedMulticast": 1.0
}
```
Loading

0 comments on commit f2beddb

Please sign in to comment.