Skip to content

Commit

Permalink
Merge pull request #933 from 0xProject/release/10.0.0
Browse files Browse the repository at this point in the history
Release 10.0.0
  • Loading branch information
jalextowle committed Sep 23, 2020
2 parents 8123878 + 8fa5e05 commit ea7d799
Show file tree
Hide file tree
Showing 267 changed files with 34,857 additions and 54,570 deletions.
12 changes: 7 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
environment:
BASH_ENV: ~/.nvm/nvm.sh
docker:
- image: circleci/golang:1.13.4-browsers
- image: circleci/golang:1.15-browsers
- image: 0xorg/ganache-cli:istanbul
environment:
VERSION: 6.2.4
Expand All @@ -28,13 +28,15 @@ jobs:
- run:
name: Install dependencies
command: make deps-no-lockfile
- run:
name: Vendor Go dependencies as a workaround for https://github.com/golangci/golangci-lint/issues/865
command: go mod vendor
- run:
name: Install Go linter
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0
- run:
# NOTE(jalextowle): We previously vendored our dependencies to avoid
# this issue: https://github.com/golangci/golangci-lint/issues/825.
# Vendoring caused an issue where the output on CI was not the same as
# that locally, so it has been removed. This should be reevaluated if
# the issue reappears.
name: Run linters
command: make lint
- run:
Expand Down
10 changes: 5 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: pipeline
type: docker
type: kubernetes
name: mesh

steps:
Expand All @@ -17,7 +17,7 @@ node_selector:
drone-builds: true
---
kind: pipeline
type: docker
type: kubernetes
name: mesh-bootstrap-autotag

steps:
Expand All @@ -35,7 +35,7 @@ node_selector:
drone-builds: true
---
kind: pipeline
type: docker
type: kubernetes
name: mesh-development

steps:
Expand All @@ -60,7 +60,7 @@ node_selector:
drone-builds: true
---
kind: pipeline
type: docker
type: kubernetes
name: mesh-bootstrap-development

steps:
Expand All @@ -85,7 +85,7 @@ node_selector:
drone-builds: true
---
kind: pipeline
type: docker
type: kubernetes
name: mesh-publish-release-notes

steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automatically collapse generated files in GitHub.
ethereum/wrappers/*.go linguist-generated=true
docs/json-rpc-clients/typescript/*.md linguist-generated=true
docs/graphql-clients/typescript/*.md linguist-generated=true

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "development"
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ yarn-error.log
*/**/yarn-error.log*
ganache.log
*/**/ganache.log*
packages/browser/src/generated
*/**/dist/**/*
!*/**/dist/index.html
packages/**/generated/**
*/**/*dist/**/*
!*/**/*dist/index.html
!integration-tests/data/standalone-0/keys/privKey
integration-tests/data/standalone-*/
integration-tests/data/bootstrap-0/p2p/
12 changes: 9 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
linters:
disable-all: true
disable-all: false
enable:
- errcheck
- govet
# Finds repeated strings that could be made constants
- goconst
# Ensures that the code was formatted with `gofmt -s`
- gofmt
# Identifies commonly misspelled words
- misspell
# Identifies unused function parameters
- unparam
3 changes: 3 additions & 0 deletions .graphqlconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"schemaPath": "graphql/schema.graphql"
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib
ethereum/blockwatch/testdata
packages/**/generated/**
*.d.ts
323 changes: 168 additions & 155 deletions CHANGELOG.md

Large diffs are not rendered by default.

45 changes: 42 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _outside_ of your `GOPATH`.
0x Mesh uses two main branches:

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

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

- [GNU Make](https://www.gnu.org/software/make/) If you are using a Unix-like OS, you probably already have this.
- [Go version 1.13.x](https://golang.org/dl/) (or use [the version manager called "g"](https://github.com/stefanmaric/g)).
- [Go version 1.15.x](https://golang.org/dl/) (or use [the version manager called "g"](https://github.com/stefanmaric/g)).
- [Node.js version >=11](https://nodejs.org/en/download/) (or use the [nvm version manager](https://github.com/creationix/nvm)).
- [Yarn package manager](https://yarnpkg.com/en/).
- [golangci-lint version 1.22.2](https://github.com/golangci/golangci-lint#install).
- [golangci-lint version 1.27.0](https://github.com/golangci/golangci-lint#install-golangci-lint).
- [Python](https://www.python.org/downloads/). (Many OSes already have this).
- [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`.
- 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`.
Expand All @@ -44,6 +44,20 @@ the dropdown menu in the GitHub UI to select `development`.
make deps
```

## Building TypeScript packages

Mesh contains some TypeScript packages, all of which are contained in a small monorepo in the **packages/** directory. Some
packages are published, and some are only used internally for development and testing.

To build all the TypeScript packages:

```
yarn build
```

You can also run `yarn build` inside of individual packages in order to just build that package and its dependencies. However,
changing any Go code will require running `yarn build` at the root of the project again.

## Running Tests

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

### Potential Issues

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

## Running prettier

0x Mesh uses a tool called [prettier](https://prettier.io/), which is a tool that
enforces a consistent style across the Typescript codebase. The continuous integration
pipeline will fail if Typescript code is not "prettified," so `prettier` must be run
to ensure that the code is properly formatted.

The prettier tool can be run using the following command from the top-level of the
0x-Mesh repository (outside of a directory inside **packages/**):

```bash
yarn prettier
```

## Managing Dependencies

Mesh uses [Go Modules](https://github.com/golang/go/wiki/Modules) for managing
Expand Down Expand Up @@ -144,3 +173,13 @@ following to your editor config:
// ...
}
```

### Prettier

Prettier configurations for most popular text editors can be found
[here](https://prettier.io/docs/en/editors.html).

### TSLint

TSLint configurations for most popular text editors can be found
[here](https://palantir.github.io/tslint/usage/third-party-tools/).
74 changes: 59 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: deps
deps: deps-ts wasmbrowsertest
deps: deps-ts wasmbrowsertest gqlgen


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


# gqlgen is a tool for embedding files so that they are included in binaries.
# This installs the CLI for go-bindata.
.PHONY: gqlgen
gqlgen: gobin
gobin github.com/99designs/gqlgen@v0.11.3


# wasmbrowsertest is required for running WebAssembly tests in the browser.
.PHONY: wasmbrowsertest
wasmbrowsertest: gobin
Expand All @@ -21,45 +28,72 @@ wasmbrowsertest: gobin

# Installs dependencies without updating Gopkg.lock or yarn.lock
.PHONY: deps-no-lockfile
deps-no-lockfile: deps-ts-no-lockfile wasmbrowsertest
deps-no-lockfile: deps-ts-no-lockfile wasmbrowsertest gqlgen


.PHONY: deps-ts-no-lockfile
deps-ts-no-lockfile:
yarn install --frozen-lockfile


# Provides a pre-commit convenience command that runs all of the tests and the linters
.PHONY: check
check: test-all lint


.PHONY: test-all
test-all: test-go test-wasm-browser test-ts test-browser-conversion test-browser-integration


.PHONY: test-go
test-go: test-go-parallel test-go-serial
test-go: generate test-go-parallel test-go-serial


.PHONY: test-go-parallel
test-go-parallel:
go test ./... -race -timeout 30s


.PHONY: test-key-value-stores
test-key-value-stores: test-key-value-stores-go test-key-value-stores-wasm


.PHONY: test-key-value-stores-go
test-key-value-stores-go:
ENABLE_KEY_VALUE_TESTS=true go test ./db


.PHONY: test-key-value-stores-wasm
test-key-value-stores-wasm:
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"


.PHONY: test-go-serial
test-go-serial:
go test ./zeroex/ordervalidator ./zeroex/orderwatch ./core -race -timeout 90s -p=1 --serial


.PHONY: test-browser-integration
test-browser-integration:
go test ./integration-tests -timeout 185s --enable-browser-integration-tests -run BrowserIntegration
test-browser-integration: test-browser-legacy-integration test-browser-graphql-integration


.PHONY: test-browser-legacy-integration
test-browser-legacy-integration:
go test ./integration-tests -timeout 60s --enable-browser-legacy-integration-tests -run BrowserLegacyIntegration


.PHONY: test-browser-graphql-integration
test-browser-graphql-integration:
go test ./integration-tests -timeout 60s --enable-browser-graphql-integration-tests -run BrowserGraphQLIntegration


.PHONY: test-browser-conversion
test-browser-conversion:
go test ./packages/browser/go/conversion-test -timeout 185s --enable-browser-conversion-tests -run BrowserConversions
go test ./packages/mesh-browser/go/conversion-test -timeout 185s --enable-browser-conversion-tests -run BrowserConversions


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


.PHONY: test-ts
Expand All @@ -68,21 +102,30 @@ test-ts:


.PHONY: lint
lint: lint-go lint-ts
lint: lint-go lint-ts lint-prettier


.PHONY: lint-go
lint-go:
golangci-lint run
golangci-lint run --timeout 2m


.PHONY: lint-ts
lint-ts:
yarn lint

.PHONY: lint-prettier
lint-prettier:
yarn prettier:ci


.PHONY: generate
generate:
go generate ./...


.PHONY: mesh
mesh:
mesh: generate
go install ./cmd/mesh


Expand All @@ -102,7 +145,7 @@ db-integrity-check:


.PHONY: cut-release
cut-release:
cut-release: generate
go run ./cmd/cut-release/main.go


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


.PHONY: docker-mesh
docker-mesh:
docker-mesh: generate
docker build . -t 0xorg/mesh -f ./dockerfiles/mesh/Dockerfile


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


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

0 comments on commit ea7d799

Please sign in to comment.