apt -y install mysql-server
wget http://dl.fogworks.io/local-miner/local-dmc-miner.tar.gz -P /home/
mkdir /cyfs/
mkdir /cyfs/etc
mkdir /cyfs/etc/desc
mkdir /cyfs/etc/gateway
mkdir /cyfs/app
mkdir /cyfs/data
mkdir /cyfs/data/app
mkdir /cyfs/data/app/dmc-miner

cd /home
tar -zxvf local-dmc-miner.tar.gz
cd local-dmc-miner
cp gateway.toml /cyfs/etc/gateway

cd cyfs-mnemonic-desc-tool/
chmod +x cyfs-mnemonic-desc
./cyfs-mnemonic-desc -r create_mnemonic
./cyfs-mnemonic-desc -r create_people_by_mnemonic
./cyfs-mnemonic-desc -r add_ood

cd desc
cp ood_*.desc device.desc
cp ood_*.sec device.sec
cp device* /cyfs/etc/desc

touch /cyfs/data/app/dmc-miner/conf.toml
echo "chunk_path_list = [
['/cyfs/data', 2],
]

[dmc]
dmc_account=''
dmc_key=''
dmc_server='http://explorer.dmctech.io'
dmc_tracker_server='http://tracker.dmctech.io'
http_domain='http://154.7.3.35:32855'

[db]
host='127.0.0.1'
username='root'
password='admin123'
db_name='dmc'" >>/cyfs/data/app/dmc-miner/conf.toml
