Skip to content

Commit 09ed5c0

Browse files
authored
Web example: devcon issuer
1 parent 2076527 commit 09ed5c0

33 files changed

+53817
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
*.tsml
99
*.p12
1010
!shong.wang.p12
11+
.eslintcache
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"env": {
3+
"es2020": true, // <- activate “es2020” globals
4+
"browser": true,
5+
"node": true,
6+
"mocha": true
7+
}
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# example
2+
3+
## Developer Getting Started
4+
5+
1. From this directory, run `yarn` or `npm install`
6+
2. To start the development server run `yarn start`
7+
3. To see the development server running go to localhost:3000
8+
4. To simulate a ticket loading inside the page, open the url below:
9+
10+
````
11+
http://localhost:3000/?ticket=MIGbMA0CAQYCBWE3ap3-AgEABEEEEjVknVv9Kf7F2Ftt6QVO3I02eRadiE1kJ6kvr934-TApOLZxrh5GL3jLoEz9Jv42FspPv-LHFa6M9AaOuLAvIgNHADBEAiBwLK_95NPZo0W01HDBfyZisZ2KaNrzoWuxRV-nhjGLMAIgaOP4eVVINH5xM8Cv9OVDdyOG3BxUqyPVQOuDU9PaC9o=&secret=45845870684
12+
13+
````
14+
15+
5. To build the applicatin run `yarn build`
16+
6. To test the application run `yarn test`
17+
18+
### Latest structures
19+
20+
````
21+
22+
https://ticket.devcon.org/?ticket=MIGbMA0CAQYCBWE3ap3-AgEABEEEEjVknVv9Kf7F2Ftt6QVO3I02eRadiE1kJ6kvr934-TApOLZxrh5GL3jLoEz9Jv42FspPv-LHFa6M9AaOuLAvIgNHADBEAiBwLK_95NPZo0W01HDBfyZisZ2KaNrzoWuxRV-nhjGLMAIgaOP4eVVINH5xM8Cv9OVDdyOG3BxUqyPVQOuDU9PaC9o=&secret=45845870684
23+
24+
http://localhost:3000/?ticket=MIGbMA0CAQYCBWE3ap3-AgEABEEEEjVknVv9Kf7F2Ftt6QVO3I02eRadiE1kJ6kvr934-TApOLZxrh5GL3jLoEz9Jv42FspPv-LHFa6M9AaOuLAvIgNHADBEAiBwLK_95NPZo0W01HDBfyZisZ2KaNrzoWuxRV-nhjGLMAIgaOP4eVVINH5xM8Cv9OVDdyOG3BxUqyPVQOuDU9PaC9o=&secret=45845870684
25+
26+
````
27+
28+
### Latest stucture (decoded version)
29+
30+
````
31+
32+
localhost:3000?ticket=SignedDevconTicket{ticket: DevconTicket {devconId: 6n,ticketId: 417541561855n,ticketClass: 0n},commitment: ArrayBuffer {[Uint8Contents]: <04 12 35 64 9d 5b fd 29 fe c5 d8 5b 6d e9 05 4e dc 8d 36 79 16 9d 88 4d 64 27 a9 2f af dd f8 fd 30 29 38 b6 71 ae 1e 46 2f 78 cb a0 4c fd 26 fe 36 16 ca 4f bf f2 c7 15 ae 8c f4 06 8e b8 b0 2f 22>,byteLength: 65},publicKeyInfo: PublicKeyInfo { signatureAlgorithm: undefined, publicKey: undefined },signatureValue: ArrayBuffer {[Uint8Contents]: <30 44 02 20 70 2c af bd e4 d3 d9 a3 45 b4 d4 70 c1 7f 26 62 b1 9d 8a 68 da f3 a1 6b b1 45 5f e7 86 31 8b 30 02 20 68 e3 f8 79 55 48 34 7e 71 33 c0 af f4 e5 43 77 23 86 dc 1c 54 ab 23 d5 40 eb 83 53 d3 da 0b da>,byteLength: 70}}&secret=45845870684
33+
34+
````
35+
36+
### old structure
37+
38+
````
39+
40+
localhost:3000?ticket={"ticket":{"devconId":"6n","ticketId":"48646n","ticketClass":"0n"},"commitment":{"[Uint8Contents]":"< 04 0a fd f0 e2 47 4c ae 9b 66 16 f0 4b ac dd 9f 76 ab 58 82 db b8 39 9d 3f 60 a1 53 61 da d7 03 0f 27 be 3f 58 3f e4 5d e9 49 5f 84 f4 82 37 ec 2b 7c 71 0e b3 b5 d2 e7 a5 65 2d 8d 56 c7 18 25 6f >","byteLength":65},"signatureValue":{"[Uint8Contents]":"< 30 44 02 20 38 db 21 b6 b5 b7 c6 92 da ad a2 b6 2e bb 89 e5 a3 6e 3a 3c ce 66 1e 38 53 2b c9 ac c8 5c 34 1b 02 20 70 46 73 21 8f 77 b2 47 b5 51 ab 3c 3d 74 e1 ef 8f 4f 7e 3a e0 40 1d 53 54 26 65 3a aa 5e c2 a2 >","byteLength":70}}&secret=3446435555555
41+
42+
````
43+
44+
## Notes from meeting with Weiwu
45+
46+
1. Update the ticket data to manage both tickets and a secret [{secret, ticket}]
47+
48+
- Dev note: Upon creating a new ticket / updating an previous ticket, the secret is added within the js structure.
49+
50+
2. Update the query to provide the encoded version
51+
3. Add github to package.json for attestation lib
52+
53+
````
54+
https://ticket.devcon.org/?ticket=MIGbMA0CAQYCBWE3ap3-AgEABEEEEjVknVv9Kf7F2Ftt6QVO3I02eRadiE1kJ6kvr934-TApOLZxrh5GL3jLoEz9Jv42FspPv-LHFa6M9AaOuLAvIgNHADBEAiBwLK_95NPZo0W01HDBfyZisZ2KaNrzoWuxRV-nhjGLMAIgaOP4eVVINH5xM8Cv9OVDdyOG3BxUqyPVQOuDU9PaC9o=&secret=45845870684
55+
56+
ticketObject: {
57+
ticket: MIGbMA0CAQYCBWE3ap3-AgEABEEEEjVknVv9Kf7F2Ftt6QVO3I02eRadiE1kJ6kvr934-TApOLZxrh5GL3jLoEz9Jv42FspPv-LHFa6M9AaOuLAvIgNHADBEAiBwLK_95NPZo0W01HDBfyZisZ2KaNrzoWuxRV-nhjGLMAIgaOP4eVVINH5xM8Cv9OVDdyOG3BxUqyPVQOuDU9PaC9o=,
58+
secret: 45845870684
59+
}
60+
````
61+
62+
## future ideas
63+
64+
````
65+
66+
// Passive Event Management - todo, work out strategy for this.
67+
const event = new Event('tokenEvent');
68+
// Listen for the event.
69+
window.addEventListener('tokenEvent', function (e) { console.log('e') }, false);
70+
// Dispatch the event.
71+
window.dispatchEvent(event);
72+
73+
````
74+
75+
## dev resources and previous notes
76+
77+
- resources:
78+
79+
https://web3js.readthedocs.io/en/v1.2.0/web3-eth-accounts.html#id15
80+
https://github.com/ethereumjs/ethereumjs-util
81+
82+
- Todo's:
83+
84+
1. Localstorage / query string simulation (must review flow with Weiwu) (done)
85+
2. React & Vanilla JS-Html (modern and traditional approaches etc) (react done / vanilla todo once confirmed the react is correct)
86+
3. NPM & Dist (modern and traditional approaches etc) (todo)
87+
88+
// 2 and 3 are perhaps nice to have for Devcon (however my aim is to provide both)
89+
90+
// Attestation Github (Git or NPM code in here)
91+
// Negotiator Github (needs to consume the Attestation Git or NPM code)
92+
// Nick-T to utilise this: username/repo#branch-name
93+
94+
# react specifics below
95+
96+
# Getting Started with Create React App
97+
98+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
99+
100+
## Available Scripts
101+
102+
In the project directory, you can run:
103+
104+
### `yarn start`
105+
106+
Runs the app in the development mode.\
107+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
108+
109+
The page will reload if you make edits.\
110+
You will also see any lint errors in the console.
111+
112+
### `yarn test`
113+
114+
Launches the test runner in the interactive watch mode.\
115+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
116+
117+
### `yarn build`
118+
119+
Builds the app for production to the `build` folder.\
120+
It correctly bundles React in production mode and optimizes the build for the best performance.
121+
122+
The build is minified and the filenames include the hashes.\
123+
Your app is ready to be deployed!
124+
125+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
126+
127+
### `yarn eject`
128+
129+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
130+
131+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
132+
133+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
134+
135+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
136+
137+
## Learn More
138+
139+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
140+
141+
To learn React, check out the [React documentation](https://reactjs.org/).
142+
143+
### Code Splitting
144+
145+
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
146+
147+
### Analyzing the Bundle Size
148+
149+
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
150+
151+
### Making a Progressive Web App
152+
153+
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
154+
155+
### Advanced Configuration
156+
157+
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
158+
159+
### Deployment
160+
161+
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
162+
163+
### `yarn build` fails to minify
164+
165+
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"testURL": "https://www.somthing.com/test.html"
3+
}

0 commit comments

Comments
 (0)