-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(deploy): Split Deploy section, impr mentions
- Deploy section split: - BEFORE: [ Testnet ] - AFTER: [ Overview, Hosted, Self-Hosted ] - In root doc overview, added a name to the publish command (to prevent confusion later) - Added instructions how to add back `local` and `testnet` servers via CLI after repeatedly experiencing a bug that wipes the servers.
- Loading branch information
Showing
7 changed files
with
220 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Deploying - Hosted | ||
|
||
This tutorial assumes that you have already [installed](/install) the SpacetimeDB CLI. Via CLI, we will then: | ||
|
||
1. Ensure our hosted server named `testnet` exists as the default. | ||
1. Create an `Identity`. | ||
1. `Publish` your app. | ||
|
||
💡 This tutorial assumes that you have already [installed](/install) the SpacetimeDB CLI and that you already have `testnet` server added (exists by default). If you accidentally removed `testnet`, add it back via CLI: | ||
|
||
```bash | ||
spacetime server add "https://testnet.spacetimedb.com" testnet | ||
``` | ||
|
||
## SpacetimeDB Cloud (Hosted) Deployment | ||
|
||
Currently, for hosted deployment, only the `testnet` server is available for SpacetimeDB cloud, which is subject to wipes. | ||
|
||
📢 Stay tuned (such as [via Discord](https://discord.com/invite/SpacetimeDB)) for `mainnet` coming soon! | ||
|
||
## Set the Server Default | ||
|
||
To make CLI commands easier so that we don't need to keep specifying `testnet` as the target server, let's set it as default: | ||
|
||
```bash | ||
spacetime server set-default testnet | ||
``` | ||
|
||
## Creating an Identity | ||
|
||
By default, there are no identities created. Let's create a new one via CLI: | ||
```bash | ||
spacetime identity new --name {Nickname} --email {Email} | ||
``` | ||
|
||
💡If you already created an identity but forgot to attach an email, add it via CLI: | ||
```bash | ||
spacetime identity set-email {Email} | ||
``` | ||
|
||
## Create and Publish a Module | ||
|
||
Let's create a vanilla Rust module called `HelloSpacetimeBD` from our home dir, then publish it "as-is". For Windows users, use `PowerShell`: | ||
|
||
```bash | ||
cd ~ | ||
spacetime init --lang rust HelloSpacetimeDB | ||
cd HelloSpacetimeDB | ||
spacetime publish HelloSpacetimeDB | ||
``` | ||
|
||
## Hosted Web Dashboard | ||
|
||
By earlier associating an email with your CLI identity, you can now view your published modules on the web dashboard. For multiple identities, first list them and copy the hash you want to use: | ||
|
||
```bash | ||
spacetime identity list | ||
``` | ||
|
||
1. Open the SpacetimeDB [login page](https://spacetimedb.com/login) using the same email above. | ||
1. Choose your identity from the dropdown menu. | ||
- \[For multiple identities\] `CTRL+F` to highlight the correct identity you copied earlier. | ||
1. Check your email for a validation link. | ||
|
||
You should now be able to see your published modules on the web dashboard! | ||
|
||
--- | ||
|
||
## Summary | ||
|
||
- We ensured the hosted `testnet` server existed, then set it as the default. | ||
- We added an `identity` to bind with our hosted `testnet` server, ensuring it contained both a Nickname and Email. | ||
- We then logged in the web dashboard via an email `one-time password (OTP)` and were then able to view our published apps. | ||
- With SpacetimeDB Cloud, you benefit from automatic scaling, robust security, and the convenience of not having to manage the hosting environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Deploying Overview | ||
|
||
SpacetimeDB supports both hosted and self-hosted publishing in multiple ways. Below, we will: | ||
|
||
1. Generally introduce Identities. | ||
1. Generally introduce Servers. | ||
1Choose to proceed with either a [Hosted](/docs/deploying/hosted.md) or [Self-Hosted](/docs/deploying/self-hosted.md) deployment. | ||
|
||
💡 This tutorial assumes that you have already [installed](/install) the SpacetimeDB CLI. | ||
|
||
## About Identities | ||
|
||
An `Identity` is a hash attached to a `Nickname` and `Email`, allowing you to manage your app (such as `Publishing` your app). | ||
|
||
Each `Identity` is bound to one, single `Server`: Unlike GitHub, for example, you would require one identity per server. | ||
|
||
By default, there are no identities created. While the next tutorial will go more in-depth, you may create a new one via CLI: | ||
```bash | ||
spacetime identity new --name {Nickname} --email {Email} | ||
``` | ||
|
||
See the [API reference](/docs/http/identity.md) or CLI help (below) for further managing `Identities`: | ||
```bash | ||
spacetime identity --help | ||
``` | ||
|
||
## About Servers | ||
|
||
You `publish` your app to a target `Server` database: While we recommend to **host** your SpacetimeDB app with us for simplicity and scalability, you may also **self-host** (such as locally). | ||
|
||
By default, there are already two default servers added ([testnet](/docs/deploying/hosted.md) and [local](/docs/deploying/self-hosted.md)). While the next tutorial will go more in-depth, you may list your servers via CLI: | ||
```bash | ||
spacetime server list | ||
``` | ||
|
||
See the [API reference](/docs/http/database.md) or CLI help (below) for further managing `Servers`: | ||
```bash | ||
spacetime server --help | ||
``` | ||
|
||
--- | ||
|
||
## Deploying via CLI | ||
|
||
Choose a server for your hosting tutorial path to set a server as default, create an identity, and deploy (`publish`) your app: | ||
|
||
1. [testnet](/docs/deploying/hosted.md) (hosted) | ||
2. [local](/docs/deploying/self-hosted.md) (self-hosted) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Deploying - Self-Hosted | ||
|
||
This tutorial assumes that you have already [installed](/install) the SpacetimeDB CLI. Via CLI, we will then: | ||
|
||
1. Ensure our localhost server named `local` exists as the default. | ||
1. Start our localhost server in a separate terminal window. | ||
1. Create an `Identity` with at least a Nickname. | ||
1. `Publish` your app. | ||
|
||
💡 This tutorial assumes that you have already [installed](/install) the SpacetimeDB CLI and that you already have `local` server added (exists by default). If you accidentally removed `local`, add it back via CLI with the `--no-fingerprint` flag (since our server is not yet running): | ||
|
||
```bash | ||
spacetime server add "http://127.0.0.1:3000" local --no-fingerprint | ||
``` | ||
|
||
## Set the Server Default | ||
|
||
To make CLI commands easier so that we don't need to keep specifying `local` as the target server, let's set it as default: | ||
|
||
```bash | ||
spacetime server set-default local | ||
``` | ||
|
||
## Start the Local Server | ||
|
||
In a **separate** terminal window, start the local listen server in the foreground: | ||
```bash | ||
spacetime start | ||
``` | ||
|
||
## Creating an Identity | ||
|
||
By default, there are no identities created. Let's create a new one via CLI: | ||
```bash | ||
spacetime identity new --name {Nickname} | ||
``` | ||
|
||
💡We could optionally add `--email {Email}` to the above command, but is currently unnecessary for local deployment since there's no web dashboard. If you already created an identity but forgot to attach a Nickname, add it via CLI to easier identify your modules: | ||
```bash | ||
spacetime identity set-name {Nickname} | ||
``` | ||
|
||
## Create and Publish a Module | ||
|
||
Let's create a vanilla Rust module called `HelloSpacetimeBD` from our home dir, then publish it "as-is". For Windows users, use `PowerShell`: | ||
|
||
```bash | ||
cd ~ | ||
spacetime init --lang rust HelloSpacetimeDB | ||
cd HelloSpacetimeDB | ||
spacetime publish HelloSpacetimeDB | ||
``` | ||
|
||
--- | ||
|
||
## Summary | ||
|
||
- We ensured the self-hosted `local` server existed, then set it as the default. | ||
- We then opened a separate terminal to run the self-hosted `local` server in the foreground. | ||
- We added an `identity` to bind with our self-hosted `local` server set to default, ensuring it contained a Nickname. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters