Skip to content
This repository was archived by the owner on Mar 16, 2023. It is now read-only.

Commit bad7b4b

Browse files
authored
Merge pull request #443 from AztecProtocol/feat-sdk-ui-develop
Merge `feat-sdk-ui` into `develop`
2 parents 75ee78e + b266071 commit bad7b4b

1,426 files changed

Lines changed: 154611 additions & 2998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,6 @@ jobs:
9797
- run:
9898
name: "Orchestrate Artifacts"
9999
command: yarn script:orchestrate:artifacts
100-
coverage:
101-
working_directory: ~/repo
102-
docker:
103-
- image: circleci/node:10.15.3
104-
- image: trufflesuite/ganache-cli:v6.4.1
105-
command: ganache-cli -i 1234 -p 8545 -e 10000000 -l 6721975 -m=\"$TEST_MNEMONIC\"
106-
steps:
107-
- restore_cache:
108-
keys:
109-
- repo-{{ .Environment.CIRCLE_SHA1 }}
110-
- run:
111-
name: "Cover Packages"
112-
command: PKG=@aztec/protocol yarn coverage
113100
docs:
114101
working_directory: ~/repo
115102
docker:
@@ -183,13 +170,6 @@ workflows:
183170
branches:
184171
only:
185172
- develop
186-
- coverage:
187-
requires:
188-
- lint
189-
- test
190-
filters:
191-
branches:
192-
ignore: gh-pages
193173
- docs:
194174
requires:
195175
- lint

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ dist/
1010
docs/
1111
lib/
1212
node_modules/
13+
screenshots/
1314

1415
# files
1516
.DS_Store
1617
.env
18+
.env.development
19+
.env.production
20+
.env.test
21+
.env.integration
1722
*.log
1823
coverage.json
1924
lerna-debug.log*
@@ -28,3 +33,19 @@ packages/contract-addresses/package-lock.json
2833
packages/contract-artifacts/package-lock.json
2934
packages/dev-utils/package-lock.json
3035
packages/protocol/package-lock.json
36+
packages/extension/.ignore
37+
packages/extension/=
38+
packages/extension/src/background/contracts/IZkAsset.json
39+
packages/extension/src/background/contracts/IZkAsset.json
40+
packages/extension/src/background/contracts/AZTECAccountRegistry.json
41+
packages/extension/src/background/contracts/AZTECAccountRegistry.json
42+
packages/extension/src/background/contracts/IZkAsset.json
43+
packages/extension/src/background/contracts/ACE.json
44+
packages/extension/src/test/harness
45+
packages/aws-lambda/signer/.aws/
46+
packages/aws-lambda/signer/.aws-sam/
47+
packages/aws-lambda/.aws/
48+
packages/aws-lambda/.aws-sam/
49+
packages/aws-lambda/signer/template.yaml
50+
packages/aws-lambda/signer/packaged_dev.yaml
51+
packages/aws-lambda/signer/packaged_prod.yaml

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ package.json
1616
# packages
1717
packages/contract-addresses/addresses/
1818
packages/contract-artifacts/artifacts/
19+
packages/graph/
20+
packages/extension/

