Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit ea7d799

Browse files
authored
Merge pull request #933 from 0xProject/release/10.0.0
Release 10.0.0
2 parents 8123878 + 8fa5e05 commit ea7d799

File tree

267 files changed

+34857
-54570
lines changed

Some content is hidden

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

267 files changed

+34857
-54570
lines changed

.circleci/config.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
environment:
55
BASH_ENV: ~/.nvm/nvm.sh
66
docker:
7-
- image: circleci/golang:1.13.4-browsers
7+
- image: circleci/golang:1.15-browsers
88
- image: 0xorg/ganache-cli:istanbul
99
environment:
1010
VERSION: 6.2.4
@@ -28,13 +28,15 @@ jobs:
2828
- run:
2929
name: Install dependencies
3030
command: make deps-no-lockfile
31-
- run:
32-
name: Vendor Go dependencies as a workaround for https://github.com/golangci/golangci-lint/issues/865
33-
command: go mod vendor
3431
- run:
3532
name: Install Go linter
36-
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2
33+
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0
3734
- run:
35+
# NOTE(jalextowle): We previously vendored our dependencies to avoid
36+
# this issue: https://github.com/golangci/golangci-lint/issues/825.
37+
# Vendoring caused an issue where the output on CI was not the same as
38+
# that locally, so it has been removed. This should be reevaluated if
39+
# the issue reappears.
3840
name: Run linters
3941
command: make lint
4042
- run:

.drone.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
kind: pipeline
2-
type: docker
2+
type: kubernetes
33
name: mesh
44

55
steps:
@@ -17,7 +17,7 @@ node_selector:
1717
drone-builds: true
1818
---
1919
kind: pipeline
20-
type: docker
20+
type: kubernetes
2121
name: mesh-bootstrap-autotag
2222

2323
steps:
@@ -35,7 +35,7 @@ node_selector:
3535
drone-builds: true
3636
---
3737
kind: pipeline
38-
type: docker
38+
type: kubernetes
3939
name: mesh-development
4040

4141
steps:
@@ -60,7 +60,7 @@ node_selector:
6060
drone-builds: true
6161
---
6262
kind: pipeline
63-
type: docker
63+
type: kubernetes
6464
name: mesh-bootstrap-development
6565

6666
steps:
@@ -85,7 +85,7 @@ node_selector:
8585
drone-builds: true
8686
---
8787
kind: pipeline
88-
type: docker
88+
type: kubernetes
8989
name: mesh-publish-release-notes
9090

9191
steps:

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Automatically collapse generated files in GitHub.
22
ethereum/wrappers/*.go linguist-generated=true
3-
docs/json-rpc-clients/typescript/*.md linguist-generated=true
3+
docs/graphql-clients/typescript/*.md linguist-generated=true
44

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
target-branch: "development"

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ yarn-error.log
1212
*/**/yarn-error.log*
1313
ganache.log
1414
*/**/ganache.log*
15-
packages/browser/src/generated
16-
*/**/dist/**/*
17-
!*/**/dist/index.html
15+
packages/**/generated/**
16+
*/**/*dist/**/*
17+
!*/**/*dist/index.html
1818
!integration-tests/data/standalone-0/keys/privKey
1919
integration-tests/data/standalone-*/
2020
integration-tests/data/bootstrap-0/p2p/

.golangci.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
linters:
2-
disable-all: true
2+
disable-all: false
33
enable:
4-
- errcheck
5-
- govet
4+
# Finds repeated strings that could be made constants
5+
- goconst
6+
# Ensures that the code was formatted with `gofmt -s`
7+
- gofmt
8+
# Identifies commonly misspelled words
9+
- misspell
10+
# Identifies unused function parameters
11+
- unparam

