Skip to content
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
1 change: 1 addition & 0 deletions openethereum/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=parity
44 changes: 44 additions & 0 deletions openethereum/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM rust:1.47 AS builder

ARG VERSION

RUN apt-get update && apt-get install -y git curl wget pwgen vim htop gcc g++ cmake

RUN git clone https://github.com/openethereum/openethereum --branch=v${VERSION} \
&& cd openethereum \
&& cargo build --features secretstore --release \
&& cp ./target/release/openethereum /openethereum

FROM debian:buster

ENV USER_ID ${USER_ID:-1000}
ENV GROUP_ID ${GROUP_ID:-1000}

# Show backtraces
ENV RUST_BACKTRACE 1

RUN groupadd -g ${GROUP_ID} parity \
&& useradd -u ${USER_ID} -g parity -s /bin/bash -m -d /parity parity

RUN apt-get update && apt-get -y upgrade && apt-get install -y wget ca-certificates gpg \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /openethereum/target/release/openethereum /usr/bin

ENV GOSU_VERSION 1.11
RUN set -x \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true

VOLUME ["/parity"]
EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp

WORKDIR /parity

COPY scripts/docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
68 changes: 68 additions & 0 deletions openethereum/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Parity

## Start the cryptonode

```shell
docker-compose up -Vd *mainnet or testnet*`
```

## Usage
### Check synchronization
To check if the node is currently synchronizing:
```shell
curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
```

The response should look like the following:
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"startingBlock": "0x384", // 900
"currentBlock": "0x386", // 902
"highestBlock": "0x454" // 1108
} // Or `false` when not syncing
}
```

To simply check the number of the most recent block, run:
```shell
curl --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
```

