Skip to content
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

Automated documentation update #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
42 changes: 8 additions & 34 deletions src/psibase/README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
# Overview

This template allows anyone to start developing new PsiBase web services (frontend and backend) in just a few clicks. When using this template, you will connect VSCode to a preconfigured docker container, generate a project, and deploy your new project to a running instance of Psinode.
# Psibase (psibase)

Develop Psibase web-services in C++ or Rust. 🌐 about.psibase.io 🌐

# Prerequisites
## Options

1. VSCode installed on your development PC
2. Docker desktop is installed on your development PC
3. [Psidekick extension](docker-desktop://extensions/marketplace?extensionId=jamesmart/psidekick&tag=0.1.3) installed in Docker Desktop
4. [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) VSCode extension has been installed.
| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| usingPsidekick | Will you deploy services to the Psidekick Docker extension? (If yes, you must pre-install Psidekick) | string | Yes |

# Instructions

1. Install VSCode
2. Install Dev Containers extension
3. Run the `Dev Containers: Add Dev Container Configuration Files...` command in VSCode and answer the prompt(s)
4. Run the `Dev-Containers: Rebuild and Reopen in Container` command in VSCode
![](/res/rebuild_reopen.png)

If you don't already have Docker Desktop installed, you should be automatically prompted to install it. VSCode will then relaunch, connecting to a new docker container with an environment pre-configured to be able to build Psibase Services. This can take a few minutes on the first time for it to build the docker container.
---

Once inside the docker container, open the integrated terminal within VSCode (```Ctrl+Shift+` on Windows```) and run `psi-generate`. Follow the on-screen instructions to generate and open a new project.

You may use the buttons at the bottom of the VSCode window to build & test your project (You can even customize these buttons and their functionality by modifying `.vscode/tasks.json`). Note: Testing functionality is currently disabled.

![](/res/build_test.png)

When you're ready to deploy your project, follow the deployment instructions found [here](https://doc-sys.psibase.io/cpp-service/basic/index.html#deploying-the-service).

*To-do: Use a graphical UI from the chain for deployment.*

# Additional notes

When VSCode closes, the container stops. The data within the container is not accessible, as it's stored in an unnamed volume mounted on your PC, only accessible through the docker container launched by VSCode.

All changes made within the container will persist on your PC (as long as you don't delete the docker volume), and must be pushed to a git repository if you want to work on it on another PC.

# Updating this template

When you update this template, remember to change the version number in devcontainer-template.json.
Github CI/CD should automatically generate new artifacts for this template and PR them to the relevant repository used by the Dev Containers extension.
_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/gofractally/psibase-devcontainer-template/blob/main/src/psibase/devcontainer-template.json). Add additional notes to a `NOTES.md`._