This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
310 lines (289 loc) · 17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="arc3ipfs is a simple example of implementing Algorand ASA Ops using JS SDK with IPFS and in compliance to ARC3">
<meta name="author" content="@emg110">
<title>ARC3-IPFS</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/reset.min.css">
<!-- Google Font -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
<!-- Matarial icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Font Awsome -->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"/>
<link rel="stylesheet" href="./css/style.css">
<!-- Gsap/ min -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.1/gsap.min.js"></script>
<!-- Gsap / Scroll to Plugin -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.1/ScrollToPlugin.min.js"></script>
<!-- jQuery CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/ScrollMagic.min.js"></script>
</head>
<body>
<script>
function fnMove(seq) {
var offset = $("#section" + seq).offset();
$('html, body').animate({
scrollTop: offset.top
}, 400);
}
setTimeout(()=>{
const toBottomEl = document.querySelector('#to-bottom');
toBottomEl.addEventListener('click', function () {
gsap.to(window, .7, {
scrollTo: 4000
});
});
},200)
</script>
<div class="site-wrapper">
<div class="arc3ipfs-section">
<div class="navbar">
<div class="content-wrapper nav">
<a href="" class="logo">
<div id="section1"></div>
<div class="arc3ipfs-logo">
ARC3::IPFS
</div>
</a>
<div class="nav-link-wrapper">
<ul class="menu">
<li>
<a href="https://github.com/emg110/arc3-ipfs" target="_blank" class="nav-link"><i class="fab fa-github"></i>ARC3-IPFS Repo</a>
</li>
<li>
<a href="https://github.com/algorandfoundation/ARCs/issues/3" target="_blank" class="nav-link"><i class="fab fa-github"></i>Algorand ARC3</a>
</li>
<li>
<a href="https://github.com/emg110/ipfs2bytes32" target="_blank" class="nav-link"><i class="fab fa-github"></i>ipfs2bytes32</a>
</li>
</ul>
</div>
<div class="account">
<a href="javascript:void(0)" class="icon-wallet">
<div><i class="far fa-wallet"></i></div>
<div>MyAlgo</div>
</a>
</div>
</div>
</div>
<div class="content-wrapper arc3ipfs">
<div class="social-link">
<div class="text-block">@emg110</div>
<br>
<div class="icon social"><a class="icon-link" href="https://github.com/emg110"><i class="fab fa-github"></i></a></div>
<div class="icon social"><a class="icon-link" href="https://twitter.com/emg110"><i class="fab fa-twitter"></i></a></div>
<div class="icon social"><a class="icon-link" href="https://www.linkedin.com/in/emg110"><i class="fab fa-linkedin"></i></a></div>
</div>
<div class="content-arc3ipfs">
<div class="tagline">
<div class="tagline-line"></div>
<h5 class="heading-tagline">Algorand ARC3 compliant scenarios</h5>
</div>
<div class="h1-title">
<h1>
Create Algorand NFT using IPFS & complying to ARC3
</h1>
</div>
<div id="to-bottom">
<span>Links</span>
<div class="material-icons">
arrow_downward
</div>
</div>
</div>
</div>
<div class="nav-slider">
<div class="nav-slider-links">
<a href="javascript:void(0)" onclick="fnMove(1)" class="slider-link">ARC3::IPFS</a>
<a href="javascript:void(0)" onclick="fnMove(2)" class="slider-link">Pinata</a>
<a href="javascirpt:void(0)" onclick="fnMove(3)" class="slider-link">SC1</a>
<a href="javascirpt:void(0)" onclick="fnMove(4)" class="slider-link">SC2</a>
</div>
<div class="indicator-line">
<div class="indicator"></div>
</div>
</div>
<img src="./images/HG.png" class="hg" alt="hg">
<img src="./images/MG.png" class="mg" alt="mg">
<img src="./images/VG.png" class="vg" alt="vg">
<div class="gradient-arc3ipfs"></div>
</div>
<div class="content-section">
<div id="section2">
<div class="content-wrapper content">
<div class="grid">
<div class="content-text">
<div class="count">Pinata</div>
<div class="tagline">
<div class="tagline-line"></div>
<h5 class="heading-tagline">Upload NFT file</h5>
</div>
<h2>Upload and Pin with Pinata</h2>
<p>
<a href="https://pinata.cloud" target="_blank" class="nav-link"></i>Pinata Cloud</a>is an IPFS API service for uploading, pinning & management of your IPFS resources.
With Pinata API and Client there will be no need to use other thechnologies which rely on other blockchains and as they are using Pinata to have a better managed access to IPFS without the need to have a local IPFS node installed.
</p>
<a href="" class="link-to arc3ipfs">
<div>Home</div>
<div class="material-icons">
arrow_forward
</div>
</a>
</div>
<img style="opacity: 0.4;" src="./images/pinata.png" alt="img_post1">
</div>
</div>
</div>
<div id="section3">
<div class="content-wrapper content">
<div class="grid">
<img src="./images/HG.png" alt="img_post2">
<div class="content-text">
<div class="count-right">SC1</div>
<div class="tagline">
<div class="tagline-line"></div>
<h5 class="heading-tagline">Scenario 1</h5>
</div>
<h2>File and Metadata to IPFS separatedly and sequently</h2>
<p>
File --> IPFS --> Metadata --> IPFS --> ASA metadatahash field
</p>
<a href="" class="link-to arc3ipfs">
<div>Home</div>
<div class="material-icons">
arrow_forward
</div>
</a>
</div>
</div>
</div>
</div>
<div id="section4">
<div class="content-wrapper content">
<div class="grid">
<div class="content-text">
<div class="count-left">SC2</div>
<div class="tagline">
<div class="tagline-line"></div>
<h5 class="heading-tagline">Scenario 2</h5>
</div>
<h2>File & Metadata both in a folder</h2>
<p>
<figure>
<figcaption>Your code title</figcaption>
<pre>
<code contenteditable spellcheck="false">
let nftFileStats = fs.statSync(`${nftFileName}`)
let fileCat = 'image';
let nftFileNameSplit = nftFileName.split('.')
let ext = nftFileNameSplit[1];
let properties = {
"file_name": nftFileNameSplit[0],
"file_extension": nftFileNameSplit[1],
"file_size": nftFileStats.size,
"file_category": fileCat
};
let metadata = {
...config.arc3MetadataJSON,
properties: properties,
name: assetName,
description: assetDesc,
}
const pinataMetadata = {
name: assetName,
keyvalues: properties
};
const pinataOptions = {
cidVersion: 0,
};
const options = {
pinataMetadata: pinataMetadata,
pinataOptions: pinataOptions
};
let result = await pinata.pinFileToIPFS(nftFile, options);
metadata.image = '/ipfs/' + result.IpfsHash;
metadata.image_integrity = result.IpfsHash;
let resultMeta = await pinata.pinJSONToIPFS(metadata, options);
const folderCid = await ipfs.object.new();
const finResJson = await ipfs.object.patch.addLink(folderCid, {
name: `${nftFileNameSplit[0]}.json`,
size: resultMeta.size,
cid: resultMeta.IpfsHash,
});
const finResNft = await ipfs.object.patch.addLink(finResJson, {
name: nftFileName,
size: result.size,
cid: result.IpfsHash,
});
let finPin = await ipfs.pin.add(finResNft);
const finPinataPin = await pinata.pinByHash(finPin.toString());
</code>
</pre>
</figure>
File + Metadata --> Folder --> IPFS --> ASA metadatahash field
</p>
<a href="" class="link-to arc3ipfs">
<div>Home</div>
<div class="material-icons">
arrow_forward
</div>
</a>
</div>
<img src="./images/MG.png" alt="img_post3">
</div>
</div>
</div>
<div class="footer">
<div class="content-wrapper content footer">
<div class="grid footer">
<div class="footer-left">
<div class="top">
<a href="" class="logo">
<div class="arc3ipfs-logo">
ARC3::IPFS
</div>
</a>
<div class="footer-text">
Use Algorand ARC3 Compliance in NFT generation with IPFS using <a href="https://pinata.cloud" style="text-decoration:underline; color: rgb(195, 250, 252)" target="_blank"></i>Pinata API</a>
</div>
</div>
<div class="copyright">
All mentions and notions of Algorand and Algo are curtsey of <a href="https://algorand.com" style="text-decoration:underline; color: rgb(195, 250, 252)" target="_blank"></i>Algorand</a>
<br>
With love for Algorand community By <a href="https://github.com/emg110" target="_blank" class="author">@emg110</a>
</div>
</div>
<div class="footer-right">
<div class="links">
<div class="footer-links">
<h4>Read on NFT & IPFS</h4>
<a href="https://docs.ipfs.io/how-to/best-practices-for-nft-data/" target="_blank" class="footer-link">IPFS: Best Practices for NFT data</a>
<a href="https://docs.ipfs.io/how-to/mint-nfts-with-ipfs" target="_blank" class="footer-link">IPFS: Mint NFTs with IPFS</a>
<a href="https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/files-on-ipfs/lessons/wrap-directories-around-content.html" target="_blank" class="footer-link">IPFS: Wrap in Directory</a>
<a href="https://docs.ipfs.io/concepts/content-addressing/#identifier-formats" target="_blank" class="footer-link">IPFS CID: Versions</a>
<a href="https://proto.school/anatomy-of-a-cid" target="_blank" class="footer-link">IPFS CID: Anatomy of CID multihash</a>
<a href="https://github.com/multiformats/cid/blob/ef1b2002394b15b1e6c26c30545fd485f2c4c138/README.md#cidv0" target="_blank" class="footer-link">IPFS CID: On GitHub</a>
<a href="https://docs.pinata.cloud/api-pinning/pin-file#file" target="_blank" class="footer-link">Pinata: pin File</a>
<a href="https://docs.pinata.cloud/api-pinning/pin-json" target="_blank" class="footer-link">Pinata: Pin JSON</a>
</div>
<div class="footer-links">
<h4>Algorand ARC3</h4>
<a href="https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0003.md" target="_blank" class="footer-link">The ARC3 document</a>
<a href="https://github.com/algorandfoundation/ARCs/issues/3" target="_blank" class="footer-link">ARC3 conversation</a>
<a href="https://github.com/algorandfoundation/ARCs/issues/3#issuecomment-913541426" target="_blank" class="footer-link">ARC3 refferenced comment</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>