{"id":13786754,"url":"https://github.com/scryinfo/dp","last_synced_at":"2025-05-11T22:33:43.029Z","repository":{"id":39193539,"uuid":"161426307","full_name":"scryinfo/dp","owner":"scryinfo","description":"Scry Data Protocol","archived":false,"fork":false,"pushed_at":"2023-01-07T16:07:18.000Z","size":57448,"stargazers_count":81,"open_issues_count":67,"forks_count":36,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-17T12:50:42.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scryinfo.png","metadata":{"files":{"readme":"README-cn.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-12T03:14:22.000Z","updated_at":"2024-09-19T13:22:51.000Z","dependencies_parsed_at":"2023-02-07T15:00:28.616Z","dependency_job_id":null,"html_url":"https://github.com/scryinfo/dp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scryinfo%2Fdp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scryinfo%2Fdp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scryinfo%2Fdp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scryinfo%2Fdp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scryinfo","download_url":"https://codeload.github.com/scryinfo/dp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225105773,"owners_count":17421791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T19:01:33.912Z","updated_at":"2024-11-17T23:30:28.804Z","avatar_url":"https://github.com/scryinfo.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/scryinfo/dp?status.svg)](https://godoc.org/github.com/scryinfo/dp)\n[![Go Report Card](https://goreportcard.com/badge/github.com/scryinfo/dp)](https://goreportcard.com/report/github.com/scryinfo/dp)\n[![Build Status](https://travis-ci.org/scryinfo/dp.svg?branch=master)](https://travis-ci.org/scryinfo/dp)\n[![codecov](https://codecov.io/gh/scryinfo/dp/branch/master/graph/badge.svg)](https://codecov.io/gh/scryinfo/dp)\n\n[中文](./README-cn.md)  \n[EN](./README.md)  \n[한국어](./README-ko.md)  \n[日本語](./README-ja.md)  \n# 介绍\n通过区块链提供数据交换的SDK，让开发者可以快速方便的开发DAPP应用。主要包含这些内容：数据加解密、签名、智能合约、事件通知、数据存储接口、数据获取与查询、数字货币支付、第三方App支付接口等。过程如下：  \n数据提供者通过SDK写入数据及元数据（数据包含静态数据、动态数据，数据有约定的格式，元数据主要包含数据签名、数据描述等信息）；数据需求者通过SDK查找需要的数据，支付数字货币后，可以获得数据；数据验证者，通过向智能合约抵押一定的数字货币来成为验证者。在数据交换过程中，数据需求者可以向合约发起有偿数据验证请求或交易仲裁，验证者由智能合约随机选取。数据交换的所有参与者可以在参与的交易中相互评分；智能合约会记录参与者交易及评分信息，生成参与者的信誉评价，信誉评价信息可以通过SDK查询。\n# Windows\n##  编译\n###  编译环境\n\u003e 请自行安装下列环境（括号内为经过测试的推荐版本）：\n- go (1.12.5)\n- node.js (10.15.3)\n- gcc (mingw-w64 v8.1.0)\n### 打包UI资源文件：\n\u003e 我们假设你已经完成了node.js的下载与安装。\n\n执行dp/app/app/ui/tool目录下的**webpackUI.ps1**脚本文件完成这一步骤。\n### 构建app可执行文件：\n在dp/app/app/main目录下执行go build，成功执行后，会生成入口文件：**main.exe**。\n##  运行\n### 依赖\n- ipfs客户端 (0.4.14 / 0.4.20)\n- geth客户端 (1.9.19)\n- 浏览器 (chrome 79)\n### 连接ipfs：\n\u003e 我们假设你已经完成了ipfs的下载与安装。\n- 修改配置文件，在你的ipfs下载路径中，找到config文件。如下所示，为其一级配置项\"API\"添加下面三条\"Access...\"配置：  \n```json  \n\"API\": {\n  \"HTTPHeaders\": {\n    \"Server\": [\n      \"go-ipfs/0.4.14\"\n    ],\n    \"Access-Control-Allow-Origin\": [\n      \"*\"\n    ],\n    \"Access-Control-Allow-Credentials\": [\n      \"true\"\n    ],\n    \"Access-Control-Allow-Methods\": [\n      \"POST\"\n    ]\n  }\n},\n```\n- 在命令行执行 ipfs daemon 命令，执行成功时会显示\"Daemon is ready\"，保持命令行窗口开启。\n\u003e 因为app使用js进行ipfs上传，所以上面添加了\"允许ipfs跨域执行post请求\"的配置。\n### 搭建一条私链：\n\u003e 我们假设你已经完成了geth的下载与安装。\n\n执行dp/backend/contracts/geth_init目录下的**geth_init.ps1**脚本文件完成私链搭建。  \n执行相同目录下的**geth_acc_mine.ps1**脚本文件创建用户并开始挖矿。\n### 部署智能合约：\n执行dp/backend/contracts/tool目录下的**contract.ps1**脚本文件完成这一步骤。  \n脚本会将部分结果输出到上级目录的migrate.log文件，在文件末尾可以找到*ScryToken*、*ScryProtocol*两个\"0x\"开头的42个字符的地址。\n### 修改app配置文件：\n按照相应格式，修改位于dp/app/app/main目录下的**main.json**配置文件：  \n\n| key | value |\n|:------- |:------- |\nprotocolContractAddr | 修改为日志文件中找到的ScryProtocol地址\ntokenContractAddr | 修改为日志文件中找到的ScryToken地址\nuiResourcesDir | 修改为你的电脑上的dp项目路径\nmetaDataOutDir | 修改为你期望的原始数据文件下载路径\nproofsOutDir | 修改为你期望的证明文件和临时文件的下载路径  \n\n修改上面的配置即可保证主要流程正常执行，下附其他配置信息简要描述：  \n\n| key | value |  \n|:------- |:------- |  \nappId | 同一条链上，不同id的app,消息是不互通的\nethServiceAddr | 链地址\nkeyServiceAddr | 用户服务地址\nstorageServiceAddr | ipfs地址\nwsPort | app前后端之间的websocket连接使用的端口\ndbName | 数据库名\n\n### 体验\n完成上述所有步骤后，即可通过dp/app/app/main/main.exe入口文件进行体验。\n## 异常处理：\n- windows禁止ps1脚本执行：使用管理员权限，执行**Set-ExecutionPolicy unrestricted**命令。\n- npm install error，找不到python exec：安装python2或忽略该问题。\n- npm install error：node.js版本冲突，完全卸载node.js后重新安装即可解决该问题。\n- 用户服务启动失败，找不到vcruntime140.dll：[安装vcre](https://www.microsoft.com/zh-cn/download/details.aspx?id=48145)。\n- 智能合约部署失败，连接不到以太坊客户端：检查是否使用了自定义的端口搭建私链，修改contracts目录下的truffle.js配置文件network.geth.port与之一致。\n# [Code Style -- Go](https://github.com/scryinfo/scryg/blob/master/codestyle_go-cn.md)\n# [ScryInfo协议层SDK接口文档v0.0.5](https://github.com/scryinfo/dp/blob/master/document/ScryInfo%E5%8D%8F%E8%AE%AE%E5%B1%82SDK%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3v0.0.5.md)\n","funding_links":[],"categories":["软件包","Software Packages","Go 工具","Go Tools","Other Software"],"sub_categories":["其他软件库和软件包","Other Software","其他软件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscryinfo%2Fdp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscryinfo%2Fdp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscryinfo%2Fdp/lists"}