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

Add support for nethermind on Core #240

Open
wants to merge 1 commit into
base: core
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: 1 addition & 1 deletion blockscout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
vars:
volumes:
- device_name: /dev/sda1
volume_size: 128
volume_size: 256
delete_on_termination: true
tasks:
- name: Launch instance
Expand Down
6 changes: 3 additions & 3 deletions bootnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Create bootnode security group
hosts: localhost
gather_facts: False
tasks:
tasks:
- name: Create Security group
ec2_group:
ec2_access_key: "{{ access_key }}"
Expand All @@ -26,15 +26,15 @@
vars:
volumes:
- device_name: /dev/sda1
volume_size: 128
volume_size: 256
delete_on_termination: true
tasks:
- name: Launch instance
ec2:
ec2_access_key: "{{ access_key }}"
ec2_secret_key: "{{ secret_key }}"
key_name: "{{ awskeypair_name }}"
instance_tags:
instance_tags:
Name: "{{ bootnode_instance_name }}"
group: "{{ bootnode_security_group }}"
instance_type: "{{ bootnode_instance_type }}"
Expand Down
6 changes: 3 additions & 3 deletions explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Create explorer security group
hosts: localhost
gather_facts: False
tasks:
tasks:
- name: Create Security group
ec2_group:
ec2_access_key: "{{ access_key }}"
Expand All @@ -26,15 +26,15 @@
vars:
volumes:
- device_name: /dev/sda1
volume_size: 128
volume_size: 256
delete_on_termination: true
tasks:
- name: Launch instance
ec2:
ec2_access_key: "{{ access_key }}"
ec2_secret_key: "{{ secret_key }}"
key_name: "{{ awskeypair_name }}"
instance_tags:
instance_tags:
Name: "{{ explorer_instance_name }}"
group: "{{ explorer_security_group }}"
instance_type: "{{ explorer_instance_type }}"
Expand Down
126 changes: 0 additions & 126 deletions group_vars/all.example

This file was deleted.

4 changes: 4 additions & 0 deletions group_vars/all.network
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ NODE_PWD: "node.pwd" # don't change this one
NODE_SOURCE_DEB: "https://deb.nodesource.com/node_8.x"
PARITY_BIN_LOC: "https://releases.parity.io/ethereum/v2.6.2/x86_64-unknown-linux-gnu/parity"
PARITY_BIN_SHA256: "593c2f622fbb04a4baccd3388b66d2d1b1a5bd207201335ab5b26a3ed95d182f"
NETHERMIND_ZIP_LOC: "https://github.com/NethermindEth/nethermind/releases/download/1.0.3/nethermind-linux-amd64-1.0.3-712d3ed-20190905.zip"
NETHERMIND_ZIP_SHA256: "ba4213943e2e7da0d49a4b446114cd971c139cc9b0e04d403f5b4a9e8a31c97f"
BC_CLIENT: "parity"
ORCHESTRATOR_BIN_LOC: ""
ORCHESTRATOR_BIN_SHA256: ""

Expand All @@ -32,6 +35,7 @@ SCRIPTS_VALIDATOR_BRANCH: "core"
MAIN_REPO_FETCH: "poanetwork"
GENESIS_BRANCH: "core"
GENESIS_NETWORK_NAME: "Core"
NETHERMIND_NETWORK_NAME: "poacore"

MOC_ADDRESS: "0xcf260ea317555637c55f70e55dba8d5ad8414cb0"
BLK_GAS_LIMIT: "8000000"
Expand Down
2 changes: 1 addition & 1 deletion moc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
vars:
volumes:
- device_name: /dev/sda1
volume_size: 128
volume_size: 256
delete_on_termination: true
tasks:
- name: Launch instance
Expand Down
6 changes: 3 additions & 3 deletions netstat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Create netstat security group
hosts: localhost
gather_facts: False
tasks:
tasks:
- name: Create Security group
ec2_group:
ec2_access_key: "{{ access_key }}"
Expand All @@ -26,15 +26,15 @@
vars:
volumes:
- device_name: /dev/sda1
volume_size: 128
volume_size: 256
delete_on_termination: true
tasks:
- name: Launch instance
ec2:
ec2_access_key: "{{ access_key }}"
ec2_secret_key: "{{ secret_key }}"
key_name: "{{ awskeypair_name }}"
instance_tags:
instance_tags:
Name: "{{ netstat_instance_name }}"
group: "{{ netstat_security_group }}"
instance_type: "{{ netstat_instance_type }}"
Expand Down
27 changes: 27 additions & 0 deletions roles/bootnode-nethermind/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
- name: Download spec.json and bootnodes.txt
get_url: url={{ item }} dest={{ home }}/ mode=0644
with_items:
- "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/spec.json"
- "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/bootnodes.txt"