.releaserc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"branch": "master",
2+
"branch": "develop",
33
"plugins": [
44
["@semantic-release/commit-analyzer", {
55
"preset": "angular",
@@ -13,6 +13,9 @@
1313
["@semantic-release/release-notes-generator", {
1414
"preset": "angular"
1515
}],
16+
["@semantic-release/exec", {
17+
"publishCmd": "../monorepo-scripts/aws/aws-bundle-deploy.sh",
18+
}],
1619
["@semantic-release/npm"],
1720
["@semantic-release/git", {
1821
"assets": false

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@
5151
"test": "yarn wsrun --package $PKG --serial -c --if has:changed --ifDependency test",
5252
"test:integration": "yarn wsrun --package $PKG -c --if has:changed test:testNets",
5353
"watch": "yarn wsrun --package $PKG --parallel -c watch",
54-
"wsrun": "wsrun --exclude-missing --fast-exit"
54+
"wsrun": "wsrun --exclude-missing --fast-exit",
55+
"webpack-defaults": "webpack-defaults"
5556
},
5657
"workspaces": [
5758
"packages/*"
58-
]
59+
],
60+
"dependencies": {
61+
"@semantic-release/exec": "^4.0.0"
62+
}
5963
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
2+
# Created by https://www.gitignore.io/api/osx,node,linux,windows
3+
4+
### Linux ###
5+
*~
6+
7+
# temporary files which can be created if a process still has a handle open of a deleted file
8+
.fuse_hidden*
9+
10+
# KDE directory preferences
11+
.directory
12+
13+
# Linux trash folder which might appear on any partition or disk
14+
.Trash-*
15+
16+
# .nfs files are created when an open file is removed but is still being accessed
17+
.nfs*
18+
19+
### Node ###
20+
# Logs
21+
logs
22+
*.log
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# Runtime data
28+
pids
29+
*.pid
30+
*.seed
31+
*.pid.lock
32+
33+
# Directory for instrumented libs generated by jscoverage/JSCover
34+
lib-cov
35+
36+
# Coverage directory used by tools like istanbul
37+
coverage
38+
39+
# nyc test coverage
40+
.nyc_output
41+
42+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
43+
.grunt
44+
45+
# Bower dependency directory (https://bower.io/)
46+
bower_components
47+
48+
# node-waf configuration
49+
.lock-wscript
50+
51+
# Compiled binary addons (http://nodejs.org/api/addons.html)
52+
build/Release
53+
54+
# Dependency directories
55+
node_modules/
56+
jspm_packages/
57+
58+
# Typescript v1 declaration files
59+
typings/
60+
61+
# Optional npm cache directory
62+
.npm
63+
64+
# Optional eslint cache
65+
.eslintcache
66+
67+
# Optional REPL history
68+
.node_repl_history
69+
70+
# Output of 'npm pack'
71+
*.tgz
72+
73+
# Yarn Integrity file
74+
.yarn-integrity
75+
76+
# dotenv environment variables file
77+
.env
78+
79+
80+
### OSX ###
81+
*.DS_Store
82+
.AppleDouble
83+
.LSOverride
84+
85+
# Icon must end with two \r
86+
Icon
87+
88+
# Thumbnails
89+
._*
90+
91+
# Files that might appear in the root of a volume
92+
.DocumentRevisions-V100
93+
.fseventsd
94+
.Spotlight-V100
95+
.TemporaryItems
96+
.Trashes
97+
.VolumeIcon.icns
98+
.com.apple.timemachine.donotpresent
99+
100+
# Directories potentially created on remote AFP share
101+
.AppleDB
102+
.AppleDesktop
103+
Network Trash Folder
104+
Temporary Items
105+
.apdisk
106+
107+
### Windows ###
108+
# Windows thumbnail cache files
109+
Thumbs.db
110+
ehthumbs.db
111+
ehthumbs_vista.db
112+
113+
# Folder config file
114+
Desktop.ini
115+
116+
# Recycle Bin used on file shares
117+
$RECYCLE.BIN/
118+
119+
# Windows Installer files
120+
*.cab
121+
*.msi
122+
*.msm
123+
*.msp
124+
125+
# Windows shortcuts
126+
*.lnk
127+
128+
129+
# End of https://www.gitignore.io/api/osx,node,linux,windows
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# signer
2+
3+
This project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.
4+
5+
- signer - Code for the application's Lambda function.
6+
- events - Invocation events that you can use to invoke the function.
7+
- signer/tests - Unit tests for the application code.
8+
- template.yaml - A template that defines the application's AWS resources.
9+
10+
The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the `template.yaml` file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.
11+
12+
If you prefer to use an integrated development environment (IDE) to build and test your application, you can use the AWS Toolkit.
13+
The AWS Toolkit is an open source plug-in for popular IDEs that uses the SAM CLI to build and deploy serverless applications on AWS. The AWS Toolkit also adds a simplified step-through debugging experience for Lambda function code. See the following links to get started.
14+
15+
- [PyCharm](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)
16+
- [IntelliJ](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)
17+
- [VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/welcome.html)
18+
- [Visual Studio](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/welcome.html)
19+
20+
## Deploy the sample application
21+
22+
The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.
23+
24+
To use the SAM CLI, you need the following tools.
25+
26+
- AWS CLI - [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials].
27+
- SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
28+
- Node.js - [Install Node.js 10](https://nodejs.org/en/), including the NPM package management tool.
29+
- Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community)
30+
31+
The SAM CLI uses an Amazon S3 bucket to store your application's deployment artifacts. If you don't have a bucket suitable for this purpose, create one. Replace `BUCKET_NAME` in the commands in this section with a unique bucket name.
32+
33+
```bash
34+
signer$ aws s3 mb s3://BUCKET_NAME
35+
```
36+
37+
To prepare the application for deployment, use the `sam package` command.
38+
39+
```bash
40+
signer$ sam package \
41+
--output-template-file packaged.yaml \
42+
--s3-bucket BUCKET_NAME
43+
```
44+
45+
The SAM CLI creates deployment packages, uploads them to the S3 bucket, and creates a new version of the template that refers to the artifacts in the bucket.
46+
47+
To deploy the application, use the `sam deploy` command.
48+
49+
```bash
50+
signer$ sam deploy \
51+
--template-file packaged.yaml \
52+
--stack-name signer \
53+
--capabilities CAPABILITY_IAM
54+
```
55+
56+
After deployment is complete you can run the following command to retrieve the API Gateway Endpoint URL:
57+
58+
```bash
59+
signer$ aws cloudformation describe-stacks \
60+
--stack-name signer \
61+
--query 'Stacks[].Outputs[?OutputKey==`HelloWorldApi`]' \
62+
--output table
63+
```
64+
65+
## Use the SAM CLI to build and test locally
66+
67+
Build your application with the `sam build` command.
68+
69+
```bash
70+
signer$ sam build
71+
```
72+
73+
The SAM CLI installs dependencies defined in `signer/package.json`, creates a deployment package, and saves it in the `.aws-sam/build` folder.
74+
75+
Test a single function by invoking it directly with a test event. An event is a JSON document that represents the input that the function receives from the event source. Test events are included in the `events` folder in this project.
76+
77+
Run functions locally and invoke them with the `sam local invoke` command.
78+
79+
```bash
80+
signer$ sam local invoke putItemFunction --event events/event.json
81+
```
82+
83+
The SAM CLI can also emulate your application's API. Use the `sam local start-api` to run the API locally on port 3000.
84+
85+
```bash
86+
signer$ sam local start-api
87+
signer$ curl http://localhost:3000/
88+
```
89+
90+
The SAM CLI reads the application template to determine the API's routes and the functions that they invoke. The `Events` property on each function's definition includes the route and method for each path.
91+
92+
```yaml
93+
Events:
94+
HelloWorld:
95+
Type: Api
96+
Properties:
97+
Path: /sign-data
98+
Method: post
99+
```
100+
101+
## Add a resource to your application
102+
103+
The application template uses AWS Serverless Application Model (AWS SAM) to define application resources. AWS SAM is an extension of AWS CloudFormation with a simpler syntax for configuring common serverless application resources such as functions, triggers, and APIs. For resources not included in [the SAM specification](https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md), you can use standard [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) resource types.
104+
105+
## Fetch, tail, and filter Lambda function logs
106+
107+
To simplify troubleshooting, SAM CLI has a command called `sam logs`. `sam logs` lets you fetch logs generated by your deployed Lambda function from the command line. In addition to printing the logs on the terminal, this command has several nifty features to help you quickly find the bug.
108+
109+
`NOTE`: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.
110+
111+
```bash
112+
signer$ sam logs -n HelloWorldFunction --stack-name signer --tail
113+
```
114+
115+
You can find more information and examples about filtering Lambda function logs in the [SAM CLI Documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-logging.html).
116+
117+
## Unit tests
118+
119+
Tests are defined in the `signer/tests` folder in this project. Use NPM to install the [Mocha test framework](https://mochajs.org/) and run unit tests.
120+
121+
```bash
122+
signer$ cd signer
123+
signer$ npm install
124+
signer$ npm run test
125+
```
126+
127+
## Cleanup
128+
129+
To delete the sample application and the bucket that you created, use the AWS CLI.
130+
131+
```bash
132+
signer$ aws cloudformation delete-stack --stack-name signer
133+
signer$ aws s3 rb s3://BUCKET_NAME
134+
```
135+
136+
## Resources
137+
138+
See the [AWS SAM developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html) for an introduction to SAM specification, the SAM CLI, and serverless application concepts.
139+
140+
Next, you can use AWS Serverless Application Repository to deploy ready to use Apps that go beyond hello world samples and learn how authors developed their applications: [AWS Serverless Application Repository main page](https://aws.amazon.com/serverless/serverlessrepo/)

0 commit comments

Comments
 (0)