-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
428070d
commit f3daf72
Showing
2 changed files
with
125 additions
and
0 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,79 @@ | ||
# Torus Network Node | ||
|
||
Torus is a self-assembling and evolving peer-to-peer blockchain organism, with a | ||
stake-driven network built in Rust with the Substrate framework. Torus powers an | ||
innovative ecosystem of agents and incentives, incorporating diverse | ||
technologies into its collective body. | ||
|
||
## Quick start | ||
|
||
TODO | ||
|
||
## Building from source | ||
|
||
### Dependencies | ||
|
||
The recommended way to install dependencies is [using Nix](docs/nix.md). | ||
|
||
If you don't want to use Nix, you should have the following dependencies: | ||
|
||
- [Rust](https://www.rust-lang.org/) | ||
- [protoc](https://github.com/protocolbuffers/protobuf) | ||
|
||
You can install Rust using [Rustup]: | ||
|
||
```sh | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
``` | ||
|
||
Then install `protoc`: | ||
|
||
```sh | ||
# on Ubuntu | ||
sudo apt install protobuf-compiler | ||
``` | ||
|
||
<!-- | ||
# on Arch | ||
sudo pacman -S protobuf | ||
# on macOS | ||
brew install protobuf | ||
--> | ||
|
||
[Rustup]: https://rustup.rs/ | ||
|
||
## Building and running the node | ||
|
||
```sh | ||
cargo build -p torus-node --release | ||
``` | ||
|
||
To run a node connected to the Torus testnet: | ||
|
||
```sh | ||
cargo run --bin torus-node --release -- --chain data/testnet/spec.json | ||
``` | ||
|
||
## Docker | ||
|
||
TODO | ||
|
||
## Development | ||
|
||
Check your code with: | ||
|
||
```sh | ||
cargo clippy | ||
``` | ||
|
||
Run all tests with: | ||
|
||
```sh | ||
cargo test | ||
``` | ||
|
||
Running a local dev node: | ||
|
||
```sh | ||
cargo xtask run local --alice | ||
``` |
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,46 @@ | ||
# Build and development with Nix | ||
|
||
The recommended way to install dependencies on the Torus Node project is using | ||
[Nix] and [direnv]. | ||
|
||
You can install Nix with the [Determinate Nix Installer]: | ||
|
||
```sh | ||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install | ||
``` | ||
|
||
## With direnv | ||
|
||
You can then install and use [direnv] to automatically load the environment: | ||
|
||
- Install direnv: | ||
|
||
```sh | ||
nix profile install nixpkgs#direnv | ||
``` | ||
|
||
- Add to your `~/.zshrc` and reload your shell if you're using zsh: | ||
|
||
```sh | ||
eval "$(direnv hook zsh)" | ||
``` | ||
|
||
- For bash, add to your `~/.bashrc`: | ||
|
||
```sh | ||
eval "$(direnv hook bash)" | ||
``` | ||
|
||
- Run `direnv allow` inside the project directory to enable it. | ||
|
||
### Without direnv | ||
|
||
You can also manually load the environment: | ||
|
||
```sh | ||
nix develop | ||
``` | ||
|
||
[Nix]: https://nixos.org/ | ||
[direnv]: https://direnv.net/ | ||
[Determinate Nix Installer]: https://github.com/DeterminateSystems/nix-installer |