在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:DigixGlobal/dijix开源软件地址:https://github.com/DigixGlobal/dijix开源编程语言:JavaScript 100.0%开源软件介绍:DijixDigix's IPFS & JSON Immutable & eXtendable File FormatThis project aims to make IPFS objects easier to view by processing files and creating a standardised JSON schema that includes metadata about the file and allows clients to more efficiently render them. OverviewThe system is designed for use in the Digix Proof of Asset system (and other future projects) that leverages IPFS for immutable storage. Dijix allows for painless reading and uploading of this data in-browser. Dijix consists of:
The entire dijix suite (except for react components) is supported in the browser, node and via a command line interface. Dijix ObjectsDijix objects are JSON objects (uploaded to IPFS) with the following properties:
Dijix objects come with standard headers and a type-specific {
"type": "image",
"created": 1505208269402,
"schema": "0.0.1",
"data": {
"height": 250,
"width": 940,
"src": "QmPQkRRAryL8MHu8ERabQNVgHcsixnZDjzm3nuTW7Xq81n",
"size": 100789,
"mime": "image/jpeg",
"thumbnails": {
"64": "Qme4PHgc7Ecfddg268WYEBagsnc9skNntM9BKbqjzAkajU",
"256": "QmW4FkWdzRjAnJSnwHWSMxu4mL6rqo5AyfB4b4yUQ1PQ9i",
"512": "QmQSjeNksgWWK7Bvk9YtMomFZmVMNkGcwvEQNYqFmSdvFE"
},
"fileName": "banner.jpg"
},
"ipfsHash": "QmUdRPGRxtz3ww3mHZB6dd4qmbYvrFRbrUVKW5XApiWGKF"
} Dijix TypesMiddlewaresA middleware system will provide optional functionality when importing and/or reading dijix objects:
UsageNode & BrowserUploadimport Dijix from 'dijix';
import DijixImage from 'dijix-image';
import DijixPDF from 'dijix-pdf';
const dijix = new Dijix({
ipfsEndpoint: 'https://ipfs.infura.io:5001', // optional
httpEndpoint: 'https://ipfs.infura.io/ipfs', // optional
cache: true, // optional in-memory dijix object cache, defaults to true
concurrency: 10, // optional
requestTimeout: 1000, //optional
types: [
new DijixImage(),
new DijixPDF(),
],
});
await dijix.create('image', { src: '/some/image.jpg', ...config }); // outputs dijix object
await dijix.create('pdf', { src: '/some/pdf.pdf', ...config }); // outputs dijix object Fetch// This returns the document if found within `requestTimeout` milliseconds
// otherwise logs the error
await dijix.failSafeFetch(ipfsHash); For node and CLI, you'll need npm, node 8+ and cairo / libpng. See dijix-image for instructions. CLI
TestTo run node and browser tests:
LicenseBSD-3-Clause |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论