dReams

所属分类:加密解密
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2023-08-31 00:15:30
上 传 者sh-1993
说明:  在Dero的去中心化应用程序平台上与各种不同的产品和服务交互。,
(Interact with a variety of different products and services on Dero s decentralized application platform.,)

文件列表:
CHANGELOG.md (2017, 2023-12-24)
LICENSE (1068, 2023-12-24)
bundle/ (0, 2023-12-24)
bundle/bundled.go (28112033, 2023-12-24)
bundle/fonts/ (0, 2023-12-24)
bundle/fonts/Ubuntu-R.ttf (353824, 2023-12-24)
bundle/fonts/VarelaRound-Regular.ttf (125956, 2023-12-24)
bundle/icons.go (543, 2023-12-24)
bundle/theme.go (6057, 2023-12-24)
cmd/ (0, 2023-12-24)
cmd/NFA/ (0, 2023-12-24)
cmd/NFA/main.go (6093, 2023-12-24)
cmd/dReams/ (0, 2023-12-24)
cmd/dReams/functions.go (21281, 2023-12-24)
cmd/dReams/layout.go (22982, 2023-12-24)
cmd/dReams/main.go (2336, 2023-12-24)
dreams.go (7702, 2023-12-24)
dwidget/ (0, 2023-12-24)
dwidget/dentries.go (7744, 2023-12-24)
dwidget/dlabels.go (1591, 2023-12-24)
dwidget/dlists.go (1653, 2023-12-24)
gnomes/ (0, 2023-12-24)
gnomes/boltdb.go (2958, 2023-12-24)
gnomes/gnomes.go (12881, 2023-12-24)
gnomes/gnomon.go (8463, 2023-12-24)
gnomes/tooltip.go (1675, 2023-12-24)
go.mod (3945, 2023-12-24)
go.sum (85597, 2023-12-24)
menu/ (0, 2023-12-24)
menu/ART-NFA-MS1.bas (13184, 2023-12-24)
menu/ASSETS.md (8167, 2023-12-24)
menu/assets.go (25176, 2023-12-24)
menu/g45s.go (3120, 2023-12-24)
... ...

