Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rosetta-geth-sdk and enable validation in CI #146

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.
<!-- Add a clear and concise description of what the bug is. -->

**To Reproduce**
Steps to reproduce the behavior:
<!-- Steps to reproduce the behavior: -->

**Expected behavior**
A clear and concise description of what you expected to happen.
<!-- Add a clear and concise description of what you expected to happen. -->

**Additional context**
<!-- You can include any relevant stack traces or debugging output in this section. -->
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
<!-- Describe what the problem is. For example, “I'm always frustrated when [...]”. -->

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
<!-- Describe what you want to happen. -->

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
<!-- Describe any alternative solutions or features you've considered. -->

**Additional context**
Add any other context or screenshots about the feature request here.
<!-- Add any other context or screenshots about the feature request in this section. -->

30 changes: 30 additions & 0 deletions .github/actions/geth/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Geth Action'
description: 'Private chain of Ethereum for test using geth'
outputs:
rpc_url:
description: "url of JSON RPC"
value: http://localhost:8546
address:
description: "account of address"
value: "0x791Ab321d86Ca11feD3AfDff3e1b6bAD093d1220"
private_key:
description: "account of private key"
value: "9e5a7d25119ad38b0b66f89b3d6c492240f1a5484bc755c778bac209dbd4e2a5"
password:
description: "account of password"
value: "password"
network_id:
description: "network id"
value: "1"
chain_id:
description: "chain id"
value: "1"
runs:
using: "composite"
steps:
- id: init
run: cd ${{ github.action_path }}; docker-compose run --rm geth ./scripts/init.sh
shell: bash
- id: run
run: cd ${{ github.action_path }}; docker-compose up -d
shell: bash
26 changes: 26 additions & 0 deletions .github/actions/geth/config/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"config": {
"chainId": 1,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"clique": {
"period": 0,
"epoch": 30000
}
},
"difficulty": "1",
"gasLimit": "8000000",
"extradata": "0x00000000000000000000000000000000000000000000000000000000000000004cdbd835fe18bd93cca39a262cff72dbac99e24f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"alloc": {
"622Fbe99b3A378FAC736bf29d7e23B85E18816eB": { "balance": "888888888888888888888888" },
"4cdBd835fE18BD93ccA39A262Cff72dbAC99E24F": { "balance": "888888888888888888888888" },
"791Ab321d86Ca11feD3AfDff3e1b6bAD093d1220": { "balance": "888888888888888888888888" }
}
}
1 change: 1 addition & 0 deletions .github/actions/geth/config/password.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
password
1 change: 1 addition & 0 deletions .github/actions/geth/config/private-key1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f78955a540221936a4eba0edd96547fc400d44f7f2107be4c7e72f6076a649d1
1 change: 1 addition & 0 deletions .github/actions/geth/config/private-key2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de665c1c4bb8a5b74386dd8fb17dd2ba9a59db6cc11aea4d27ebdc5ecf46c13c
1 change: 1 addition & 0 deletions .github/actions/geth/config/private-key3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9e5a7d25119ad38b0b66f89b3d6c492240f1a5484bc755c778bac209dbd4e2a5
31 changes: 31 additions & 0 deletions .github/actions/geth/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2022 Coinbase, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version: '3'

services:
geth:
image: ethereum/client-go:v1.10.23
environment:
- DEVMODE=true
volumes:
- "./.ethereum:/root/.ethereum"
- "./config:/root/config"
- "./scripts:/root/scripts"
working_dir: /root
entrypoint: sh
ports:
- "8546:8545"
command: ./scripts/run.sh

9 changes: 9 additions & 0 deletions .github/actions/geth/scripts/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -eu

geth init /root/config/genesis.json
geth --password /root/config/password.txt account import /root/config/private-key1.txt
geth --password /root/config/password.txt account import /root/config/private-key2.txt
geth --password /root/config/password.txt account import /root/config/private-key3.txt

22 changes: 22 additions & 0 deletions .github/actions/geth/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

set -eu

geth \
--verbosity 5 \
--nodiscover \
--syncmode 'full' \
--nat none \
--port 30310 \
--http \
--http.addr '0.0.0.0' \
--http.port 8545 \
--http.vhosts '*' \
--http.api 'personal,eth,net,web3,txpool,miner,debug' \
--networkid '1' \
--mine \
--miner.etherbase '0x4cdBd835fE18BD93ccA39A262Cff72dbAC99E24F' \
--miner.gasprice 0 \
--unlock "0,1,2" \
--password /root/config/password.txt \
--allow-insecure-unlock
Loading