Skip to content

Commit

Permalink
add README and Nix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
steinerkelvin committed Jan 3, 2025
1 parent 428070d commit f3daf72
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 0 deletions.
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

0 comments on commit f3daf72

Please sign in to comment.