# dReams Interact with a variety of different products and services on [Dero's](https://dero.io) decentralized application platform. ![dReamsFooter](https://raw.githubusercontent.com/SixofClubsss/dreamdappsite/main/assets/dReamerUp.png) 1. [Project](#project) 2. [dApps](#dapps) 3. [Features](#features) 4. [Build](#build) 5. [Packages](#packages) - [rpc](#rpc) - [menu](#menu) - [dwidget](#dwidget) - [bundle](#bundle) 6. [Donations](#donations) 7. [Licensing](#licensing) ### Project dReams is a open source platform application that houses multiple *desktop* dApps and utilities built on Dero. dReams has two facets to its use. ![goMod](https://img.shields.io/github/go-mod/go-version/dReam-dApps/dReams.svg)![goReport](https://goreportcard.com/badge/github.com/dReam-dApps/dReams)[![goDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/dReam-dApps/dReams) As a application > With a wide array of features from games to blockchain services, dReams is a point of entry into the privacy preserving world of Dero. As a repository > dReams serves as a source for building Dero applications. Written in [Go](https://go.dev/) and using the [Fyne toolkit](https://fyne.io/), the dReams repository is constructed into packages with function imports for many different Dero necessities. Download the latest [release](https://github.com/dReam-dApps/dReams/releases) or [build from source](#build) to use dReams. ![windowsOS](https://raw.githubusercontent.com/SixofClubsss/dreamdappsite/main/assets/os-windows-green.svg)![macOS](https://raw.githubusercontent.com/SixofClubsss/dreamdappsite/main/assets/os-macOS-green.svg)![linuxOS](https://raw.githubusercontent.com/SixofClubsss/dreamdappsite/main/assets/os-linux-green.svg) dReams [Template](https://github.com/dReam-dApps/Template) can be used to help create new Dero dApps. ### dApps All dApps are ran on chain in a decentralized manner. dReams and packages are solely interfaces to interact with these on chain services. With the main dReams application, users can access the dApps below from one place. - **[Holdero](https://github.com/SixofClubsss/Holdero)** - Multiplayer Texas Hold'em style poker - In game assets - Deployable contracts - Multiple tokens supported - dReam Tools - **[Baccarat](https://github.com/SixofClubsss/Baccarat)** - Single player table game - In game assets - Multiple tokens supported - **[dSports and dPrediction](https://github.com/SixofClubsss/dPrediction)** - P2P betting and predictions - Deployable contracts - dService - **[Iluma](https://github.com/SixofClubsss/Iluma)** - Tarot readings - Custom cards and artwork by Kalina Lux - Querent's companion - **[DerBnb](https://github.com/SixofClubsss/derbnbDesktop)** - Property rental management app - Mint property tokens - Manage rentals and bookings with Dero private messaging - DerBnb profit share - TRVL tokens - **[NFA Marketplace](https://github.com/civilware/artificer-nfa-standard)** - View and manage owned assets - View and manage listings - Search NFAs - Mint NFAs - **More dApps to come...** ### Features - [Gnomon](https://github.com/civilware/gnomon) with UI controls - Create customs Gnomon indexes - Gnomon header controls - Send Dero messages - Send Dero assets - Deployable contract rating system - Dynamic app updates from on chain data - Import only the dApps and collections you want to use - Shared config files for platform wide use ### Build - Install latest [Go version](https://go.dev/doc/install) - Install [Fyne](https://developer.fyne.io/started/) dependencies. - Clone repo and build with: ``` git clone https://github.com/dReam-dApps/dReams.git cd dReams cd cmd/dReams go build . ./dReams ``` ## Packages dReams repo is built as packages. With imports from the Dero code base, dReams variable structures are complete with the basics needs for building Dero applications that can run alone, or ones that could be integrated into dReams. dReams [Template](https://github.com/dReam-dApps/Template) can be used as a UI starting point and you can view our [Examples](https://github.com/dReam-dApps/Examples) repo for further references. ### rpc The rpc package contains all of the basic functionality needed to set up clients, check connectivity and read blockchain and wallet information. There are arbitrary rpc calls which any dApp can make use of such as the NFA calls, `SendMessage()` or `SendAsset()` with optional payload. This example checks for daemon and wallet rpc connectivity. ``` package main import ( "log" "os" "os/signal" "syscall" "time" "github.com/dReam-dApps/dReams/rpc" ) // dReams rpc connection example // Name my app const app_tag = "My_app" func main() { // Initialize rpc addresses to rpc.Daemon and rpc.Wallet vars rpc.Daemon.Rpc = "127.0.0.1:10102" rpc.Wallet.Rpc = "127.0.0.1:10103" // Initialize rpc.Wallet.UserPass for rpc user:pass // Check for daemon connection rpc.Ping() // Check for wallet connection and get address rpc.GetAddress(app_tag) // Exit with ctrl-C var exit bool c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c log.Printf("[%s] Closing\n", app_tag) exit = true }() // Loop will check for daemon and wallet connection and // print wallet height and balance. It will keep // running while daemon and wallet are connected or until exit for !exit && rpc.IsReady() { rpc.Wallet.GetBalance() rpc.GetWalletHeight(app_tag) log.Printf("[%s] Height: %d Dero Balance: %s\n", app_tag, rpc.Wallet.Height, rpc.FromAtomic(rpc.Wallet.Balance, 5)) time.Sleep(3 * time.Second) rpc.Ping() rpc.EchoWallet(app_tag) } log.Printf("[%s] Not connected\n", app_tag) } ``` ### menu The menu package contains the base components used for Gnomon indexing. `StartGnomon()` allows apps to run a instance of Gnomon with search filter and pass optional func for any custom index requirements. NFA related items such as the dReams NFA marketplace and asset controls can be independently imported for use in other dApps, it can be used with or without dReams filters. There are menu panels and custom Dero indicators that can be imported. This example starts Gnomon with NFA search filter. ``` package main import ( "os" "os/signal" "syscall" "time" "github.com/civilware/Gnomon/structures" "github.com/dReam-dApps/dReams/menu" "github.com/dReam-dApps/dReams/rpc" "github.com/sirupsen/logrus" ) // dReams menu StartGnomon() example // Name my app const app_tag = "My_app" // Log output var logger = structures.Logger.WithFields(logrus.Fields{}) func main() { // Initialize Gnomon fast sync menu.Gnomes.Fast = true // Initialize rpc address to rpc.Daemon var rpc.Daemon.Rpc = "127.0.0.1:10102" // Initialize logger to Stdout menu.InitLogrusLog(logrus.InfoLevel) rpc.Ping() // Check for daemon connection, if daemon is not connected we won't start Gnomon if rpc.Daemon.Connect { // Initialize NFA search filter and start Gnomon filter := []string{menu.NFA_SEARCH_FILTER} menu.StartGnomon(app_tag, "boltdb", filter, 0, 0, nil) // Exit with ctrl-C var exit bool c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c exit = true }() // Gnomon will continue to run if daemon is connected for !exit && rpc.Daemon.Connect { contracts := menu.Gnomes.GetAllOwnersAndSCIDs() logger.Printf("[%s] Index contains %d contracts\n", app_tag, len(contracts)) time.Sleep(3 * time.Second) rpc.Ping() } // Stop Gnomon menu.Gnomes.Stop(app_tag) } logger.Printf("[%s] Done\n", app_tag) } ``` ### dwidget The dwidget package is a extension to fyne widgets that intends to make creating dApps simpler and quicker with widgets specified for use with Dero. Numerical entries have prefix, increment and decimal control and pre-configured connection boxes can be used that are tied into dReams rpc vars and have default Dero connection addresses populated. There is objects for shutdown control as well as a spot for the dReams indicators, or new ones. This example starts a Fyne gui app using `VerticalEntries()` to start Gnomon when connected. ``` package main import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/app" "github.com/dReam-dApps/dReams/dwidget" "github.com/dReam-dApps/dReams/menu" "github.com/dReam-dApps/dReams/rpc" "github.com/sirupsen/logrus" ) // dReams dwidget NewVerticalEntries() example // Name my app const app_tag = "My_app" func main() { // Initialize Gnomon fast sync menu.Gnomes.Fast = true // Initialize logger to Stdout menu.InitLogrusLog(logrus.InfoLevel) // Initialize fyne app a := app.New() // Initialize fyne window with size w := a.NewWindow(app_tag) w.Resize(fyne.NewSize(300, 100)) w.SetMaster() // When window closes, stop Gnomon if running w.SetCloseIntercept(func() { if menu.Gnomes.Init { menu.Gnomes.Stop(app_tag) } w.Close() }) // Initialize dwidget connection box connect_box := dwidget.NewVerticalEntries(app_tag, 1) // When connection button is pressed we will connect to wallet rpc, // and start Gnomon with NFA search filter if it is not running connect_box.Button.OnTapped = func() { rpc.GetAddress(app_tag) rpc.Ping() if rpc.Daemon.Connect && !menu.Gnomes.IsInitialized() && !menu.Gnomes.Start { go menu.StartGnomon(app_tag, "boltdb", []string{menu.NFA_SEARCH_FILTER}, 0, 0, nil) } } // Place connection box and start app w.SetContent(connect_box.Container) w.ShowAndRun() } ``` ### bundle The bundle package contains all dReams resources. Images, gifs and fonts can be imported as well as the two Dero styled base app themes for Fyne. This example starts a Fyne gui app with various widgets to show case both Dero themes and image imports from bundle. ``` package main import ( "image/color" "fyne.io/fyne/v2" "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/widget" "github.com/dReam-dApps/dReams/bundle" "github.com/dReam-dApps/dReams/dwidget" ) // Name my app const app_tag = "My_app" func main() { // Initialize app color to bundle var bundle.AppColor = color.Black // Initialize fyne app with Dero theme a := app.New() a.Settings().SetTheme(bundle.DeroTheme(bundle.AppColor)) // Initialize fyne window with size and icon from bundle package w := a.NewWindow(app_tag) w.SetIcon(bundle.ResourceBlueBadge3Png) w.Resize(fyne.NewSize(300, 100)) w.SetMaster() // Initialize fyne container and add some various widgets for viewing purposes cont := container.NewVBox() cont.Add(container.NewAdaptiveGrid(3, dwidget.NewCenterLabel("Label"), widget.NewEntry(), widget.NewButton("Button", nil))) cont.Add(container.NewAdaptiveGrid(3, widget.NewLabel("Label"), widget.NewCheck("Check", nil), widget.NewButton("Button", nil))) cont.Add(widget.NewPasswordEntry()) cont.Add(widget.NewSlider(0, 100)) // Widget to change theme change_theme := widget.NewRadioGroup([]string{"Dark", "Light"}, func(s string) { switch s { case "Dark": bundle.AppColor = color.Black case "Light": bundle.AppColor = color.White default: } a.Settings().SetTheme(bundle.DeroTheme(bundle.AppColor)) }) change_theme.Horizontal = true cont.Add(container.NewCenter(change_theme)) // Add a image from bundle package gnomon_img := canvas.NewImageFromResource(bundle.ResourceGnomonIconPng) gnomon_img.SetMinSize(fyne.NewSize(45, 45)) cont.Add(container.NewCenter(gnomon_img)) // Adding last widget select_entry := widget.NewSelect([]string{"Choice 1", "Choice 2", "Choice 3"}, nil) cont.Add(select_entry) // Place widget container and start app w.SetContent(cont) w.ShowAndRun() } ``` ## Donations - **Dero Address**: dero1qyr8yjnu6cl2c5yqkls0hmxe6rry77kn24nmc5fje6hm9jltyvdd5qq4hn5pn ![DeroDonations](https://raw.githubusercontent.com/SixofClubsss/dreamdappsite/main/assets/DeroDonations.jpg) --- ### Licensing dReams platform and packages are free and open source. The source code is published under the [MIT](https://github.com/dReam-dApps/dReams/blob/main/LICENSE) License. Copyright 2023 dReam dApps

近期下载者

相关文件


收藏者