-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
3,697 additions
and
1,351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'dart:ffi'; | ||
import 'dart:io'; | ||
|
||
import 'package:s5_server/rust/bridge_generated.dart'; | ||
|
||
RustImpl initializeExternalLibrary(String path) { | ||
return RustImpl( | ||
Platform.isMacOS || Platform.isIOS | ||
? DynamicLibrary.executable() | ||
: DynamicLibrary.open(path), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,9 @@ port = 5522 | |
[http.api.delete] | ||
enabled = false | ||
|
||
[network.peers] | ||
[p2p.peers] | ||
initial = [ | ||
'tcp://[email protected]:43221', # uber.space | ||
'tcp://[email protected]:4444', # hetzner | ||
'tcp://z2DVYoNRUFknwbFPz74j6sz8dZ1LosYzQ8XjjSCNcGHajcC@168.119.116.125:4444', # test node | ||
'tcp://z2DVNifJx5XhjwQpecQMCZCguum2sAnJNNLfrQmRZt2zxiq@168.119.116.125:4444', # test node | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class User { | ||
final int id; | ||
final int createdAt; | ||
final String? email; | ||
int get tier => 1; | ||
|
||
User({ | ||
required this.id, | ||
required this.createdAt, | ||
required this.email, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,8 @@ | ||
const nodeVersion = '0.3.0'; | ||
// ! S5 node version | ||
const nodeVersion = '0.5.0'; | ||
|
||
const defaultChunkSize = 1024 * 1024; | ||
// ! default chunk size for hashes | ||
const defaultChunkSize = 256 * 1024; | ||
|
||
// These bytes are carefully selected to make the base58 and base32 representations of different CID types | ||
// easy to distinguish and not collide with anything on https://github.com/multiformats/multicodec | ||
const cidTypeRaw = 0x26; | ||
const cidTypeMetadataFile = 0x2d; | ||
const cidTypeMetadataDirectory = 0x59; | ||
const cidTypeResolver = 0x25; | ||
// const magicByteStoredFile = 0x8d; | ||
|
||
const registryS5MagicByte = 0x5a; | ||
const metadataMagicByte = 0x5f; | ||
|
||
// types for metadata files | ||
const metadataTypeFile = 0x01; | ||
const metadataTypeChunkedFile = 0x02; | ||
const metadataTypeDirectory = 0x03; | ||
|
||
const registryMaxDataSize = 48; | ||
|
||
// const mhashSha256 = [0x12, 0x20]; | ||
const mhashBlake3 = [0x1e, 0x20]; | ||
|
||
const mkeyEd25519 = 0xed; | ||
|
||
// Use this for protocol updates | ||
const protocolMethodHandshakeOpen = 1; | ||
const protocolMethodHandshakeDone = 2; | ||
|
||
const protocolMethodSignedMessage = 10; | ||
|
||
const protocolMethodHashQueryResponse = 5; | ||
const protocolMethodHashQuery = 4; | ||
|
||
const protocolMethodAnnouncePeers = 7; | ||
|
||
const protocolMethodRegistryUpdate = 12; | ||
const protocolMethodRegistryQuery = 13; |
Oops, something went wrong.