- name: Copy original chainspec before update
copy:
remote_src: yes
src: "{{ home }}/spec.json"
dest: "{{ home }}/spec-nethermind.json"
owner: "{{ username }}"
group: "{{ username }}"

- name: Update chainspec for nethermind
lineinfile:
path: "{{ home }}/spec-nethermind.json"
insertbefore: "eip140Transition"
line: "{{ item }}"
with_items:
- '"eip152Transition": "0xFFFFFFFF",'
- '"eip1108Transition": "0xFFFFFFFF",'
- '"eip1344Transition": "0xFFFFFFFF",'
- '"eip1884Transition": "0xFFFFFFFF",'
- '"eip2028Transition": "0xFFFFFFFF",'
- '"eip2200Transition": "0xFFFFFFFF",'
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
---
- name: Create directory parity_data/keys/NetworkName
file:
path: "{{ home }}/parity_data/keys/{{ GENESIS_NETWORK_NAME }}"
state: directory
mode: 0700
owner: "{{ username }}"
group: "{{ username }}"

- name: Create logs directories
file:
path: "/{{ home }}/logs/old"
state: directory
mode: 0755
owner: "{{ username }}"
group: "{{ username }}"

- name: Download spec.json
- name: Download spec.json and bootnodes.txt
get_url: url={{ item }} dest={{ home }}/ mode=0644
with_items:
- "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/spec.json"
Expand Down
8 changes: 0 additions & 8 deletions roles/netstat/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
---
- name: Create logs directories
file:
path: "/{{ home }}/logs/old"
state: directory
mode: 0755
owner: "{{ username }}"
group: "{{ username }}"

- git: repo=https://github.com/{{ MAIN_REPO_FETCH }}/eth-netstats dest={{ home }}/eth-netstats

- file: path={{ home }}/eth-netstats owner={{ username }} group={{ username }} recurse=yes
Expand Down
8 changes: 8 additions & 0 deletions roles/poa-logrotate/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
- name: Create logs directories
file:
path: "/{{ home }}/logs/old"
state: directory
mode: 0755
owner: "{{ username }}"
group: "{{ username }}"

- name: Install poa-logrotate conf
template: src=poa-logrotate.conf.j2 dest={{ home }}/poa-logrotate.conf owner=root group=root mode=0644

Expand Down
3 changes: 3 additions & 0 deletions roles/poa-nethermind/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: restart poa-nethermind
service: name=poa-nethermind state=restarted
64 changes: 64 additions & 0 deletions roles/poa-nethermind/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
- name: Install nethermind-specific packages
apt:
name: "{{ item }}"
state: "latest"
with_items:
- libsnappy-dev
- libc6-dev
- libc6
- unzip

- name: Create directory nethermind_data/
file:
path: "{{ home }}/nethermind_data/"
state: directory
mode: 0700
owner: "{{ username }}"
group: "{{ username }}"

- name: Download nethermind zip
get_url:
url: "{{ NETHERMIND_ZIP_LOC }}"
dest: "{{ home }}/{{ NETHERMIND_ZIP_LOC | basename }}"
mode: 0755
checksum: "sha256:{{ NETHERMIND_ZIP_SHA256 }}"
owner: "{{ username }}"
group: "{{ username }}"
notify:
- restart poa-nethermind

- name: Unzip nethermind zip
unarchive:
remote_src: yes
src: "{{ home }}/{{ NETHERMIND_ZIP_LOC | basename }}"
dest: "{{ home }}/"
owner: "{{ username }}"
group: "{{ username }}"

- name: Copy original config before update
copy:
remote_src: yes
src: "{{ home }}/configs/{{ NETHERMIND_NETWORK_NAME }}.cfg"
dest: "{{ home }}/node.cfg"
owner: "{{ username }}"
group: "{{ username }}"

- name: Update config values
lineinfile:
path: "{{ home }}/node.cfg"
regexp: "{{ item.key }}"
line: '"{{ item.key }}": {{ item.rawvalue }}'
with_items:
- { key: 'JsonRpcEnabled', rawvalue: "true," }
- { key: 'ChainSpecPath', rawvalue: '"{{ home }}/spec-nethermind.json",' }
- { key: 'BaseDbPath', rawvalue: '"{{ home }}/nethermind_data/{{ NETHERMIND_NETWORK_NAME }}",' }
- { key: 'LogFileName', rawvalue: '"{{ home }}/logs/nethermind.log"' }

- name: Install poa-nethermind service
template: src=poa-nethermind.j2 dest=/etc/systemd/system/poa-nethermind.service owner=root group=root mode=0755
notify:
- restart poa-nethermind

- name: Ensure poa-nethermind is running and enabled to start at boot
service: name=poa-nethermind state=started enabled=yes
Loading