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

add README #53

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
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
79 changes: 79 additions & 0 deletions README.md
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
```
46 changes: 46 additions & 0 deletions docs/nix.md
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