mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-05 22:10:10 +00:00
Add statsfornerds: alternative site, node alias, node id, 1ML link
This commit is contained in:
parent
ae338adcfc
commit
d257848940
11
.env-sample
11
.env-sample
@ -18,17 +18,20 @@ MARKET_PRICE_APIS = https://blockchain.info/ticker, https://api.yadio.io/exrates
|
|||||||
|
|
||||||
# Host e.g. robosats.com
|
# Host e.g. robosats.com
|
||||||
HOST_NAME = ''
|
HOST_NAME = ''
|
||||||
|
|
||||||
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = 'django-insecure-6^&6uw$b5^en%(cu2kc7_o)(mgpazx#j_znwlym0vxfamn2uo-'
|
SECRET_KEY = 'django-insecure-6^&6uw$b5^en%(cu2kc7_o)(mgpazx#j_znwlym0vxfamn2uo-'
|
||||||
|
|
||||||
# e.g. robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion
|
# e.g. robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion
|
||||||
ONION_LOCATION = ''
|
ONION_LOCATION = ''
|
||||||
|
|
||||||
# Link to robosats mainnet/testnet (shown on frontend in statsfornerds so users can switch mainnet/testnet)
|
# Link to robosats alternative site (shown in frontend in statsfornerds so users can switch mainnet/testnet)
|
||||||
THE_OTHER_ROBOSATS = 'testnet/mainnet.onion'
|
ALTERNATIVE_SITE = 'RoboSats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion'
|
||||||
|
ALTERNATIVE_NAME = 'RoboSats Mainnet'
|
||||||
|
|
||||||
# Lightning node open info, url to amboss and 1ML
|
# Lightning node open info, url to amboss and 1ML
|
||||||
AMBOSS = ''
|
NODE_ALIAS = '🤖RoboSats⚡(RoboDevs)'
|
||||||
ONEML = ''
|
NODE_ID = '033b58d7......'
|
||||||
|
|
||||||
# Trade fee in percentage %
|
# Trade fee in percentage %
|
||||||
FEE = 0.002
|
FEE = 0.002
|
||||||
|
@ -27,11 +27,11 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.follow_hold_invoices()
|
self.follow_hold_invoices()
|
||||||
|
except Exception as e:
|
||||||
|
self.stdout.write(str(e))
|
||||||
|
try:
|
||||||
self.send_payments()
|
self.send_payments()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if 'database is locked' in str(e):
|
|
||||||
self.stdout.write('database is locked')
|
|
||||||
|
|
||||||
self.stdout.write(str(e))
|
self.stdout.write(str(e))
|
||||||
|
|
||||||
def follow_hold_invoices(self):
|
def follow_hold_invoices(self):
|
||||||
|
10
api/utils.py
10
api/utils.py
@ -54,9 +54,19 @@ lnd_v_cache = {}
|
|||||||
@ring.dict(lnd_v_cache, expire=3600) #keeps in cache for 3600 seconds
|
@ring.dict(lnd_v_cache, expire=3600) #keeps in cache for 3600 seconds
|
||||||
def get_lnd_version():
|
def get_lnd_version():
|
||||||
|
|
||||||
|
# Reads lnd version from CLI
|
||||||
stream = os.popen('lnd --version')
|
stream = os.popen('lnd --version')
|
||||||
lnd_version = stream.read()[:-1]
|
lnd_version = stream.read()[:-1]
|
||||||
|
|
||||||
|
# If dockerized, the command above will fail.
|
||||||
|
# Instead, return LND_VERSION envvar used for docker image.
|
||||||
|
# Otherwise it would require LND's version.grpc libraries...
|
||||||
|
if lnd_version == '':
|
||||||
|
try:
|
||||||
|
lnd_version = config('LND_VERSION')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return lnd_version
|
return lnd_version
|
||||||
|
|
||||||
robosats_commit_cache = {}
|
robosats_commit_cache = {}
|
||||||
|
@ -532,6 +532,11 @@ class InfoView(ListAPIView):
|
|||||||
context['lifetime_satoshis_settled'] = lifetime_volume_settled
|
context['lifetime_satoshis_settled'] = lifetime_volume_settled
|
||||||
context['lnd_version'] = get_lnd_version()
|
context['lnd_version'] = get_lnd_version()
|
||||||
context['robosats_running_commit_hash'] = get_commit_robosats()
|
context['robosats_running_commit_hash'] = get_commit_robosats()
|
||||||
|
context['alternative_site'] = config('ALTERNATIVE_SITE')
|
||||||
|
context['alternative_name'] = config('ALTERNATIVE_NAME')
|
||||||
|
context['node_alias'] = config('NODE_ALIAS')
|
||||||
|
context['node_id'] = config('NODE_ID')
|
||||||
|
context['network'] = config('NETWORK')
|
||||||
context['fee'] = FEE
|
context['fee'] = FEE
|
||||||
context['bond_size'] = float(config('BOND_SIZE'))
|
context['bond_size'] = float(config('BOND_SIZE'))
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
|
@ -19,6 +19,8 @@ import PublicIcon from '@mui/icons-material/Public';
|
|||||||
import NumbersIcon from '@mui/icons-material/Numbers';
|
import NumbersIcon from '@mui/icons-material/Numbers';
|
||||||
import PasswordIcon from '@mui/icons-material/Password';
|
import PasswordIcon from '@mui/icons-material/Password';
|
||||||
import ContentCopy from "@mui/icons-material/ContentCopy";
|
import ContentCopy from "@mui/icons-material/ContentCopy";
|
||||||
|
import DnsIcon from '@mui/icons-material/Dns';
|
||||||
|
import WebIcon from '@mui/icons-material/Web';
|
||||||
|
|
||||||
// pretty numbers
|
// pretty numbers
|
||||||
function pn(x) {
|
function pn(x) {
|
||||||
@ -42,6 +44,8 @@ export default class BottomBar extends Component {
|
|||||||
robosats_running_commit_hash: '000000000000000',
|
robosats_running_commit_hash: '000000000000000',
|
||||||
openProfile: false,
|
openProfile: false,
|
||||||
profileShown: false,
|
profileShown: false,
|
||||||
|
alternative_site: 'robosats...',
|
||||||
|
node_id: '00000000',
|
||||||
};
|
};
|
||||||
this.getInfo();
|
this.getInfo();
|
||||||
}
|
}
|
||||||
@ -84,6 +88,33 @@ export default class BottomBar extends Component {
|
|||||||
<ListItemText primary={this.state.lnd_version} secondary="LND version"/>
|
<ListItemText primary={this.state.lnd_version} secondary="LND version"/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
|
<Divider/>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemIcon><DnsIcon/></ListItemIcon>
|
||||||
|
{this.state.network == 'testnet'?
|
||||||
|
<ListItemText secondary={this.state.node_alias}>
|
||||||
|
<a href={"https://1ml.com/testnet/node/"
|
||||||
|
+ this.state.node_id}>{this.state.node_id.slice(0, 12)+"... (1ML)"}
|
||||||
|
</a>
|
||||||
|
</ListItemText>
|
||||||
|
:
|
||||||
|
<ListItemText secondary={this.state.node_alias}>
|
||||||
|
<a href={"https://1ml.com/node/"
|
||||||
|
+ this.state.node_id}>{this.state.node_id.slice(0, 12)+"... (1ML)"}
|
||||||
|
</a>
|
||||||
|
</ListItemText>
|
||||||
|
}
|
||||||
|
</ListItem>
|
||||||
|
|
||||||
|
<Divider/>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemIcon><WebIcon/></ListItemIcon>
|
||||||
|
<ListItemText secondary={this.state.alternative_name}>
|
||||||
|
<a href={"https://"+this.alternative_site}>{this.state.alternative_site.slice(0, 12)+"...onion"}
|
||||||
|
</a>
|
||||||
|
</ListItemText>
|
||||||
|
</ListItem>
|
||||||
|
|
||||||
<Divider/>
|
<Divider/>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemIcon><GitHubIcon/></ListItemIcon>
|
<ListItemIcon><GitHubIcon/></ListItemIcon>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -218,6 +218,14 @@
|
|||||||
!*** ./node_modules/@mui/base/Portal/Portal.js ***!
|
!*** ./node_modules/@mui/base/Portal/Portal.js ***!
|
||||||
\*************************************************/
|
\*************************************************/
|
||||||
|
|
||||||
|
/*!*************************************************!*\
|
||||||
|
!*** ./node_modules/@mui/icons-material/Dns.js ***!
|
||||||
|
\*************************************************/
|
||||||
|
|
||||||
|
/*!*************************************************!*\
|
||||||
|
!*** ./node_modules/@mui/icons-material/Web.js ***!
|
||||||
|
\*************************************************/
|
||||||
|
|
||||||
/*!*************************************************!*\
|
/*!*************************************************!*\
|
||||||
!*** ./node_modules/@mui/material/Card/Card.js ***!
|
!*** ./node_modules/@mui/material/Card/Card.js ***!
|
||||||
\*************************************************/
|
\*************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user