All Projects → redsolver → skynet

redsolver / skynet

Licence: MIT license
Use Sia Skynet and SkyDB in your Dart and Flutter projects (Decentralized CDN and database)

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to skynet

Skynet3d
Skynet3d
Stars: ✭ 62 (+148%)
Mutual labels:  skynet
UnitySkynetMultiPlayerGame
skynet server, unity client, state sync multiplaye game
Stars: ✭ 23 (-8%)
Mutual labels:  skynet
coctohug
Coctohug - Manage dozens of chia forks mining from a web browser! Nice localization with support of dozens of languages. Runs on Linux, Windows, MacOS, and more...
Stars: ✭ 36 (+44%)
Mutual labels:  skynet
SkyGallery
Create galleries by uploading images and videos. Powered by Sia Skynet.
Stars: ✭ 23 (-8%)
Mutual labels:  skynet
SparkServer
SparkServer是一个参照skynet设计的C#服务端框架,能够无缝整合到skynet集群机制中,也能自行组网,构建只有SparkServer节点的集群
Stars: ✭ 184 (+636%)
Mutual labels:  skynet
ZNet
基于libuv的skynet移植
Stars: ✭ 35 (+40%)
Mutual labels:  skynet
skynet pbc
skyne use pbc protobuf
Stars: ✭ 44 (+76%)
Mutual labels:  skynet
skynet-lua-websocket
Add a lua websocket library for the skynet game server framework.
Stars: ✭ 23 (-8%)
Mutual labels:  skynet
freeioe
FreeIOE is a framework for building IOE (Internet Of Everything) edge-computing gateway 开源的边缘计算网关框架. 讨论群: 291292378
Stars: ✭ 77 (+208%)
Mutual labels:  skynet
skynet-cocos-creator
skynet cocoscreator puremvc
Stars: ✭ 44 (+76%)
Mutual labels:  skynet

Skynet SDK for Dart

Use Sia Skynet and SkyDB in your Dart and Flutter projects (Decentralized CDN and database)

This package allows you to use the decentralized SkyDB (https://blog.sia.tech/skydb-a-mutable-database-for-the-decentralized-web-7170beeaa985) and upload files to Skynet.

It also supports Dart-to-JS bindings for MySky and popular DACs (Profile DAC, Feed DAC and Social DAC).

Breaking changes in version 4.0.0

You now have to use the SkynetClient() instance for all operations. See the example below for details or contact me on Discord if you need help migrating your project.

Imports you need

import 'package:skynet/skynet.dart';

Fully supported on native and web.

  • Upload files or directories to Skynet
  • Use SkyDB and the registry directly
  • Resolve portal-independent links
  • Use the setJSON and getJSON MySky methods if you have the user's seed
  • Use the experimental WebSocket endpoint

import 'package:skynet/mysky.dart';

Only supported on web, requires importing skynet-js using a <script> tag.

  • Use all MySky methods

import 'package:skynet/dacs.dart';

Most read-only methods supported on native and web. All methods which write data require MySky and only work on web.

  • Profile DAC
  • Feed DAC
  • Social DAC

Install

dependencies:
  skynet:
    git: https://github.com/redsolver/skynet.git

Usage

import 'dart:convert';
import 'dart:typed_data';

import 'package:skynet/skynet.dart';
import 'package:convert/convert.dart';

void main() async {
  final skynetClient = SkynetClient('siasky.net');

  final user = SkynetUser.fromSeedAsync(
    hex.decode(
        '788dddf5232807611557a3dc0fa5f34012c2650526ba91d55411a2b04ba56164'),
  );
  await user.init();

  print(user.id); // Public User ID

  final datakey = 'my-awesome-datakey';

  try {
    final currentFile = await skynetClient.skydb.getFile(user, datakey);
    print(currentFile.asString);
  } catch (e) {
    // ! getFile throws an Exception if no data is found
  }

  final success = await skynetClient.skydb.setFile(
    user,
    datakey,
    SkyFile(
      content: Uint8List.fromList(
          utf8.encode('Hello, world!')), // The content you want to store
      filename: 'note.txt',
      type:
          'text/plain', // Content type (Other examples: application/json or image/png)
    ),
  );
  print(success); // Is true when the operation was successful

  final updatedFile = await skynetClient.skydb.getFile(user, datakey);
  print(updatedFile.asString);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].