.graphqlconfig

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"schemaPath": "graphql/schema.graphql"
3+
}

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib
2+
ethereum/blockwatch/testdata
3+
packages/**/generated/**
4+
*.d.ts

CHANGELOG.md

+168-155
Large diffs are not rendered by default.

CONTRIBUTING.md

+42-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _outside_ of your `GOPATH`.
1010
0x Mesh uses two main branches:
1111

1212
1. The `development` branch contains the latest (possibly unreleased) changes
13-
and is not guaranteed to be stable.
13+
and is not guaranteed to be stable.
1414
2. The `master` branch contains the latest stable release.
1515

1616
If you intend to fork 0x Mesh and open a PR, you should work off of the
@@ -30,10 +30,10 @@ the dropdown menu in the GitHub UI to select `development`.
3030
## Prerequisites
3131

3232
- [GNU Make](https://www.gnu.org/software/make/) If you are using a Unix-like OS, you probably already have this.
33-
- [Go version 1.13.x](https://golang.org/dl/) (or use [the version manager called "g"](https://github.com/stefanmaric/g)).
33+
- [Go version 1.15.x](https://golang.org/dl/) (or use [the version manager called "g"](https://github.com/stefanmaric/g)).
3434
- [Node.js version >=11](https://nodejs.org/en/download/) (or use the [nvm version manager](https://github.com/creationix/nvm)).
3535
- [Yarn package manager](https://yarnpkg.com/en/).
36-
- [golangci-lint version 1.22.2](https://github.com/golangci/golangci-lint#install).
36+
- [golangci-lint version 1.27.0](https://github.com/golangci/golangci-lint#install-golangci-lint).
3737
- [Python](https://www.python.org/downloads/). (Many OSes already have this).
3838
- [Google Chrome](https://www.google.com/chrome/). If you already have Google Chrome you typically don't need to do anything. On Ubuntu you can run `wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install`.
3939
- A C compiler such as [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/). Some OSes will already have this. On Ubuntu you can run `sudo apt-get install build-essential`.
@@ -44,6 +44,20 @@ the dropdown menu in the GitHub UI to select `development`.
4444
make deps
4545
```
4646

47+
## Building TypeScript packages
48+
49+
Mesh contains some TypeScript packages, all of which are contained in a small monorepo in the **packages/** directory. Some
50+
packages are published, and some are only used internally for development and testing.
51+
52+
To build all the TypeScript packages:
53+
54+
```
55+
yarn build
56+
```
57+
58+
You can also run `yarn build` inside of individual packages in order to just build that package and its dependencies. However,
59+
changing any Go code will require running `yarn build` at the root of the project again.
60+
4761
## Running Tests
4862

4963
Some of the tests depend on having a test Ethereum node running. Before running
@@ -77,6 +91,7 @@ make test-all
7791
```
7892

7993
### Potential Issues
94+
8095
The default maximum number of open files is too low in some operating systems
8196
for the tests to be run successfully. If an error that reads like "Too many open files,"
8297
it may be necessary to increase this limit. On Unix-like operating systems, the `ulimit`
@@ -99,6 +114,20 @@ available linters, run:
99114
make lint
100115
```
101116

117+
## Running prettier
118+
119+
0x Mesh uses a tool called [prettier](https://prettier.io/), which is a tool that
120+
enforces a consistent style across the Typescript codebase. The continuous integration
121+
pipeline will fail if Typescript code is not "prettified," so `prettier` must be run
122+
to ensure that the code is properly formatted.
123+
124+
The prettier tool can be run using the following command from the top-level of the
125+
0x-Mesh repository (outside of a directory inside **packages/**):
126+
127+
```bash
128+
yarn prettier
129+
```
130+
102131
## Managing Dependencies
103132

104133
Mesh uses [Go Modules](https://github.com/golang/go/wiki/Modules) for managing
@@ -144,3 +173,13 @@ following to your editor config:
144173
// ...
145174
}
146175
```
176+
177+
### Prettier
178+
179+
Prettier configurations for most popular text editors can be found
180+
[here](https://prettier.io/docs/en/editors.html).
181+
182+
### TSLint
183+
184+
TSLint configurations for most popular text editors can be found
185+
[here](https://palantir.github.io/tslint/usage/third-party-tools/).

Makefile

+59-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: deps
2-
deps: deps-ts wasmbrowsertest
2+
deps: deps-ts wasmbrowsertest gqlgen
33

44

55
.PHONY: deps-ts
@@ -13,6 +13,13 @@ gobin:
1313
GO111MODULE=off go get -u github.com/myitcv/gobin
1414

1515

16+
# gqlgen is a tool for embedding files so that they are included in binaries.
17+
# This installs the CLI for go-bindata.
18+
.PHONY: gqlgen
19+
gqlgen: gobin
20+
gobin github.com/99designs/[email protected]
21+
22+
1623
# wasmbrowsertest is required for running WebAssembly tests in the browser.
1724
.PHONY: wasmbrowsertest
1825
wasmbrowsertest: gobin
@@ -21,45 +28,72 @@ wasmbrowsertest: gobin
2128

2229
# Installs dependencies without updating Gopkg.lock or yarn.lock
2330
.PHONY: deps-no-lockfile
24-
deps-no-lockfile: deps-ts-no-lockfile wasmbrowsertest
31+
deps-no-lockfile: deps-ts-no-lockfile wasmbrowsertest gqlgen
2532

2633

2734
.PHONY: deps-ts-no-lockfile
2835
deps-ts-no-lockfile:
2936
yarn install --frozen-lockfile
3037

3138

39+
# Provides a pre-commit convenience command that runs all of the tests and the linters
40+
.PHONY: check
41+
check: test-all lint
42+
43+
3244
.PHONY: test-all
3345
test-all: test-go test-wasm-browser test-ts test-browser-conversion test-browser-integration
3446

3547

3648
.PHONY: test-go
37-
test-go: test-go-parallel test-go-serial
49+
test-go: generate test-go-parallel test-go-serial
3850

3951

4052
.PHONY: test-go-parallel
4153
test-go-parallel:
4254
go test ./... -race -timeout 30s
4355

4456

57+
.PHONY: test-key-value-stores
58+
test-key-value-stores: test-key-value-stores-go test-key-value-stores-wasm
59+
60+
61+
.PHONY: test-key-value-stores-go
62+
test-key-value-stores-go:
63+
ENABLE_KEY_VALUE_TESTS=true go test ./db
64+
65+
66+
.PHONY: test-key-value-stores-wasm
67+
test-key-value-stores-wasm:
68+
WASM_INIT_FILE="$$(pwd)/packages/mesh-browser-shim/dist/browser_shim.js" GOOS=js GOARCH=wasm ENABLE_KEY_VALUE_TESTS=true go test ./db -timeout 30m -tags=browser -exec="$$GOPATH/bin/wasmbrowsertest"
69+
70+
4571
.PHONY: test-go-serial
4672
test-go-serial:
4773
go test ./zeroex/ordervalidator ./zeroex/orderwatch ./core -race -timeout 90s -p=1 --serial
4874

49-
5075
.PHONY: test-browser-integration
51-
test-browser-integration:
52-
go test ./integration-tests -timeout 185s --enable-browser-integration-tests -run BrowserIntegration
76+
test-browser-integration: test-browser-legacy-integration test-browser-graphql-integration
77+
78+
79+
.PHONY: test-browser-legacy-integration
80+
test-browser-legacy-integration:
81+
go test ./integration-tests -timeout 60s --enable-browser-legacy-integration-tests -run BrowserLegacyIntegration
82+
83+
84+
.PHONY: test-browser-graphql-integration
85+
test-browser-graphql-integration:
86+
go test ./integration-tests -timeout 60s --enable-browser-graphql-integration-tests -run BrowserGraphQLIntegration
5387

5488

5589
.PHONY: test-browser-conversion
5690
test-browser-conversion:
57-
go test ./packages/browser/go/conversion-test -timeout 185s --enable-browser-conversion-tests -run BrowserConversions
91+
go test ./packages/mesh-browser/go/conversion-test -timeout 185s --enable-browser-conversion-tests -run BrowserConversions
5892

5993

6094
.PHONY: test-wasm-browser
6195
test-wasm-browser:
62-
WASM_INIT_FILE="$$(pwd)/packages/test-wasm/dist/browser_shim.js" GOOS=js GOARCH=wasm go test -tags=browser -exec="$$GOPATH/bin/wasmbrowsertest" ./...
96+
WASM_INIT_FILE="$$(pwd)/packages/mesh-browser-shim/dist/browser_shim.js" GOOS=js GOARCH=wasm go test -tags=browser -exec="$$GOPATH/bin/wasmbrowsertest" ./...
6397

6498

6599
.PHONY: test-ts
@@ -68,21 +102,30 @@ test-ts:
68102

69103

70104
.PHONY: lint
71-
lint: lint-go lint-ts
105+
lint: lint-go lint-ts lint-prettier
72106

73107

74108
.PHONY: lint-go
75109
lint-go:
76-
golangci-lint run
110+
golangci-lint run --timeout 2m
77111

78112

79113
.PHONY: lint-ts
80114
lint-ts:
81115
yarn lint
82116

117+
.PHONY: lint-prettier
118+
lint-prettier:
119+
yarn prettier:ci
120+
121+
122+
.PHONY: generate
123+
generate:
124+
go generate ./...
125+
83126

84127
.PHONY: mesh
85-
mesh:
128+
mesh: generate
86129
go install ./cmd/mesh
87130

88131

@@ -102,7 +145,7 @@ db-integrity-check:
102145

103146

104147
.PHONY: cut-release
105-
cut-release:
148+
cut-release: generate
106149
go run ./cmd/cut-release/main.go
107150

108151

@@ -114,7 +157,7 @@ all: mesh mesh-keygen mesh-bootstrap db-integrity-check
114157

115158

116159
.PHONY: docker-mesh
117-
docker-mesh:
160+
docker-mesh: generate
118161
docker build . -t 0xorg/mesh -f ./dockerfiles/mesh/Dockerfile
119162

120163

@@ -129,5 +172,6 @@ docker-mesh-fluent-bit:
129172

130173

131174
.PHONY: docker-mesh-bridge
132-
docker-mesh-bridge:
133-
docker build . -t 0xorg/mesh-bridge -f ./dockerfiles/mesh-bridge/Dockerfile
175+
docker-mesh-bridge: generate
176+
@echo 'WARN: mesh-bridge is currently disabled since it has not been updated to use the new GraphQL API'
177+
# docker build . -t 0xorg/mesh-bridge -f ./dockerfiles/mesh-bridge/Dockerfile

0 commit comments

Comments
 (0)