Skip to content

Commit

Permalink
Merge branch 'main' into feat/emission-proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
saiintbrisson authored Jan 3, 2025
2 parents 3c5c535 + a7f5201 commit 1ac1a37
Show file tree
Hide file tree
Showing 13 changed files with 5,338 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push Docker image

on:
push:
branches: [main, github-ci-test]
branches: [main, testnet, github-ci-test]
tags:
- "*"

Expand Down
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
```
23 changes: 23 additions & 0 deletions data/mainnet/aura.pub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
"5FAHNw7kdqkJotQ8yXF21iSmxhSzbwzJkVogrZH3MvypHy1D",
"5Gv1CAGk3aRWvZs5LdP9ta9kVm23dfYopaJyXTZMavQNwZbm",
"5G4JMqfNRJqpzuvXkbaxfhyX4MyeWgh7Tm1K88yNwnSRVyDY",
"5HGNHGa1CVgDtYqcarFvtTS5foKyjqbM4NX5FYv1MLKkdKUG",
"5HnB7htLFzaMAbqgzE66EVgUmJCACVQ1tvZUdDyAAFD71Evq",
"5D5DFRxoSt27NJFEJpTvpyFMfZCf2jRvosKJ2QWQEQs6twnX",
"5EFmiWRcZVEFYj3k1w6rHjieP6yE9YFFPiHDAX5iXAFLhgXv",
"5CRwJKcr8pQ4CZ8wUrSDCGo2aFKqVXHFpsjHmbTERQNQbCQL",
"5DAgeVS3gsVUMUDASy3d5YPasbTQQU7gDkGijF8S3iKGdWjR",
"5G6hp8fP6E89R51cA4Dy8qgae3VsAYFBN4DGZDS2BMnhgRCc",
"5GZEpLT7CfVhJC2aYmULUSzXnCuzWg1VrZij2dQTAQrokm4g",
"5FADATJkVq4Tt6gcaqD5a9rVF6sx6Pc5C9WzRaZG71M4JszX",
"5FZ7dvAYCi5yLiDnFerKqSK3Mo8VNiheTXphrRhZ5m1z8rr1",
"5FRXa3cRPqsAVeNt3AZa2pywF3TEoh51d3fDCvwfgSzTHj8V",
"5EA27GYEXcsdRN9QqdDxEAB8soH8AkqLdWq34fuxwPwGy4hu",
"5CyuGBohZaiQf5rfMnbUjcVrbjATmjrx6ZEKBPP7aWFjx7mX",
"5DMMrzgJ9WnEJH35xivLQ9nuByTrZ3uXHwPQWg2BBXN914fH",
"5CcbfWfBNC5LwZaseEFrrraWkXc6ZLPBBe8PMowSDFmEsKss",
"5Di2kW4nTNkVjphyHjvB67YVaaCoxd5k6quXuAQeRQxwJ8Ad",
"5HVuVMnEPYMCKGuzPighADMzKgVm2swZTUPB1cLtLPSbpunZ",
"5CcaizfVSsdv5AJDqDrGvu1fb6ndNJpQ8RgXNGuCPYfYsVSG"
]
23 changes: 23 additions & 0 deletions data/mainnet/bootnodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
"/dns4/validator-0.nodes.torus.network/tcp/30333/p2p/12D3KooWMusxwQjbKYf4oXDciA7maVUWoBHw5im6dzi9vDj5M4QD",
"/dns4/validator-1.nodes.torus.network/tcp/30333/p2p/12D3KooWG2nfpHqsoRH5obvN9AtDYbwEQB9ruhFb7fU318VqRKWo",
"/dns4/validator-2.nodes.torus.network/tcp/30333/p2p/12D3KooWGGcQJ4Jk9J9uUVzUwwqVTa1m5vkWina8mRyNZKHpdfBG",
"/dns4/validator-3.nodes.torus.network/tcp/30333/p2p/12D3KooWKv797oXFbuWxv4zGJ3KFzpv3CJwGngXpZnFD5WcctsB4",
"/dns4/validator-4.nodes.torus.network/tcp/30333/p2p/12D3KooWPjuSYUJjroaWjLjExMmHukKGX6fQQjgu3dNavYFXudxE",
"/dns4/validator-5.nodes.torus.network/tcp/30333/p2p/12D3KooWBuydmvQtS8BCWKBnntA31r2Z3PiAiE3FNDX8NnSubFHQ",
"/dns4/validator-6.nodes.torus.network/tcp/30333/p2p/12D3KooWF5fnR9N325nTg9QoEGxvH3AqeonE38DAMDvPLsLXV4Vd",
"/dns4/validator-7.nodes.torus.network/tcp/30333/p2p/12D3KooWPkRzoDMRq3iGSkCbkfSLQEb6DUizQThsiJssjeeeTtey",
"/dns4/validator-8.nodes.torus.network/tcp/30333/p2p/12D3KooWLfxSBtAvkJUK4KYBSaVyhq6rtg4PVNvGC8xNE9a4Adnj",
"/dns4/validator-9.nodes.torus.network/tcp/30333/p2p/12D3KooWQmFzuMt3LWHo97E857yUWGfgcgzWuDEaQZ4aEvdjf1db",
"/dns4/validator-10.nodes.torus.network/tcp/30333/p2p/12D3KooWJt9jbAEDXwiSUs14fRUDxNbnmvo8iAiP354x6D8vFZRq",
"/dns4/validator-11.nodes.torus.network/tcp/30333/p2p/12D3KooWGrKbSLuxyPstp8xyyJdfi4pSMAYJPxX9Z3xzFCNrTrtW",
"/dns4/validator-12.nodes.torus.network/tcp/30333/p2p/12D3KooWGZhYejc8cDvJBFyU6PbKWigeZLRocs28AmJhtMB3JGDt",
"/dns4/validator-13.nodes.torus.network/tcp/30333/p2p/12D3KooWH9AvU5N8qEPHKwqd1QsnqoEZZLn9saEpuQeJpmbfrKMw",
"/dns4/validator-14.nodes.torus.network/tcp/30333/p2p/12D3KooWMoEV8Rg8sqY2yfAiwSxHyp7cajYZpiDoCbNCp4SeYeBA",
"/dns4/validator-15.nodes.torus.network/tcp/30333/p2p/12D3KooWRyfEqB9F8Xg2s2VPnPJ5PxQzZ4qjGvS72sShipZBqtUp",
"/dns4/validator-16.nodes.torus.network/tcp/30333/p2p/12D3KooWDqswAykVFcavDwnk7sepZDuKnr4QCis5SQ8yiCngxBbL",
"/dns4/validator-17.nodes.torus.network/tcp/30333/p2p/12D3KooWHb7J3sUTWJY7nUWmKA7GF4cy2FSjD9Qc6aGuP8WtWKct",
"/dns4/validator-18.nodes.torus.network/tcp/30333/p2p/12D3KooWGoGk99jsq6gBp9BsH5Gfuv5sbDzCxavG5rhQy2QQ2Q1U",
"/dns4/validator-19.nodes.torus.network/tcp/30333/p2p/12D3KooWMVdvhywxVp3k1WrX6FGqfLWTpuSa3HgLFpjC3QsNX1Cn",
"/dns4/validator-20.nodes.torus.network/tcp/30333/p2p/12D3KooWPuQ4BMgeqmoMJ8WKDsFiazWxWAtNsmnAnEAJqzMt9FVq"
]
86 changes: 86 additions & 0 deletions data/mainnet/gran.pub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
[
"5GMXEvALNWNDxTyEcoDje7BLWTDULLnMiDcgGNAAqARoorAQ",
1
],
[
"5C6F9jugYXyFrmAiVgwnnVdk61bo2Z1mHdvDPPPBUHJ945rU",
1
],
[
"5Ec72auaTFKnBfSjVJ2AzYJu1difirGrtuoK75J3NqkL7Se5",
1
],
[
"5CfqBtvZQZSU2hofUD3dCxka1kyXEZHmJFSqru9NXZJnfU15",
1
],
[
"5CbP8wXa2LDfaDwuyK4gJG3xn1MoVVRafogTC2uq9KwU8coC",
1
],
[
"5DbmvGs5STwgo4mkQSG46cbnY3WvQkpuJjmvq8sVKEwyjAXB",
1
],
[
"5G8wJKMug3FAF3Xmt79q1FkQ6vbkSyFBHBQCThJVexQF6U2t",
1
],
[
"5DgKEtseBx4ypcjLMTDZKyt1NvXWJuRXZXJVdZdyVA36iciA",
1
],
[
"5DDw6pdWf1r82jaY2m1Do8qw1e2rHTzTsLtz8fRGKHt7ja2L",
1
],
[
"5Fh8Reu8XyvimqPrQ5Mmf5kaR54WhhobRT9EhUjRNJ4ojMkE",
1
],
[
"5FEktJzcgo2wqbMfMYnHHxSvH9LuTcnzszkvE9ubdw3vqEDq",
1
],
[
"5DFf7EeCt6nDEhrvMQEZrByuHU1KGrZ5yo7bLobPiUHSMsvC",
1
],
[
"5GJx6hfASXLaYU9F9kJfh59QDRnMqWh982WuDbNuhcy5TmSD",
1
],
[
"5DLJczfZQo9zeUCCUekr1HxrtHz9uAGGvYh7j5jrQjyDUuK8",
1
],
[
"5FJQKLMBhYze3EhPidCgqMJ8frpPCQKW6sStToReASg3j3dZ",
1
],
[
"5FoirCgSYsa5eHcAAHrSMuJ1WDHZdz4WWdx4VqwY3cAfzHYv",
1
],
[
"5Dngmp9arbJ4Yjarfm5AoSKGVk6SSPrvGhiasLxppEhUdy4K",
1
],
[
"5GpGEtdru4eNKnKzCgNAZnHMmRWudEyEsGmJJeaib5Jr3F3U",
1
],
[
"5F9G2dhk18oSQyJJ34QXuqBdSHiF4ff4qKkbB4F4PvW2oX3d",
1
],
[
"5G9hFMqTb3YcZ8An46fLUrjReNx3p8pdTWatz8XPmPWutmyi",
1
],
[
"5Fen622mpK7xg9n4it3Hav4PBjZnFtg1Uc464rPDWGM8Lzsp",
1
]
]
2,530 changes: 2,530 additions & 0 deletions data/mainnet/spec.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions data/testnet/aura.pub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
"5HgqdQWjhW6DNAwFuR9QyXPT2X8sMcPbfkqhhDMcZTtzrg6G",
"5CZg4dpW13JvjMo61xEgrYDkVW4R9i4HYMpLEpaa9CMfHfmt",
"5Gut8yb1HHw4ro9BEH3o44XgVDgXkJTWRNxEp4a1bvGr9tws",
"5HKQ3mwPR7oppkb957YyTBRMR4iLVjF27mdPx7a9EkBBinFN"
]
6 changes: 6 additions & 0 deletions data/testnet/bootnodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
"/dns4/validator-0.nodes.testnet.torus.network/tcp/30333/p2p/12D3KooWMxgfPZQ7AmTnSKbPmBrQuJ9UXwsXP98g578MdJFy5cHm",
"/dns4/validator-1.nodes.testnet.torus.network/tcp/30333/p2p/12D3KooWRsZYrkFuGxTbZbEnH2A2KDT3dKAcx6EUBCTykEpvKvpN",
"/dns4/validator-2.nodes.testnet.torus.network/tcp/30333/p2p/12D3KooWP8PQjwAGPGtm6QRcwNhMuv4PDNHUKp8rD6gZfgdpAByx",
"/dns4/validator-3.nodes.testnet.torus.network/tcp/30333/p2p/12D3KooWKCdLiV4gapVCtbkTNxCboMR1Mg1YvjbM8ZNKDpxQRvPB"
]
18 changes: 18 additions & 0 deletions data/testnet/gran.pub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
[
"5CwLdPUxBiCUCVZ3w5dvhWztXEZ58ijXG7jD6F3QY8SfZwj1",
1
],
[
"5FuTB4GLFdxX2Ee8Wz69qA6M8GtHzxy6jGVLQoDJXTRKAv4o",
1
],
[
"5CUnFDtwqd2feHwqGuojjQX4z9eBnJqZBdWo1xY8b26rEUyN",
1
],
[
"5D2LyEr5wvkWrVAWrM3ThpipxPDDdN6deaweLjMKitrBH9BT",
1
]
]
2,484 changes: 2,484 additions & 0 deletions data/testnet/spec.json

Large diffs are not rendered by default.

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
12 changes: 11 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ gen-base-spec:
gen-spec-file env: gen-base-spec
mkdir -p tmp/spec

node_version=$(cargo run -p torus-node -- --version) \
node_version=$(cargo run -p torus-node --release -- --version) \
&& scripts/adjust-spec-file.py "{{env}}" "{{base_spec_path}}" \
--balances-file data/torus-genesis-balances.json \
--merge-balances \
--aura-list-file "data/{{env}}/aura.pub.json" \
--gran-list-file "data/{{env}}/gran.pub.json" \
--bootnodes-file "data/{{env}}/bootnodes.json" \
--name "Torus {{env}} $node_version" \
> "tmp/spec/{{env}}.json"

Expand All @@ -45,3 +48,10 @@ run-workflows:
-P 'ubuntu-24.04-16core-friedrich=ghcr.io/catthehacker/act-ubuntu:24.04' \
-P 'ubuntu-22.04-32core-karl=ghcr.io/catthehacker/ubuntu:act-22.04'

try-runtime-upgrade-testnet:
cargo build --release --features try-runtime
RUST_BACKTRACE=1 RUST_LOG=info try-runtime --runtime target/release/wbuild/torus-runtime/torus_runtime.compact.compressed.wasm on-runtime-upgrade --blocktime 8000 live --uri wss://api.testnet.torus.network

try-runtime-upgrade-mainnet:
cargo build --release --features try-runtime
RUST_BACKTRACE=1 RUST_LOG=info try-runtime --runtime target/release/wbuild/torus-runtime/torus_runtime.compact.compressed.wasm on-runtime-upgrade --blocktime 8000 live --uri wss://api.torus.network
Loading

0 comments on commit 1ac1a37

Please sign in to comment.