--- /dev/null
+# Nova documentation
\ No newline at end of file
--- /dev/null
+# Common packages
+
+Nova exposes common packages for all the different projects in the mono-repo.
+Since Nova uses two different languages, it has two different common libraries,
+one built in rust in [the common/rust](../common/rust) directory and one in Go
+in [the common/](../common) directory.
\ No newline at end of file
--- /dev/null
+# Webhook
+
+> TD;TR The webhook component is an implementation of the discord interaction webhooks; You can either use the Gateway or the Webhooks. The webhooks __require__ an external https endpoint to work.
+
+The webhook source code is located in the [webhook](../../webhook) folder and is implemented in Rust. It's a simple http web server which implements the webhook signature verification and deserialization. Like the gateway, the messages are redirected using the [relaying system](../common#relaying_trait).
+
+The signature verification is done using libsodium via the libsodium-sys trait.
+Subsequently, it uses code marked as "unsafe" in rust. It's built into the binary statically. Any route can be used to receive webhook messages.
\ No newline at end of file
--- /dev/null
+# Workspace/System structure
+
+## System structure
+
+In the nova repository, two different types of projects exist,
+
+* The management projects primarly in Go \
+ They manage the other components of the nova infrastructure.
+* The data-path projects \
+ They handle all the data transfer / management.
+
+### Gateway
+
+> The gateway interfaces with the discord gateway to retrive events in real time
+It's implemented in rust and is in the gateway folder.
\ No newline at end of file
# Theses credentials are public anyways
client_id: 738817757650485300
public_key: "475bed67e20fb1e2d9b9007607f08d7b25b5a0aa936ef2d4ddaf7d592c993860"
+
+gateway:
+ relaying:
+ relay_instances: 0
+ clustering:
+ cluster_size: 1 # The total number of clusters
+ cluster_id: 0 # Current cluster id
+ shard_count: 1 # 10 shards by cluster
+ discord:
+ token: "token"
+ large_threshold: 100
+ intents: 16384
+
+webhook:
+ server:
+ address: 0.0.0.0
+ port: 8000
+ discord:
+ client_id: 738817757650485300
+ public_key: "475bed67e20fb1e2d9b9007607f08d7b25b5a0aa936ef2d4ddaf7d592c993860"
image: "ghcr.io/discordnova/nova/gateway@sha256:3432794af8d6f910b06bf8502bc92e5ecca3d6f4c0ec302ca77df03c6a94b014"
environment:
- DISCORD_TOKEN="<your discord token>"
- - RUST_LOG=info
\ No newline at end of file
+ - RUST_LOG=debug
\ No newline at end of file
clustering:
cluster_size: 1 # The total number of clusters
cluster_id: 0 # Current cluster id
- shard_count: 10 # 10 shards by cluster
+ shard_count: 1 # 10 shards by cluster
discord:
token: "token"
large_threshold: 100
- intents: 0
\ No newline at end of file
+ intents: 16384
\ No newline at end of file
--- /dev/null
+version: "3.3"
+
+services:
+ cluster1:
+ image: ghcr.io/discordnova/nova/gateway@sha256:e37764f61b76617200cc4444dd9e50e76e8ecd9c0a9d411779731fd80a986260
+ environment:
+ - NOVA_gateway_LOG=debug
+ restart: always
+ volumes:
+ - ./config/default.yaml:/app/gateway/gateway.runfiles/nova/config/default.yaml
}),
}));
}
- let tasks = self.gateway_connexions.into_iter().map(|item| Box::pin(item.start()));
- select_all(tasks).await;
-
- info!("one shard crashed, we need a restart");
+ let tasks = self.gateway_connexions.into_iter().map(|item| {
+ Box::pin(item.start())
+ });
+ let task = select_all(tasks).await;
+ info!("one shard crashed, we need a restart {:?}", task.0);
}
}
\ No newline at end of file
var (\r
InitializeCommand = &cobra.Command{\r
Use: "init",\r
- Short: "Initialize a newnova based project",\r
+ Short: "Initialize a new nova based project",\r
Run: initNovaRepo,\r
}\r
)\r
package lib_test\r
\r
import (\r
- "github.com/discordnova/nova/novactl/lib"\r
"testing"\r
+\r
+ "github.com/discordnova/nova/novactl/lib"\r
)\r
\r
func TestVersion(t *testing.T) {\r
- if lib.VERSION != "0.0.1" {\r
+ if lib.VERSION != "0.0.1" {\r
t.Fatalf("Version number do not match %s", lib.VERSION)\r
}\r
-}
\ No newline at end of file
+}\r
client_id: 738817757650485300\r
public_key: "475bed67e20fb1e2d9b9007607f08d7b25b5a0aa936ef2d4ddaf7d592c993860"\r
\r
-gateway:\r
- truc_machin: "aaaaaaaa"\r