fix saving of account address

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-04-26 12:33:57 +02:00
parent 414b13909a
commit 88772e38b1
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 22 additions and 13 deletions

View File

@ -1,5 +1,9 @@
---
# map of network IDs
# Security
geth_account_address: ~
geth_account_password: ~
# Map of network IDs
miner_network_ids:
mainnet: 1
frontier: 1
@ -8,6 +12,7 @@ miner_network_ids:
ropsten: 3
rinkeby: 4
# Container config
geth_cont_image: 'ethereum/client-go:v1.8.27'
geth_cont_name: 'geth'
@ -49,10 +54,6 @@ geth_cache: 1536
# Address to advertise
geth_public_addr: '{{ ansible_host }}'
# security
geth_account_address: ~
geth_account_password: ~
# Consul config
geth_consul_default_tags:
- geth

View File

@ -30,15 +30,23 @@
- '{{ geth_cont_vol }}/keys:/keys:rw'
when: account_files.files | length == 0
- name: Geth | Find all account files
find:
paths: '{{ geth_keys_path }}'
patterns: 'UTC--*'
file_type: file
register: account_files
- name: Geth | Save account address
uri:
url: http://localhost:{{ geth_rpc_port }}/
method: POST
body: '{"id": 1, "method": "eth_accounts"}'
body_format: json
return_content: yes
register: geth_accounts
slurp:
src: '{{ account_files.files[0].path }}'
register: geth_account
- name: Geth | Extract account address
set_fact:
geth_account_address: '{{ node_info.json.result | first }}'
geth_account_address: '{{ (geth_account.content | b64decode | from_json)["address"] }}'
- name: Geth | Save account address to file
copy:
dest: '{{ geth_keys_path }}/address'
content: '{{ geth_account_address | mandatory }}'