Add statsfornerds: alternative site, node alias, node id, 1ML link

This commit is contained in:
Reckless_Satoshi 2022-02-12 05:59:59 -08:00
parent ae338adcfc
commit d257848940
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
7 changed files with 65 additions and 8 deletions

View File

@ -18,17 +18,20 @@ MARKET_PRICE_APIS = https://blockchain.info/ticker, https://api.yadio.io/exrates
# Host e.g. robosats.com
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-'
# e.g. robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion
ONION_LOCATION = ''
# Link to robosats mainnet/testnet (shown on frontend in statsfornerds so users can switch mainnet/testnet)
THE_OTHER_ROBOSATS = 'testnet/mainnet.onion'
# Link to robosats alternative site (shown in frontend in statsfornerds so users can switch mainnet/testnet)
ALTERNATIVE_SITE = 'RoboSats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion'
ALTERNATIVE_NAME = 'RoboSats Mainnet'
# Lightning node open info, url to amboss and 1ML
AMBOSS = ''
ONEML = ''
NODE_ALIAS = '🤖RoboSats⚡(RoboDevs)'
NODE_ID = '033b58d7......'
# Trade fee in percentage %
FEE = 0.002

View File

@ -27,11 +27,11 @@ class Command(BaseCommand):
try:
self.follow_hold_invoices()
except Exception as e:
self.stdout.write(str(e))
try:
self.send_payments()
except Exception as e:
if 'database is locked' in str(e):
self.stdout.write('database is locked')
self.stdout.write(str(e))
def follow_hold_invoices(self):

View File

@ -54,9 +54,19 @@ lnd_v_cache = {}
@ring.dict(lnd_v_cache, expire=3600) #keeps in cache for 3600 seconds
def get_lnd_version():
# Reads lnd version from CLI
stream = os.popen('lnd --version')
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
robosats_commit_cache = {}

View File

@ -532,6 +532,11 @@ class InfoView(ListAPIView):
context['lifetime_satoshis_settled'] = lifetime_volume_settled
context['lnd_version'] = get_lnd_version()
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['bond_size'] = float(config('BOND_SIZE'))
if request.user.is_authenticated:

View File

@ -19,6 +19,8 @@ import PublicIcon from '@mui/icons-material/Public';
import NumbersIcon from '@mui/icons-material/Numbers';
import PasswordIcon from '@mui/icons-material/Password';
import ContentCopy from "@mui/icons-material/ContentCopy";
import DnsIcon from '@mui/icons-material/Dns';
import WebIcon from '@mui/icons-material/Web';
// pretty numbers
function pn(x) {
@ -42,6 +44,8 @@ export default class BottomBar extends Component {
robosats_running_commit_hash: '000000000000000',
openProfile: false,
profileShown: false,
alternative_site: 'robosats...',
node_id: '00000000',
};
this.getInfo();
}
@ -84,6 +88,33 @@ export default class BottomBar extends Component {
<ListItemText primary={this.state.lnd_version} secondary="LND version"/>
</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/>
<ListItem>
<ListItemIcon><GitHubIcon/></ListItemIcon>

File diff suppressed because one or more lines are too long

View File

@ -218,6 +218,14 @@
!*** ./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 ***!
\*************************************************/