Skip to content

Commit a657035

Browse files
committed
adding directions to readme
1 parent 3f3101f commit a657035

8 files changed

+15
-7
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ git clone https://github.com/barnjamin/arc3.xyz.git
3232
cd arc3.xyz
3333
yarn install
3434
```
35-
Set your key in the `storageToken` field in `src/config.json` and update whatever other fields there you'd like
3635

36+
In this repo we're using a cloudflare worker to add the bearer token to the headers before proxying the request to web3.storage. This helps keep the key secret but for testing purposes you can set your storage token in a local config file.
37+
38+
1. Set your key in the `storageToken` field in `src/config.json` and update whatever other fields there you'd like
39+
2. Uncomment the storage var in `src/lib/ipfs.ts` and comment the one pointing to the barnji worker
3740

3841

3942
```

build/asset-manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.7f77b42f.chunk.css",
4-
"main.js": "/static/js/main.acdf30e3.chunk.js",
5-
"main.js.map": "/static/js/main.acdf30e3.chunk.js.map",
4+
"main.js": "/static/js/main.8e652125.chunk.js",
5+
"main.js.map": "/static/js/main.8e652125.chunk.js.map",
66
"runtime-main.js": "/static/js/runtime-main.b9cc4529.js",
77
"runtime-main.js.map": "/static/js/runtime-main.b9cc4529.js.map",
88
"static/js/2.81506aef.chunk.js": "/static/js/2.81506aef.chunk.js",
@@ -15,6 +15,6 @@
1515
"static/js/runtime-main.b9cc4529.js",
1616
"static/js/2.81506aef.chunk.js",
1717
"static/css/main.7f77b42f.chunk.css",
18-
"static/js/main.acdf30e3.chunk.js"
18+
"static/js/main.8e652125.chunk.js"
1919
]
2020
}

build/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link href="https://unpkg.com/normalize.css@^7.0.0" rel="stylesheet"/><link href="https://unpkg.com/@blueprintjs/icons@^3.4.0/lib/css/blueprint-icons.css" rel="stylesheet"/><link href="https://unpkg.com/@blueprintjs/core@^3.10.0/lib/css/blueprint.css" rel="stylesheet"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="ARC3 Reference implementation"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>ARC3.xyz</title><link href="/static/css/main.7f77b42f.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],f=r[1],i=r[2],p=0,s=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var a=this["webpackJsonparc3.xyz"]=this["webpackJsonparc3.xyz"]||[],f=a.push.bind(a);a.push=r,a=a.slice();for(var i=0;i<a.length;i++)r(a[i]);var c=f;t()}([])</script><script src="/static/js/2.81506aef.chunk.js"></script><script src="/static/js/main.acdf30e3.chunk.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link href="https://unpkg.com/normalize.css@^7.0.0" rel="stylesheet"/><link href="https://unpkg.com/@blueprintjs/icons@^3.4.0/lib/css/blueprint-icons.css" rel="stylesheet"/><link href="https://unpkg.com/@blueprintjs/core@^3.10.0/lib/css/blueprint.css" rel="stylesheet"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="ARC3 Reference implementation"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>ARC3.xyz</title><link href="/static/css/main.7f77b42f.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],f=r[1],i=r[2],p=0,s=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var a=this["webpackJsonparc3.xyz"]=this["webpackJsonparc3.xyz"]||[],f=a.push.bind(a);a.push=r,a=a.slice();for(var i=0;i<a.length;i++)r(a[i]);var c=f;t()}([])</script><script src="/static/js/2.81506aef.chunk.js"></script><script src="/static/js/main.8e652125.chunk.js"></script></body></html>

build/static/js/main.acdf30e3.chunk.js renamed to build/static/js/main.8e652125.chunk.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.8e652125.chunk.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.acdf30e3.chunk.js.map

-1
This file was deleted.

src/lib/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
type Config = {
2+
storageToken: string; // Storage token for web3.storage
23
network: string; // The network to use for creating nfts
34
ipfsGateway: string; // The IPFS gateway url for retrieving files
45
algod: string // The Algod api url to use

src/lib/ipfs.ts

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'
1212

1313

1414
export async function putToIPFS(activeConf: number, file: File, md: Metadata): Promise<string> {
15+
// Uncomment this line after you've set your storage token
16+
//const storage = new Web3Storage({token: conf[activeConf].storageToken})
17+
18+
// We hide the token for this site behind a cloudflare worker so no sneaky petes can delete our precious files
1519
const storage = new Web3Storage({token: " ", endpoint:"https://worker.barnji.workers.dev"})
1620
const imgAdded = await storage.put([file], {wrapWithDirectory: false})
1721
md.image = ipfsURL(imgAdded)

0 commit comments

Comments
 (0)