|
| 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) |
0 commit comments