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

Restructure Codebase #171

Merged
merged 13 commits into from
Nov 1, 2024
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checks
name: Pallets Checks

on:
push:
Expand All @@ -12,32 +12,45 @@ env:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pallets
steps:
- uses: actions/checkout@v2
- name: Install & display rust toolchain
run: rustup show
- name: Build
run: cargo build --verbose

test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pallets
steps:
- uses: actions/checkout@v2
- name: Install & display rust toolchain
run: rustup show
- name: Run tests
run: cargo test --verbose

clippy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pallets
steps:
- uses: actions/checkout@v2
- name: Install & display rust toolchain
run: rustup show
- name: Run clippy
run: cargo clippy -- -D warnings

fmt:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pallets
steps:
- uses: actions/checkout@v2
- name: Install & display rust toolchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: Install deps
run: sudo apt -y install protobuf-compiler

- name: Change directory to pallets
run: cd ./pallets

- name: Install & display rust toolchain
run: rustup show

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="https://github.com/InvArch/Brand-Assets/blob/main/branding/png/brand_colored_text_white.png">
<img src="https://github.com/Abstracted-Labs/Brand-Assets/blob/main/branding/png/brand_colored_text_white.png">
</div>

<div align="Center">
Expand All @@ -10,7 +10,7 @@ Built using [Rust](https://github.com/rust-lang/rust) & the [Polkadot SDK](https
<br>
[![Substrate version](https://img.shields.io/badge/Substrate-v3.0.0-E6007A?logo=Parity%20Substrate)](https://github.com/paritytech/substrate/releases/tag/v3.0.0)
[![Medium](https://img.shields.io/badge/Medium-InvArch-E6007A?logo=medium)](https://invarch.medium.com/)
[![License](https://img.shields.io/github/license/InvArch/InvArch?color=E6007A)](https://github.com/InvArch/InvArch/blob/main/LICENSE)<br>
[![License](https://img.shields.io/github/license/InvArch/InvArch?color=E6007A)](https://github.com/Abstracted-Labs/InvArch/blob/main/LICENSE)<br>
</div>

<!-- TOC -->
Expand All @@ -36,7 +36,7 @@ people to collaborate, share ownership, & function as multichain organizations!<

## How to Contribute Code

Please send a [GitHub Pull Request to InvArch](https://github.com/InvArch/InvArch/pull/new/master) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)) & ensure all your commits are atomic (one feature per commit). Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:<br>
Please send a [GitHub Pull Request to InvArch](https://github.com/Abstracted-Labs/InvArch/pull/new) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)) & ensure all your commits are atomic (one feature per commit). Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:<br>

$ git commit -m "A summary of the commit."
>
Expand All @@ -54,5 +54,5 @@ If you haven't already, join the community in InvArch [Discord](https://discord.

### License

• [GPL](https://github.com/InvArch/InvArch/blob/main/LICENSE)<br>
• [GPL](https://github.com/Abstracted-Labs/InvArch/blob/main/LICENSE)<br>

18 changes: 9 additions & 9 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
FROM rust:buster as builder
RUN apt-get update --fix-missing
RUN apt-get install -y git && apt-get install -y curl && apt-get install -y build-essential && apt-get install -y clang && apt-get install -y jq && apt-get install -y cmake
RUN git clone -b main https://github.com/InvArch/InvArch-Node
RUN git clone -b main https://github.com/Abstracted-Labs/InvArch
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$PATH:$HOME/.cargo/bin" && \
cd InvArch-Node && \
cd InvArch && \
rustup toolchain install $(cat rust-toolchain.toml | grep -o -P '(?<=").*(?=")') && \
rustup default stable && \
rustup target add wasm32-unknown-unknown --toolchain $(cat rust-toolchain.toml | grep -o -P '(?<=").*(?=")') && \
cargo build --release

# ↑ Build Stage | Final Stage ↓
FROM docker.io/library/ubuntu:latest
COPY --from=builder /InvArch-Node/target/release/invarch-collator /usr/local/bin
COPY --from=builder /InvArch/target/release/invarch-collator /usr/local/bin
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs/
COPY --from=builder /InvArch-Node/node/res/tinker-spec-raw.json /data/tinker-spec-raw.json
COPY --from=builder /InvArch-Node/node/res/rococo.json /data/rococo.json
COPY --from=builder /InvArch/node/res/tinker-spec-raw.json /data/tinker-spec-raw.json
COPY --from=builder /InvArch/node/res/rococo.json /data/rococo.json


RUN useradd -m -u 1000 -U -s /bin/sh -d /invarch-collator invarch-collator && \
mkdir -p /invarch-collator/.local/share && \
chown -R invarch-collator:invarch-collator /data && \
ln -s /data /invarch-collator/.local/share/invarch-collator && \
rm -rf /usr/bin /usr/sbin
mkdir -p /invarch-collator/.local/share && \
chown -R invarch-collator:invarch-collator /data && \
ln -s /data /invarch-collator/.local/share/invarch-collator && \
rm -rf /usr/bin /usr/sbin

USER invarch-collator
EXPOSE 30333 9933 9944
Expand Down
18 changes: 9 additions & 9 deletions docs/collator-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can either install the InvArch node using a pre-built binary from GitHub, or

Download the pre-built binary to `/usr/local/bin` and give it the necessary permissions & ownership:
```shell
sudo wget -O /usr/local/bin/tinkernet-collator https://github.com/InvArch/InvArch-Node/releases/latest/download/invarch-collator
sudo wget -O /usr/local/bin/tinkernet-collator https://github.com/Abstracted-Labs/InvArch/releases/latest/download/invarch-collator
sudo chmod +x /usr/local/bin/tinkernet-collator
sudo chown tinkernet-collator:tinkernet-collator /usr/local/bin/tinkernet-collator
```
Expand All @@ -35,15 +35,15 @@ sudo apt -y install cmake git clang libclang-dev
Clone the repo:

```shell
git clone [email protected]:InvArch/InvArch-Node.git
git clone [email protected]:Abstracted-Labs/InvArch.git
```

Make sure you can see the "InvArch-Node" folder using `ls -la`. If not then you likely did something wrong.
Make sure you can see the "InvArch" folder using `ls -la`. If not then you likely did something wrong.

Enter the repo and check out the most recent tagged release of code (https://github.com/InvArch/InvArch-Node/releases)
Enter the repo and check out the most recent tagged release of code (https://github.com/Abstracted-Labs/InvArch/releases)

```shell
cd InvArch-Node
cd InvArch
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
```

Expand All @@ -54,7 +54,7 @@ cargo build --release --features tinkernet

Move the node executable to `usr/local/bin`, make it executable, and change ownership to our `tinkernet-collator` service user:
```shell
sudo mv ~/InvArch-Node/target/release/invarch-collator /usr/local/bin/tinkernet-collator
sudo mv ~/InvArch/target/release/invarch-collator /usr/local/bin/tinkernet-collator
sudo chmod +x /usr/local/bin/tinkernet-collator
sudo chown tinkernet-collator:tinkernet-collator /usr/local/bin/tinkernet-collator
```
Expand All @@ -66,7 +66,7 @@ Now that you've got a collator node executable at `/usr/local/bin/tinkernet-coll
Download the chainspec (`tinker-raw.json`), set up the `tinkernet` data directory, and give it the necessary ownership:
```shell
sudo mkdir /var/lib/tinkernet
sudo wget -O /var/lib/tinkernet/tinker-raw.json https://github.com/InvArch/InvArch-Node/releases/latest/download/tinker-raw.json
sudo wget -O /var/lib/tinkernet/tinker-raw.json https://github.com/Abstracted-Labs/InvArch/releases/latest/download/tinker-raw.json
sudo chown -R tinkernet-collator:tinkernet-collator /var/lib/tinkernet
```

Expand Down Expand Up @@ -214,9 +214,9 @@ As a collator node operator, you should also set up monitoring for your node, in
Once there are new releases, a quick process to update your node is:
```
sudo systemctl stop tinkernet-collator
sudo wget -O /var/lib/tinkernet/tinker-raw.json https://github.com/InvArch/InvArch-Node/releases/latest/download/tinker-raw.json
sudo wget -O /var/lib/tinkernet/tinker-raw.json https://github.com/Abstracted-Labs/InvArch/releases/latest/download/tinker-raw.json
sudo chown tinkernet-collator:tinkernet-collator /var/lib/tinkernet/tinker-raw.json
sudo wget -O /usr/local/bin/invarch-collator https://github.com/InvArch/InvArch-Node/releases/latest/download/invarch-collator
sudo wget -O /usr/local/bin/invarch-collator https://github.com/Abstracted-Labs/InvArch/releases/latest/download/invarch-collator
sudo chmod +x /usr/local/bin/invarch-collator
sudo chown tinkernet-collator:tinkernet-collator /usr/local/bin/invarch-collator
sudo systemctl start tinkernet-collator
Expand Down
112 changes: 56 additions & 56 deletions invarch/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading