add keystore to faucet geth to manage account

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-03-20 09:58:38 +01:00
parent 45ee58d675
commit a98ea99095
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 29 additions and 3 deletions

View File

@ -2,4 +2,6 @@
# stage contains the network name
faucet_network: '{{ stage }}'
faucet_account_pass: '{{lookup("passwordstore", "services/faucet/account-pass")}}'
faucet_account_addr: '{{lookup("passwordstore", "services/faucet/account-addr")}}'
faucet_account_json: '{{lookup("passwordstore", "services/faucet/account-json")}}'
faucet_domain: 'faucet-{{ stage }}.status.im'

View File

@ -7,6 +7,8 @@ miner_network_ids:
rinkeby: 4
faucet_account_pass: ~
faucet_account_addr: ~
faucet_account_json: ~
faucet_domain: ~
faucet_network: ~
faucet_network_id: '{{ miner_network_ids[faucet_network] | mandatory }}'
@ -22,6 +24,7 @@ faucet_geth_name: 'faucet-geth'
faucet_geth_vol: '/docker/{{ faucet_geth_name }}'
faucet_geth_main_port: 30303
faucet_geth_rpc_port: 8545
faucet_geth_rcp_api: 'eth,net,web3,admin,personal,shh'
faucet_geth_alias: 'geth,localhost'
# generic container settings

View File

@ -1,11 +1,30 @@
---
- name: Create container folders
file:
path: '{{ faucet_geth_vol }}/data'
path: '{{ item }}'
state: directory
mode: 0750
owner: dockremap
group: docker
with_items:
- '{{ faucet_geth_vol }}/data'
- '{{ faucet_geth_vol }}/data/keystore'
- name: Create faucet wallet keystore file
copy:
dest: '{{ faucet_geth_vol }}/data/keystore/wallet.json'
content: '{{ faucet_account_json }}'
mode: 0640
owner: dockremap
group: docker
- name: Create faucet wallet password file
copy:
dest: '{{ faucet_geth_vol }}/data/keystore/wallet.pass'
content: '{{ faucet_account_pass }}'
mode: 0640
owner: dockremap
group: docker
- name: 'Create geth container: {{ faucet_geth_name }}'
docker_container:
@ -20,9 +39,11 @@
command: |
--datadir=/data
--networkid={{ faucet_network_id | mandatory }}
--password=/data/keystore/wallet.pass
--unlock={{ faucet_account_addr }}
--syncmode=light
--rpc
--rpcapi=eth
--rpcapi={{ faucet_geth_rcp_api }}
--rpcvhosts={{ faucet_geth_alias }}
--rpcaddr=0.0.0.0
--rpcport={{ faucet_geth_rpc_port }}
@ -31,4 +52,4 @@
- '127.0.0.1:{{ faucet_geth_rpc_port }}:{{ faucet_geth_rpc_port }}'
- '{{ faucet_geth_main_port }}:{{ faucet_geth_main_port }}'
volumes:
- '{{ faucet_geth_vol }}/data:/date'
- '{{ faucet_geth_vol }}/data:/data'