Browse Source

update option namespaces

main
ghost 10 months ago
parent
commit
1c4930be38
  1. 15
      .env
  2. 9
      config/services.yaml
  3. 8
      src/Controller/CrontabController.php
  4. 2
      src/Controller/ModuleController.php
  5. 10
      src/Controller/RoomController.php

15
.env

@ -39,14 +39,20 @@ APP_KEVACOIN_PORT=9992
APP_KEVACOIN_USERNAME=EDIT_ME APP_KEVACOIN_USERNAME=EDIT_ME
APP_KEVACOIN_PASSWORD=EDIT_ME APP_KEVACOIN_PASSWORD=EDIT_ME
# Separated profit account (KevaCoin wallet)
APP_KEVACOIN_PROFIT_ACCOUNT=PROFIT
# Address to receive KevaCoin donations
APP_KEVACOIN_PROFIT_ADDRESS=EDIT_ME
# KevaCoin address to withdraw instance profit (empty to disable) # KevaCoin address to withdraw instance profit (empty to disable)
APP_KEVACOIN_WITHDRAW_PROFIT_ADDRESS= APP_KEVACOIN_PROFIT_WITHDRAW_ADDRESS=
# Keep at least n KVA on balance (for app transactions) # Keep at least n KVA on balance (for app transactions)
APP_KEVACOIN_WITHDRAW_BALANCE_MIN_KVA=1 APP_KEVACOIN_PROFIT_WITHDRAW_BALANCE_MIN_KVA=1
# Withdraw funds starting from (do not keep amount greater this value) # Withdraw funds starting from (do not keep amount greater this value)
APP_KEVACOIN_WITHDRAW_BALANCE_MAX_KVA=10 APP_KEVACOIN_PROFIT_WITHDRAW_BALANCE_MAX_KVA=10
# Share with other some mining pool to get free coins # Share with other some mining pool to get free coins
APP_KEVACOIN_MINE_POOL_URL=https://miningpoolstats.stream/kevacoin APP_KEVACOIN_MINE_POOL_URL=https://miningpoolstats.stream/kevacoin
@ -55,9 +61,6 @@ APP_KEVACOIN_MINE_SOLO_URL=https://kevacoin.org/tutorial_solo_mining.html
# Explorer URL # Explorer URL
APP_KEVACOIN_EXPLORER_URL=https://keva.one/explorer/address/ APP_KEVACOIN_EXPLORER_URL=https://keva.one/explorer/address/
# Address to receive kevacoin donations (make others able to fill node balance)
APP_KEVACOIN_BOOST_ADDRESS=EDIT_ME
# Pinned room namespaces, separated with | # Pinned room namespaces, separated with |
APP_KEVACOIN_ROOM_NAMESPACES_PINNED=EDIT_ME APP_KEVACOIN_ROOM_NAMESPACES_PINNED=EDIT_ME

9
config/services.yaml

