Skip to content

Initial fastapi #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d8eba96
feat: add Vault CLI & data package library (#1)
PiDelport Apr 28, 2022
a1a57f0
feat: add initial TEE server (#3)
PiDelport Apr 28, 2022
1521f59
license: relicense to AGPL-3.0 (#17)
jdvlio May 4, 2022
356aa48
ci: use ntls-io fork of rust-sgx-sdk-env (#39)
jdvlio Jul 14, 2022
5a5bfa7
feat: create oracle-node API (#18)
billguo99 Jul 14, 2022
3a12a82
feat: add Vault backend (#61)
billguo99 Sep 5, 2022
d6c260d
refactor(rust-sgx-workspace): rename 'wallet' to 'vault' (#62)
billguo99 Sep 6, 2022
fb26233
refactor(sgx-vault-impl): change vault id to algorand address (#65)
billguo99 Sep 6, 2022
8e8d6d8
refactor: remove Onfido operations and XRP related code (#66)
billguo99 Sep 6, 2022
266a57d
feat(rust-sgx-workspace): add Docker build definition for Vault serve…
billguo99 Sep 6, 2022
7c3a0db
feat: Create two APIs for data operations
binglekruger Sep 28, 2022
462ed04
feat: Create two APIs for data operations
binglekruger Sep 28, 2022
9327bad
Merge branch 'data-operations' of https://github.com/ntls-io/nautilus…
binglekruger Oct 13, 2022
aa1060a
Merge branch 'data-operations' of https://github.com/ntls-io/nautilus…
binglekruger Oct 13, 2022
5a78c00
feat(data-operations-api): create new project dir
binglekruger Oct 13, 2022
392c6d6
feat(data-operations-api): create new project dir
binglekruger Oct 13, 2022
ebf31d5
feat: Add base crate
binglekruger Oct 14, 2022
9706b7b
feat: Add base crate
binglekruger Oct 14, 2022
d713a86
feat: Add basic Actix server
binglekruger Oct 24, 2022
d28fea4
feat: Add basic Actix server
binglekruger Oct 24, 2022
3654c67
feat: Configure server + add logs_handlers
binglekruger Oct 24, 2022
610aa20
feat: Configure server + add logs_handlers
binglekruger Oct 24, 2022
59ad783
feat: Fetching logs
binglekruger Oct 24, 2022
100cd49
feat: Fetching logs
binglekruger Oct 24, 2022
96d03a3
feat: Adding logs
binglekruger Oct 24, 2022
1d61888
feat: Adding logs
binglekruger Oct 24, 2022
454e6b0
refactor: Update log -> data
binglekruger Oct 24, 2022
adc70fb
refactor: Update log -> data
binglekruger Oct 24, 2022
d4aceb8
feat: Add filter functionality
binglekruger Oct 24, 2022
3d20c53
feat: Add filter functionality
binglekruger Oct 24, 2022
b1313e2
refactor: remove unused imports + fix snake_case
binglekruger Nov 1, 2022
7fa0869
refactor: remove unused imports + fix snake_case
binglekruger Nov 1, 2022
535e457
feat(backend-services): initial commit for api
sonasi Jan 23, 2023
d7f0b9b
feat(backend-services): initial commit for api
sonasi Jan 23, 2023
cd2327c
fix(backend-services): add env to .gitignore.
sonasi Jan 25, 2023
3382420
Merge branch 'initial-fastapi' of github.com:ntls-io/nautilus-trusted…
sonasi Feb 7, 2023
ae8a759
fix (backend-services): .gitignore and datetime
sonasi Feb 7, 2023
03a3967
feature (backend-services): add example json and schema files
sonasi Feb 7, 2023
f6461c6
feat(backend-services): update datapool and dataset entities (#74)
billguo99 Feb 14, 2023
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
4 changes: 4 additions & 0 deletions backend-services/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PRIMARY_ORIGIN="http://www.localhost:8000"
VAULT_DB_CONNECTION_STRING="mongodb://ntls:Mw6fvOK3BQCyPYKsw7OjMFrwdWBNrWE9S3edoJWNsxp34jtDnDTfwZCXAIw4uQE1NWHxRPC0AcVuACDbM3LMQg==@ntls.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@ntls@"
VAULT_DB_NAME="vault"
VAULT_DB_BOOKMARK_COLLECTION_NAME="datasets"
6 changes: 6 additions & 0 deletions backend-services/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__pycache__
/.env
/.mypy_cache
/.python-version
/.tox
/dist
110 changes: 110 additions & 0 deletions backend-services/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Wallet Backend Services

An HTTP server backend for the Nautilus Wallet powered by [FastAPI][fastapi] and
the [uvicorn ASGI server][uvicorn].

- [Setup](#setup)
- [Quick Start](#quick-start)

[fastapi]: https://fastapi.tiangolo.com/
[uvicorn]: https://www.uvicorn.org/

## Setup

In order to proceed, one needs to have the `poetry` dependency management and
packaging tool installed. Unless a recent version is available via your OS
package manager, as it would be on Arch Linux and friends :), the recommended
means of installing `poetry` is via the well-established `pipx` tool as
described in [their documentation][pipx-install].

Once `pipx` is installed, installing `poetry` is as simple as

```shell
pipx install poetry
```

If you are simply looking for the API docs you may now skip ahead to the
[following section][#quick-start], you should also install the `pyenv` tool as
it is invaluable in managing your project-specific and shell-specific virtual
environments. This is again as simple as

```shell
pipx install pyenv
```

If you use `bash` as your shell then copy the following to your
`~/.bash_profile`, if it exists, or otherwise to `~/.profile`

```bash
# you may ignore this line if it is already set in your config
export XDG_DATA_HOME="$HOME/.local/share"

export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
```

and copy the same last line to your `~/.bashrc`

```bash
eval "$(pyenv init -)"
```

Make sure to log out (and back in of course) or, alternatively, restart your
machine. Once you are back in the `backend-services` sub-directory of the
project run

```shell
pyenv local 3.{10,11}
```

[pipx-install]: https://python-poetry.org/docs/#installation

## Quick Start

In the root of the Python project, where the `pyproject.toml` is located, run
the following command:

```shell
poetry install
```

Make sure the following environment variables have been set in your local `.env` file:

- `WALLET_DB_CONNECTION_STRING`
- `WALLET_DB_DATABASE_NAME`
- `WALLET_BOOKMARK_DB_COLLECTION_NAME`

For examples you may consult the [python-dotenv] documentation. Once this is done, a local instance of the server may be started on `localhost:8000` by running

```shell
poetry run uvicorn web_asgi.main:app
```

The **Swagger/OpenAPI documentation** for this server is now accessible via
[localhost][localhost-docs].

If you would like to run the tests for the project locally, simply invoke

```shell
poetry run tox
```

Note that `poetry` creates and keeps track of project-related `python` virtual
environments on your behalf via your IDE (an IDE plugin might be necessary) or
from the command line. Run

```shell
poetry env info
```

for details about available environments for your current project. If you would
like to spawn a shell inside the current `poetry` virtual environment this may
be done via

```shell
poetry shell
```

[localhost-docs]: http://localhost:8000/docs
[python-dotenv]: https://github.com/theskumar/python-dotenv#getting-started
Loading