mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2025-01-08 05:52:10 +07:00
Compare commits
4 commits
cf77175210
...
c15a0d3bd4
Author | SHA1 | Date | |
---|---|---|---|
c15a0d3bd4 | |||
7e952fb886 | |||
4395a5e2d5 | |||
97fad6cacb |
4 changed files with 32 additions and 9 deletions
|
@ -17,9 +17,9 @@ export async function load() {
|
||||||
{ text: 'revuo-xmr.com', uri: 'https://revuo-xmr.com/' }
|
{ text: 'revuo-xmr.com', uri: 'https://revuo-xmr.com/' }
|
||||||
],
|
],
|
||||||
stagenet: [
|
stagenet: [
|
||||||
{ label: 'P2P', value: 'testnet.xmr.ditatompel.com:28080', key: 'tnetP2P' },
|
{ label: 'P2P', value: 'stagenet.xmr.ditatompel.com:38080', key: 'snetP2P' },
|
||||||
{ label: 'RPC', value: 'testnet.xmr.ditatompel.com:28089', key: 'tnetRPC' },
|
{ label: 'RPC', value: 'stagenet.xmr.ditatompel.com:38089', key: 'snetRPC' },
|
||||||
{ label: 'RPC SSL', value: 'testnet.xmr.ditatompel.com:443', key: 'tnetSSL' }
|
{ label: 'RPC SSL', value: 'stagenet.xmr.ditatompel.com:443', key: 'snetSSL' }
|
||||||
],
|
],
|
||||||
testnet: [
|
testnet: [
|
||||||
{ label: 'P2P', value: 'testnet.xmr.ditatompel.com:28080', key: 'tnetP2P' },
|
{ label: 'P2P', value: 'testnet.xmr.ditatompel.com:28080', key: 'tnetP2P' },
|
||||||
|
@ -27,6 +27,7 @@ export async function load() {
|
||||||
{ label: 'RPC SSL', value: 'testnet.xmr.ditatompel.com:443', key: 'tnetSSL' }
|
{ label: 'RPC SSL', value: 'testnet.xmr.ditatompel.com:443', key: 'tnetSSL' }
|
||||||
],
|
],
|
||||||
donation: {
|
donation: {
|
||||||
|
// You change donation address and qr image below if you run your own "instance"
|
||||||
address:
|
address:
|
||||||
'8BWYe6GzbNKbxe3D8mPkfFMQA2rViaZJFhWShhZTjJCNG6EZHkXRZCKHiuKmwwe4DXDYF8KKcbGkvNYaiRG3sNt7JhnVp7D',
|
'8BWYe6GzbNKbxe3D8mPkfFMQA2rViaZJFhWShhZTjJCNG6EZHkXRZCKHiuKmwwe4DXDYF8KKcbGkvNYaiRG3sNt7JhnVp7D',
|
||||||
qr: '/img/monerotip.png'
|
qr: '/img/monerotip.png'
|
||||||
|
|
|
@ -178,7 +178,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="md:basis-1/4">
|
<div class="md:basis-1/4">
|
||||||
<img src={data.donation.qr} alt="ditatompel's monero address" />
|
<img src={data.donation.qr} alt="ditatompel's monero address" />
|
||||||
<p>Thank you so much! 🥰</p>
|
<p>Thank you so much! It means a lot to me. 🥰</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -94,11 +94,9 @@ func (q QueryNodes) toSQL() (args []interface{}, where, sortBy, sortDirection st
|
||||||
wq = append(wq, "(hostname LIKE ? OR ip_addr LIKE ?)")
|
wq = append(wq, "(hostname LIKE ? OR ip_addr LIKE ?)")
|
||||||
args = append(args, "%"+q.Host+"%", "%"+q.Host+"%")
|
args = append(args, "%"+q.Host+"%", "%"+q.Host+"%")
|
||||||
}
|
}
|
||||||
if q.Nettype != "any" {
|
if slices.Contains([]string{"mainnet", "stagenet", "testnet"}, q.Nettype) {
|
||||||
if q.Nettype == "mainnet" || q.Nettype == "stagenet" || q.Nettype == "testnet" {
|
wq = append(wq, "nettype = ?")
|
||||||
wq = append(wq, "nettype = ?")
|
args = append(args, q.Nettype)
|
||||||
args = append(args, q.Nettype)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if q.Protocol != "any" && slices.Contains([]string{"tor", "http", "https"}, q.Protocol) {
|
if q.Protocol != "any" && slices.Contains([]string{"tor", "http", "https"}, q.Protocol) {
|
||||||
if q.Protocol == "tor" {
|
if q.Protocol == "tor" {
|
||||||
|
|
|
@ -35,6 +35,8 @@ func init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Single test:
|
||||||
|
// go test -race ./internal/monero -run=TestQueryNodes_toSQL -v
|
||||||
func TestQueryNodes_toSQL(t *testing.T) {
|
func TestQueryNodes_toSQL(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
@ -102,6 +104,28 @@ func TestQueryNodes_toSQL(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Single bench test:
|
||||||
|
// go test ./internal/monero -bench QueryNodes_toSQL -benchmem -run=^$ -v
|
||||||
|
func Benchmark_QueryNodes_toSQL(b *testing.B) {
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
_, _, _, _ = QueryNodes{
|
||||||
|
Host: "test",
|
||||||
|
Nettype: "any",
|
||||||
|
Protocol: "any",
|
||||||
|
CC: "any",
|
||||||
|
Status: -1,
|
||||||
|
CORS: -1,
|
||||||
|
RowsPerPage: 10,
|
||||||
|
Page: 1,
|
||||||
|
SortBy: "last_checked",
|
||||||
|
SortDirection: "desc",
|
||||||
|
}.toSQL()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// equalArgs is helper function for testing.
|
||||||
|
//
|
||||||
|
// This returns true if two slices of interface{} are equal.
|
||||||
func equalArgs(a, b []interface{}) bool {
|
func equalArgs(a, b []interface{}) bool {
|
||||||
if len(a) != len(b) {
|
if len(a) != len(b) {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue