Skip to content

Commit 2bb799e

Browse files
committed
Feature: Integrate OpenEthereum
1 parent 9650dbc commit 2bb799e

File tree

16 files changed

+526
-0
lines changed

16 files changed

+526
-0
lines changed

openethereum/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSE_PROJECT_NAME=parity

openethereum/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM rust:1.47 AS builder
2+
3+
ARG VERSION
4+
5+
RUN apt-get update && apt-get install -y git curl wget pwgen vim htop gcc g++ cmake
6+
7+
RUN git clone https://github.com/openethereum/openethereum --branch=release/v${VERSION} \
8+
&& cd openethereum \
9+
&& cargo build --features secretstore --release \
10+
&& cp ./target/release/openethereum /openethereum
11+
12+
FROM debian:buster
13+
14+
ENV USER_ID ${USER_ID:-1000}
15+
ENV GROUP_ID ${GROUP_ID:-1000}
16+
17+
# Show backtraces
18+
ENV RUST_BACKTRACE 1
19+
20+
RUN groupadd -g ${GROUP_ID} parity \
21+
&& useradd -u ${USER_ID} -g parity -s /bin/bash -m -d /parity parity
22+
23+
RUN apt-get update && apt-get -y upgrade && apt-get install -y wget ca-certificates gpg \
24+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
25+
26+
COPY --from=builder /openethereum/target/release/openethereum /usr/bin
27+
28+
ENV GOSU_VERSION 1.11
29+
RUN set -x \
30+
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
31+
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
32+
&& export GNUPGHOME="$(mktemp -d)" \
33+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
34+
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
35+
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
36+
&& chmod +x /usr/local/bin/gosu \
37+
&& gosu nobody true
38+
39+
VOLUME ["/parity"]
40+
EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp
41+
42+
WORKDIR /parity
43+
44+
COPY scripts/docker-entrypoint.sh /usr/local/bin/
45+
ENTRYPOINT ["docker-entrypoint.sh"]

