Skip to content

Commit 30c780c

Browse files
committed
Initial Commit 🚀
0 parents  commit 30c780c

19 files changed

+879
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug/
4+
target/
5+
6+
# These are backup files generated by rustfmt
7+
**/*.rs.bk
8+
9+
# MSVC Windows builds of rustc generate these, which store debugging information
10+
*.pdb
11+
12+
**/node_modules/
13+
14+
.env
15+
*.tmp
16+
**/tmp/

Cargo.lock

Whitespace-only changes.

Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[workspace]
2+
3+
members = [
4+
5+
]

LICENSE

+674
Large diffs are not rendered by default.

README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Storage Hub
2+
3+
> [!IMPORTANT]
4+
> 🏗️ This repo is very much work in progress!
5+
6+
## Overview
7+
8+
StorageHub is a storage optimized parachain that is designed to work with other Polkadot & Kusama parachains. It focuses on storing data in an efficient and decentralized way, while allowing that storage to be accessed, used, and managed by other parachains. It will be possible for users to directly interact with the storage on the chain, but StorageHub also seeks to natively interoperate with existing parachains via XCM.
9+
10+
### Layout
11+
12+
This repo contains all aspects relating to StorageHub, including clients, the runtime, tools and test apparatus. It is organized:
13+
14+
```sh
15+
.
16+
├── biome.json
17+
├── bun.lockb
18+
├── Cargo.lock
19+
├── Cargo.toml <---- Rust Workspace definition
20+
├── client1 <---- Rust application project
21+
│   ├── Cargo.toml
22+
│   └── src
23+
│   └── main.rs
24+
├── client2
25+
│   ├── Cargo.toml
26+
│   └── src
27+
│   └── main.rs
28+
├── LICENSE
29+
├── package.json
30+
├── README.md
31+
├── runtime <---- Rust library project
32+
│   ├── Cargo.toml
33+
│   └── src
34+
│   └── lib.rs
35+
├── test <---- TypeScript module
36+
│   ├── end2end
37+
│   ├── integration
38+
│   ├── package.json
39+
│   ├── README.md
40+
│   ├── runtime
41+
│   │   └── sample.test.ts
42+
│   └── tsconfig.json
43+
└── tsconfig.json
44+
```
45+
46+
## Installation
47+
48+
## Usage
49+
50+
## Testing
51+
52+
Please see the testing[README.md](test/README.md) for a full description.
53+
54+
## Links

biome.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true
10+
}
11+
}
12+
}

bun.lockb

7.19 KB
Binary file not shown.

client1/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[workspace]
2+
3+
members = [
4+
5+
]

client1/src/main.rs

Whitespace-only changes.

client2/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[workspace]
2+
3+
members = [
4+
5+
]

client2/src/main.rs

Whitespace-only changes.

package.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "storagehub-mono-repo",
3+
"version": "0.1.0",
4+
"description": "Mono-repo for StorageHub",
5+
"main": "index.js",
6+
"private": true,
7+
"type": "module",
8+
"workspaces": ["test"],
9+
"scripts": {
10+
"fmt": "biome format .",
11+
"fmt:fix": "biome format . --write"
12+
},
13+
"keywords": [],
14+
"author": "",
15+
"license": "ISC",
16+
"dependencies": {
17+
"@types/bun": "1.0.8",
18+
"typescript": "5.4.2"
19+
},
20+
"devDependencies": {
21+
"@biomejs/biome": "1.6.1"
22+
}
23+
}

runtime/Cargo.toml

Whitespace-only changes.

runtime/src/lib.rs

Whitespace-only changes.

test/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# StorageHub Testing
2+
3+
## Types
4+
5+
### Runtime Tests
6+
7+
### Integration Tests
8+
9+
### End-To-End Tests
10+
11+
## Usage
12+
13+
### Pre-requisites
14+
15+
[Bun](https://bun.sh) is used in this project as the Javascript runtime to execute tests in. To install it you can follow the official instructions at: [https://bun.sh/docs/installation](https://bun.sh/docs/installation)
16+
17+
The quickest way is via their script: `curl -fsSL https://bun.sh/install | bash`
18+
19+
### Running Tests
20+
21+
```sh
22+
bun test
23+
```

test/package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@storagehub/test",
3+
"version": "0.1.0",
4+
"description": "Test package for storagehub",
5+
"main": "index.js",
6+
"type": "module",
7+
"scripts": {
8+
"test": "bun test"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@types/bun": "1.0.8",
15+
"typescript": "5.4.2"
16+
},
17+
"devDependencies": {
18+
"@biomejs/biome": "1.6.1"
19+
}
20+
}

test/runtime/sample.test.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { expect, test, describe } from "bun:test";
2+
3+
describe("Sample test suite", () => {
4+
test("2 + 2", () => {
5+
expect(2 + 2).toBe(4);
6+
});
7+
8+
test("truthy", () => {
9+
expect(1 === 1).toBeTrue;
10+
});
11+
});

test/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../tsconfig.json"
3+
}

tsconfig.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
"incremental": true,
4+
5+
// Enable latest features
6+
"lib": ["ESNext"],
7+
"target": "ESNext",
8+
"module": "ESNext",
9+
"moduleDetection": "force",
10+
"allowJs": true,
11+
12+
// Bundler mode
13+
"moduleResolution": "bundler",
14+
"allowImportingTsExtensions": true,
15+
"verbatimModuleSyntax": true,
16+
"noEmit": true,
17+
18+
// Best practices
19+
"strict": true,
20+
"skipLibCheck": true,
21+
"noFallthroughCasesInSwitch": true,
22+
23+
// Some stricter flags
24+
"noUnusedLocals": true,
25+
"noUnusedParameters": true,
26+
"noPropertyAccessFromIndexSignature": true
27+
}
28+
}

0 commit comments

Comments
 (0)