The response should look like the following:
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x4b7" // 1207
}
```
### Create a new account

To create a new account you'd only need to come up with a `passphrase` which would be later used to access account information

```shell
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":["pretty_safe_passphrase"],"id":42}' localhost:8545
```

You can check if the account is present on the node and if the passphrase you've used works:
```shell
curl --data '{"method":"parity_testPassword","params":["*account address*","*account_passphrase*"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
```

### Account info

To get all accounts present on the node:

```shell
curl --data '{"method":"parity_allAccountsInfo","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
```

To get account balance:
```shell
curl --data '{"method":"eth_getBalance","params":["*account_address*"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
```

Feel free to check [Parity JSON RPC API](https://wiki.parity.io/JSONRPC) for more calls.
1 change: 1 addition & 0 deletions openethereum/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.0
1 change: 1 addition & 0 deletions openethereum/checksum.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b5a924c625de2f18981ec5514782c6eb4c14db82a8788f7084667a9d8bcb74f6 openethereum-3.1.0.zip
40 changes: 40 additions & 0 deletions openethereum/config/classic/parity.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
auto_update = "critical"
release_track = "stable"
public_node = false
no_download = false
no_consensus = false
chain = "classic"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[network]
port = 30303
min_peers = 100
max_peers = 200
discovery = true
warp = true
allow_ips = "all"
# Parity will maintain additional 128 peers for snapshot sync.
snapshot_peers = 128
# Parity will allow up to 512 pending connections.
max_pending_peers = 512

[footprint]
tracing = "off"
db_compaction = "ssd"
cache_size = 4096

[ui]
disable = true

[rpc]
disable = false
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "rpc", "secretstore", "parity_pubsub"]
26 changes: 26 additions & 0 deletions openethereum/config/dev/parity.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
no_persistent_txqueue = true
chain = "dev"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[network]
port = 30303
allow_ips = "all"
max_pending_peers = 512

[rpc]
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]

[secretstore]
disable = true # users do not run a secret store node

[network]
port = 30303
1 change: 1 addition & 0 deletions openethereum/config/dev/ss1.pw
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ss1pw
38 changes: 38 additions & 0 deletions openethereum/config/dev/ss1.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
no_persistent_txqueue = true
chain = "dev"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[account]
password = ["/parity/.local/share/io.parity.ethereum/ss1.pw"]

[secretstore]
disable = false
disable_http = false # This node will expose a Secret Store HTTP API
self_secret = "94647a791a0c207fb46a5091a88991e4a5fbcc21"
http_interface = "all" # The HTTP API is available locally only
http_port = 8010 # The Secret Store HTTP API is available at this port
acl_contract = "none" # Insecure, will be changed later on
server_set_contract = "none"
nodes = []
interface = "local"
port = 8011 # port used to communicated with other Secret Store nodes
path = "/parity/.local/share/io.parity.ethereum/secretstore"

[network]
port = 30303
allow_ips = "all"
max_pending_peers = 512

[rpc]
disable = false
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]

39 changes: 39 additions & 0 deletions openethereum/config/dev/ss2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
no_persistent_txqueue = true
chain = "dev"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[network]
port = 30303
allow_ips = "all"
max_pending_peers = 512

[account]
password = ["/parity/.local/share/io.parity.ethereum/ss2.pw"]

[secretstore]
disable = false
disable_http = false # This node will expose a Secret Store HTTP API
self_secret = "8b21c74c79cd94664e8f0a1d7cae2d83278b333c"
http_interface = "all" # The HTTP API is available locally only
http_port = 8010 # The Secret Store HTTP API is available at this port
acl_contract = "none" # Insecure, will be changed later on
server_set_contract = "none"
nodes = []
interface = "local"
port = 8011 # port used to communicated with other Secret Store nodes
path = "/parity/.local/share/io.parity.ethereum/secretstore"


[rpc]
disable = false
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]

38 changes: 38 additions & 0 deletions openethereum/config/dev/ss3.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
no_persistent_txqueue = true
chain = "dev"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[network]
port = 30303
allow_ips = "all"
max_pending_peers = 512

[account]
password = ["/parity/.local/share/io.parity.ethereum/ss3.pw"]

[secretstore]
disable = false
disable_http = false # This node will expose a Secret Store HTTP API
self_secret = "ce68e27f7b36e6e5c80d52f68c0cda6c2bcbf31d"
http_interface = "all" # The HTTP API is available locally only
http_port = 8010 # The Secret Store HTTP API is available at this port
acl_contract = "none" # Insecure, will be changed later on
server_set_contract = "none"
nodes = []
interface = "local"
port = 8011 # port used to communicated with other Secret Store nodes
path = "/parity/.local/share/io.parity.ethereum/secretstore"

[rpc]
disable = false
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "secretstore", "parity_pubsub"]

40 changes: 40 additions & 0 deletions openethereum/config/kotti/parity.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
auto_update = "critical"
release_track = "stable"
public_node = false
no_download = false
no_consensus = false
chain = "kotti"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[network]
port = 30303
min_peers = 100
max_peers = 200
discovery = true
warp = true
allow_ips = "all"
# Parity will maintain additional 128 peers for snapshot sync.
snapshot_peers = 128
# Parity will allow up to 512 pending connections.
max_pending_peers = 512

[footprint]
tracing = "off"
db_compaction = "ssd"
cache_size = 4096

[ui]
disable = true

[rpc]
disable = false
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "rpc", "secretstore", "parity_pubsub"]
41 changes: 41 additions & 0 deletions openethereum/config/kovan/openethereum.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[parity]
mode = "active"
mode_timeout = 300
mode_alarm = 3600
auto_update = "critical"
release_track = "stable"
public_node = false
no_download = false
no_consensus = false
chain = "kovan"
base_path = "/parity/.local/share/io.parity.ethereum"
db_path = "/parity/.local/share/io.parity.ethereum/chains"
keys_path = "/parity/.local/share/io.parity.ethereum/keys"

[network]
port = 30303
min_peers = 100
max_peers = 200
discovery = true
warp = true
allow_ips = "all"
# Parity will maintain additional 128 peers for snapshot sync.
snapshot_peers = 128
# Parity will allow up to 512 pending connections.
max_pending_peers = 512

[footprint]
tracing = "off"
db_compaction = "ssd"
cache_size = 4096

[ui]
disable = true

[rpc]
disable = false
port = 8545
interface = "0.0.0.0"
hosts = ["*"]
apis = ["web3", "eth", "net","parity","parity_accounts","personal", "traces", "rpc", "secretstore", "parity_pubsub"]

Loading