openethereum/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Parity
2+
3+
## Start the cryptonode
4+
5+
```shell
6+
docker-compose up -Vd *mainnet or testnet*`
7+
```
8+
9+
## Usage
10+
### Check synchronization
11+
To check if the node is currently synchronizing:
12+
```shell
13+
curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
14+
```
15+
16+
The response should look like the following:
17+
```json
18+
{
19+
"id": 1,
20+
"jsonrpc": "2.0",
21+
"result": {
22+
"startingBlock": "0x384", // 900
23+
"currentBlock": "0x386", // 902
24+
"highestBlock": "0x454" // 1108
25+
} // Or `false` when not syncing
26+
}
27+
```
28+
29+
To simply check the number of the most recent block, run:
30+
```shell
31+
curl --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
32+
```
33+
34+
The response should look like the following:
35+
```json
36+
{
37+
"id": 1,
38+
"jsonrpc": "2.0",
39+
"result": "0x4b7" // 1207
40+
}
41+
```
42+
### Create a new account
43+
44+
To create a new account you'd only need to come up with a `passphrase` which would be later used to access account information
45+
46+
```shell
47+
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":["pretty_safe_passphrase"],"id":42}' localhost:8545
48+
```
49+
50+
You can check if the account is present on the node and if the passphrase you've used works:
51+
```shell
52+
curl --data '{"method":"parity_testPassword","params":["*account address*","*account_passphrase*"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
53+
```
54+
55+
### Account info
56+
57+
To get all accounts present on the node:
58+
59+
```shell
60+
curl --data '{"method":"parity_allAccountsInfo","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
61+
```
62+
63+
To get account balance:
64+
```shell
65+
curl --data '{"method":"eth_getBalance","params":["*account_address*"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
66+
```
67+
68+
Feel free to check [Parity JSON RPC API](https://wiki.parity.io/JSONRPC) for more calls.

openethereum/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.0

openethereum/checksum.sha256

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b5a924c625de2f18981ec5514782c6eb4c14db82a8788f7084667a9d8bcb74f6 openethereum-3.1.0.zip
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[parity]
2+
mode = "active"
3+
mode_timeout = 300
4+
mode_alarm = 3600
5+
auto_update = "critical"
6+
release_track = "stable"
7+
public_node = false
8+
no_download = false
9+
no_consensus = false
10+
chain = "classic"
11+
base_path = "/parity/.local/share/io.parity.ethereum"
12+
db_path = "/parity/.local/share/io.parity.ethereum/chains"
13+
keys_path = "/parity/.local/share/io.parity.ethereum/keys"
14+
15+
[network]
16+
port = 30303
17+
min_peers = 100
18+
max_peers = 200
19+
discovery = true
20+
warp = true
21+
allow_ips = "all"
22+
# Parity will maintain additional 128 peers for snapshot sync.
23+
snapshot_peers = 128
24+
# Parity will allow up to 512 pending connections.
25+
max_pending_peers = 512
26+
27+
[footprint]
28+
tracing = "off"
29+
db_compaction = "ssd"
30+
cache_size = 4096
31+
32+
[ui]
33+
disable = true
34+
35+
[rpc]
36+
disable = false
37+
port = 8545
38+
interface = "0.0.0.0"
39+
hosts = ["*"]
40+
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "rpc", "secretstore", "parity_pubsub"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[parity]
2+
mode = "active"
3+
mode_timeout = 300
4+
mode_alarm = 3600
5+
no_persistent_txqueue = true
6+
chain = "dev"
7+
base_path = "/parity/.local/share/io.parity.ethereum"
8+
db_path = "/parity/.local/share/io.parity.ethereum/chains"
9+
keys_path = "/parity/.local/share/io.parity.ethereum/keys"
10+
11+
[network]
12+
port = 30303
13+
allow_ips = "all"
14+
max_pending_peers = 512
15+
16+
[rpc]
17+
port = 8545
18+
interface = "0.0.0.0"
19+
hosts = ["*"]
20+
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]
21+
22+
[secretstore]
23+
disable = true # users do not run a secret store node
24+
25+
[network]
26+
port = 30303

openethereum/config/dev/ss1.pw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ss1pw

openethereum/config/dev/ss1.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[parity]
2+
mode = "active"
3+
mode_timeout = 300
4+
mode_alarm = 3600
5+
no_persistent_txqueue = true
6+
chain = "dev"
7+
base_path = "/parity/.local/share/io.parity.ethereum"
8+
db_path = "/parity/.local/share/io.parity.ethereum/chains"
9+
keys_path = "/parity/.local/share/io.parity.ethereum/keys"
10+
11+
[account]
12+
password = ["/parity/.local/share/io.parity.ethereum/ss1.pw"]
13+
14+
[secretstore]
15+
disable = false
16+
disable_http = false # This node will expose a Secret Store HTTP API
17+
self_secret = "94647a791a0c207fb46a5091a88991e4a5fbcc21"
18+
http_interface = "all" # The HTTP API is available locally only
19+
http_port = 8010 # The Secret Store HTTP API is available at this port
20+
acl_contract = "none" # Insecure, will be changed later on
21+
server_set_contract = "none"
22+
nodes = []
23+
interface = "local"
24+
port = 8011 # port used to communicated with other Secret Store nodes
25+
path = "/parity/.local/share/io.parity.ethereum/secretstore"
26+
27+
[network]
28+
port = 30303
29+
allow_ips = "all"
30+
max_pending_peers = 512
31+
32+
[rpc]
33+
disable = false
34+
port = 8545
35+
interface = "0.0.0.0"
36+
hosts = ["*"]
37+
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]
38+

openethereum/config/dev/ss2.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[parity]
2+
mode = "active"
3+
mode_timeout = 300
4+
mode_alarm = 3600
5+
no_persistent_txqueue = true
6+
chain = "dev"
7+
base_path = "/parity/.local/share/io.parity.ethereum"
8+
db_path = "/parity/.local/share/io.parity.ethereum/chains"
9+
keys_path = "/parity/.local/share/io.parity.ethereum/keys"
10+
11+
[network]
12+
port = 30303
13+
allow_ips = "all"
14+
max_pending_peers = 512
15+
16+
[account]
17+
password = ["/parity/.local/share/io.parity.ethereum/ss2.pw"]
18+
19+
[secretstore]
20+
disable = false
21+
disable_http = false # This node will expose a Secret Store HTTP API
22+
self_secret = "8b21c74c79cd94664e8f0a1d7cae2d83278b333c"
23+
http_interface = "all" # The HTTP API is available locally only
24+
http_port = 8010 # The Secret Store HTTP API is available at this port
25+
acl_contract = "none" # Insecure, will be changed later on
26+
server_set_contract = "none"
27+
nodes = []
28+
interface = "local"
29+
port = 8011 # port used to communicated with other Secret Store nodes
30+
path = "/parity/.local/share/io.parity.ethereum/secretstore"
31+
32+
33+
[rpc]
34+
disable = false
35+
port = 8545
36+
interface = "0.0.0.0"
37+
hosts = ["*"]
38+
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]
39+

0 commit comments

Comments
 (0)