@ -15,13 +15,14 @@ parameters:
app.kevacoin.port: '%env(APP_KEVACOIN_PORT)%' app.kevacoin.port: '%env(APP_KEVACOIN_PORT)%'
app.kevacoin.username: '%env(APP_KEVACOIN_USERNAME)%' app.kevacoin.username: '%env(APP_KEVACOIN_USERNAME)%'
app.kevacoin.password: '%env(APP_KEVACOIN_PASSWORD)%' app.kevacoin.password: '%env(APP_KEVACOIN_PASSWORD)%'
app.kevacoin.withdraw.profit.address: '%env(APP_KEVACOIN_WITHDRAW_PROFIT_ADDRESS)%' app.kevacoin.profit.account: '%env(APP_KEVACOIN_PROFIT_ACCOUNT)%'
app.kevacoin.withdraw.balance.min.kva: '%env(APP_KEVACOIN_WITHDRAW_BALANCE_MIN_KVA)%' app.kevacoin.profit.address: '%env(APP_KEVACOIN_PROFIT_ADDRESS)%'
app.kevacoin.withdraw.balance.max.kva: '%env(APP_KEVACOIN_WITHDRAW_BALANCE_MAX_KVA)%' app.kevacoin.profit.withdraw.address: '%env(APP_KEVACOIN_PROFIT_WITHDRAW_ADDRESS)%'
app.kevacoin.profit.withdraw.balance.min.kva: '%env(APP_KEVACOIN_PROFIT_WITHDRAW_BALANCE_MIN_KVA)%'
app.kevacoin.profit.withdraw.balance.max.kva: '%env(APP_KEVACOIN_PROFIT_WITHDRAW_BALANCE_MAX_KVA)%'
app.kevacoin.room.namespaces.pinned: '%env(APP_KEVACOIN_ROOM_NAMESPACES_PINNED)%' app.kevacoin.room.namespaces.pinned: '%env(APP_KEVACOIN_ROOM_NAMESPACES_PINNED)%'
app.kevacoin.room.namespaces.readonly: '%env(APP_KEVACOIN_ROOM_NAMESPACES_READONLY)%' app.kevacoin.room.namespaces.readonly: '%env(APP_KEVACOIN_ROOM_NAMESPACES_READONLY)%'
app.kevacoin.room.namespace.default: '%env(APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT)%' app.kevacoin.room.namespace.default: '%env(APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT)%'
app.kevacoin.boost.address: '%env(APP_KEVACOIN_BOOST_ADDRESS)%'
app.kevacoin.explorer.url: '%env(APP_KEVACOIN_EXPLORER_URL)%' app.kevacoin.explorer.url: '%env(APP_KEVACOIN_EXPLORER_URL)%'
app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_URL)%' app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_URL)%'
app.kevacoin.mine.solo.url: '%env(APP_KEVACOIN_MINE_SOLO_URL)%' app.kevacoin.mine.solo.url: '%env(APP_KEVACOIN_MINE_SOLO_URL)%'

8
src/Controller/CrontabController.php

@ -159,16 +159,16 @@ class CrontabController extends AbstractController
); );
// Withdraw profit // Withdraw profit
if ($this->getParameter('app.kevacoin.withdraw.profit.address')) if ($this->getParameter('app.kevacoin.profit.withdraw.address'))
{ {
if ($balance = $client->getBalance()) if ($balance = $client->getBalance())
{ {
if ($balance - $this->getParameter('app.kevacoin.withdraw.balance.min.kva') >= $this->getParameter('app.kevacoin.withdraw.balance.max.kva')) if ($balance - $this->getParameter('app.kevacoin.profit.withdraw.balance.min.kva') >= $this->getParameter('app.kevacoin.profit.withdraw.balance.max.kva'))
{ {
$client->sendToAddress( $client->sendToAddress(
$this->getParameter('app.kevacoin.withdraw.profit.address'), $this->getParameter('app.kevacoin.profit.withdraw.address'),
round( round(
$balance - $this->getParameter('app.kevacoin.withdraw.balance.min.kva'), $balance - $this->getParameter('app.kevacoin.profit.withdraw.balance.min.kva'),
8 8
), ),
'crontab/withdraw', 'crontab/withdraw',

2
src/Controller/ModuleController.php

@ -73,7 +73,7 @@ class ModuleController extends AbstractController
], ],
'boost' => 'boost' =>
[ [
'address' => $this->getParameter('app.kevacoin.boost.address') 'address' => $this->getParameter('app.kevacoin.profit.address')
], ],
'mine' => 'mine' =>
[ [

10
src/Controller/RoomController.php

@ -597,10 +597,7 @@ class RoomController extends AbstractController
'namespace' => $request->get('namespace'), 'namespace' => $request->get('namespace'),
'message' => $request->get('message'), 'message' => $request->get('message'),
'sign' => $request->get('sign'), 'sign' => $request->get('sign'),
'error' => sprintf( 'error' => $translator->trans('Insufficient funds'),
$translator->trans('Insufficient funds, wallet: %s'),
$this->getParameter('app.kevacoin.boost.address')
),
'_fragment' => 'latest' '_fragment' => 'latest'
] ]
); );
@ -956,10 +953,7 @@ class RoomController extends AbstractController
[ [
'mode' => $request->get('mode'), 'mode' => $request->get('mode'),
'name' => $name, 'name' => $name,
'error' => sprintf( 'error' => $translator->trans('Insufficient funds')
$translator->trans('Insufficient funds, wallet: %s'),
$this->getParameter('app.kevacoin.boost.address')
)
] ]
); );
} }

Loading…
Cancel
Save