Skip to content

Commit 403a35a

Browse files
Merge pull request #2 from coinbase/patrick/initial-commit
Initial Commit
2 parents 16f1f3a + 5bab5c3 commit 403a35a

File tree

107 files changed

+128004
-1
lines changed

Some content is hidden

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

107 files changed

+128004
-1
lines changed

.circleci/config.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Copyright 2020 Coinbase, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version: 2.1
16+
executors:
17+
default:
18+
docker:
19+
- image: circleci/golang:1.13
20+
user: root # go directory is owned by root
21+
working_directory: /go/src/github.com/coinbase/rosetta-ethereum
22+
environment:
23+
- GO111MODULE: "on"
24+
25+
fast-checkout: &fast-checkout
26+
attach_workspace:
27+
at: /go
28+
29+
jobs:
30+
setup:
31+
executor:
32+
name: default
33+
steps:
34+
- checkout
35+
- run: make deps
36+
- persist_to_workspace:
37+
root: /go
38+
paths:
39+
- src
40+
- bin
41+
- pkg/mod/cache
42+
test:
43+
executor:
44+
name: default
45+
steps:
46+
- *fast-checkout
47+
- run: make test
48+
lint:
49+
executor:
50+
name: default
51+
steps:
52+
- *fast-checkout
53+
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
54+
- run: make lint
55+
check-license:
56+
executor:
57+
name: default
58+
steps:
59+
- *fast-checkout
60+
- run: make check-license
61+
check-format:
62+
executor:
63+
name: default
64+
steps:
65+
- *fast-checkout
66+
- run: make check-format
67+
coverage:
68+
executor:
69+
name: default
70+
steps:
71+
- *fast-checkout
72+
- run: make coverage
73+
salus:
74+
machine: true
75+
steps:
76+
- checkout
77+
- run: make salus
78+
79+
workflows:
80+
version: 2
81+
build:
82+
jobs:
83+
- setup
84+
- test:
85+
requires:
86+
- setup
87+
- lint:
88+
requires:
89+
- setup
90+
- check-license:
91+
requires:
92+
- setup
93+
- check-format:
94+
requires:
95+
- setup
96+
- coverage:
97+
requires:
98+
- setup
99+
- salus
100+
101+
notify:
102+
webhooks:
103+
- url: https://coveralls.io/webhook?repo_token=$COVERALLS_TOKEN

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ethereum-data
2+
cli-data
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Additional context**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Fixes # .
2+
3+
### Motivation
4+
<!--
5+
Does this solve a bug? Enable a new use-case? Improve an existing behavior? Concrete examples are helpful here.
6+
-->
7+
8+
### Solution
9+
<!--
10+
What is the solution here from a high level. What are the key technical decisions and why were they made?
11+
-->
12+
13+
### Open questions
14+
<!--
15+
(optional) Any open questions or feedback on design desired?
16+
-->

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2020 Coinbase, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version: 2
16+
17+
updates:
18+
- package-ecosystem: "gomod"
19+
directory: "/"
20+
schedule:
21+
interval: "daily"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rosetta-ethereum
2+
ethereum-data
3+
cli-data

CONTRIBUTING.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Contributing to rosetta-ethereum
2+
3+
## Code of Conduct
4+
5+
All interactions with this project follow our [Code of Conduct][code-of-conduct].
6+
By participating, you are expected to honor this code. Violators can be banned
7+
from further participation in this project, or potentially all Coinbase projects.
8+
9+
[code-of-conduct]: https://github.com/coinbase/code-of-conduct
10+
11+
## Bug Reports
12+
13+
* Ensure your issue [has not already been reported][1]. It may already be fixed!
14+
* Include the steps you carried out to produce the problem.
15+
* Include the behavior you observed along with the behavior you expected, and
16+
why you expected it.
17+
* Include any relevant stack traces or debugging output.
18+
19+
## Feature Requests
20+
21+
We welcome feedback with or without pull requests. If you have an idea for how
22+
to improve the project, great! All we ask is that you take the time to write a
23+
clear and concise explanation of what need you are trying to solve. If you have
24+
thoughts on _how_ it can be solved, include those too!
25+
26+
The best way to see a feature added, however, is to submit a pull request.
27+
28+
## Pull Requests
29+
30+
* Before creating your pull request, it's usually worth asking if the code
31+
you're planning on writing will actually be considered for merging. You can
32+
do this by [opening an issue][1] and asking. It may also help give the
33+
maintainers context for when the time comes to review your code.
34+
35+
* Ensure your [commit messages are well-written][2]. This can double as your
36+
pull request message, so it pays to take the time to write a clear message.
37+
38+
* Add tests for your feature. You should be able to look at other tests for
39+
examples. If you're unsure, don't hesitate to [open an issue][1] and ask!
40+
41+
* Submit your pull request!
42+
43+
## Support Requests
44+
45+
For security reasons, any communication referencing support tickets for Coinbase
46+
products will be ignored. The request will have its content redacted and will
47+
be locked to prevent further discussion.
48+
49+
All support requests must be made via [our support team][3].
50+
51+
[1]: https://github.com/coinbase/rosetta-ethereum/issues
52+
[2]: https://chris.beams.io/posts/git-commit/#seven-rules
53+
[3]: https://support.coinbase.com/customer/en/portal/articles/2288496-how-can-i-contact-coinbase-support-

Dockerfile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright 2020 Coinbase, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Compile golang
16+
FROM ubuntu:18.04 as golang-builder
17+
18+
RUN mkdir -p /app \
19+
&& chown -R nobody:nogroup /app
20+
WORKDIR /app
21+
22+
RUN apt-get update && apt-get install -y curl make gcc g++ git
23+
ENV GOLANG_VERSION 1.15.2
24+
ENV GOLANG_DOWNLOAD_SHA256 b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552
25+
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
26+
27+
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
28+
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
29+
&& tar -C /usr/local -xzf golang.tar.gz \
30+
&& rm golang.tar.gz
31+
32+
ENV GOPATH /go
33+
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
34+
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
35+
36+
# Compile geth
37+
FROM golang-builder as geth-builder
38+
39+
# VERSION: go-ethereum v.1.9.23
40+
RUN git clone https://github.com/ethereum/go-ethereum \
41+
&& cd go-ethereum \
42+
&& git checkout 8c2f271528f9cccf541c6ea1c022e98407f26872
43+
44+
RUN cd go-ethereum \
45+
&& make geth
46+
47+
RUN mv go-ethereum/build/bin/geth /app/geth \
48+
&& rm -rf go-ethereum
49+
50+
# Compile rosetta-ethereum
51+
FROM golang-builder as rosetta-builder
52+
53+
# Use native remote build context to build in any directory
54+
COPY . src
55+
RUN cd src \
56+
&& go build
57+
58+
RUN mv src/rosetta-ethereum /app/rosetta-ethereum \
59+
&& mkdir /app/ethereum \
60+
&& mv src/ethereum/call_tracer.js /app/ethereum/call_tracer.js \
61+
&& mv src/ethereum/geth.toml /app/ethereum/geth.toml \
62+
&& rm -rf src
63+
64+
## Build Final Image
65+
FROM ubuntu:18.04
66+
67+
RUN mkdir -p /app \
68+
&& chown -R nobody:nogroup /app \
69+
&& mkdir -p /data \
70+
&& chown -R nobody:nogroup /data
71+
72+
WORKDIR /app
73+
74+
# Copy binary from geth-builder
75+
COPY --from=geth-builder /app/geth /app/geth
76+
77+
# Copy binary from rosetta-builder
78+
COPY --from=rosetta-builder /app/ethereum /app/ethereum
79+
COPY --from=rosetta-builder /app/rosetta-ethereum /app/rosetta-ethereum
80+
81+
# Set permissions for everything added to /app
82+
RUN chmod -R 755 /app/*
83+
84+
CMD ["/app/rosetta-ethereum", "run"]

0 commit comments

Comments
 (0)