All Projects β†’ silverstar194 β†’ Nano-SpeedTest

silverstar194 / Nano-SpeedTest

Licence: other
Webapp to test speed of Nano Transactions

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to Nano-SpeedTest

speedInspectorRPI
A docker image with a cronjob running speedtest, audit your internet connection/ISP
Stars: ✭ 12 (-53.85%)
Mutual labels:  speedtest
speed-cloudflare-cli
πŸ“ˆ Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (+280.77%)
Mutual labels:  speedtest
speedtest-android
Android app template for Librespeed servers
Stars: ✭ 209 (+703.85%)
Mutual labels:  speedtest
netcheck
A shell script to check and log when your internet connection goes down.
Stars: ✭ 138 (+430.77%)
Mutual labels:  speedtest
speedtest
A self-hosted, lightweight HTML5 speed test implemented in JavaScript, based on Web Workers and XMLHttpRequest.
Stars: ✭ 154 (+492.31%)
Mutual labels:  speedtest
zabbix-template-speedtest
Speedtest template for zabbix
Stars: ✭ 28 (+7.69%)
Mutual labels:  speedtest
nano-sidebar
Emacs package to have configurable sidebars on a per frame basis.
Stars: ✭ 98 (+276.92%)
Mutual labels:  nano
linux nvidia jetson
Allied Vision CSI-2 camera driver for NVIDIA Jetson Systems. Currently supporting Nano, TX2, AGX Xavier, and Xavier NX. Support for TX2 NX coming soon.
Stars: ✭ 68 (+161.54%)
Mutual labels:  nano
speedy
Test, track, monitor and analyze your internet speed.
Stars: ✭ 35 (+34.62%)
Mutual labels:  speedtest
wallet-address-validator
Useful library for validation of Bitcoin, Litecoin, Ethereum and other cryptocoin addresses
Stars: ✭ 240 (+823.08%)
Mutual labels:  nano
nano-rs
An implementation of Nano in Rust using Tokio
Stars: ✭ 29 (+11.54%)
Mutual labels:  nano
nanook
Ruby library for making and receiving payments and managing a nano currency node
Stars: ✭ 17 (-34.62%)
Mutual labels:  nano
piranha
Piranha - a modern cloud runtime
Stars: ✭ 136 (+423.08%)
Mutual labels:  nano
nano-vanity
A NANO vanity address generator (supports OpenCL)
Stars: ✭ 83 (+219.23%)
Mutual labels:  nano
nano-theme
GNU Emacs / N Ξ› N O Theme
Stars: ✭ 219 (+742.31%)
Mutual labels:  nano
ancistrus
Netgear's D7000 Nighthawk Router Experience Distributed Project
Stars: ✭ 61 (+134.62%)
Mutual labels:  speedtest
Nano.Library
Take full advantage of Nano Library, and rapidly implement enriched .Net 6.0 micro-services.
Stars: ✭ 39 (+50%)
Mutual labels:  nano
SpeedTest-php
a speedtest php site
Stars: ✭ 28 (+7.69%)
Mutual labels:  speedtest
CloudflareSpeedTest
πŸŒ©γ€Œθ‡ͺι€‰δΌ˜ι€‰ IP」桋试 Cloudflare CDN ε»ΆθΏŸε’Œι€ŸεΊ¦οΌŒθŽ·ε–ζœ€εΏ« IP (IPv4 / IPv6)οΌε¦ε€–δΉŸζ”―ζŒε…Άδ»– CDN / 网站 IP ~
Stars: ✭ 5,092 (+19484.62%)
Mutual labels:  speedtest
nano-websocket-client
nano javascript WebSocket client SDK
Stars: ✭ 18 (-30.77%)
Mutual labels:  nano

Nano-SpeedTest

Table of Contents

This website is able to time nano transactions from between nodes in distinct places. In order to run the project on your own computer, there are two disctinct parts you must setup: front end and back end.

Nano SpeedTest Front End

This front end is created using React. Below are instructions on how to get started and other useful resources.

Getting Started

  1. Clone this repo by running git clone https://github.com/silverstar194/Nano-SpeedTest.git
  2. Install node in order to use npm commands - brew install node (install here for windows: https://nodejs.org/en/)
  3. Navigate to Nano-SpeedTest/app/frontend
  4. Install all node dependencies - npm install
  5. While it is installing, inside the frontend folder create a file called .env. Inside place: REACT_APP_GOOGLE_MAPS_KEY=<KEY> and REACT_APP_API_PREFIX=http://api.nanospeed.live/ and NODE_PATH=src/ on separate lines. This will allow you to use the Google Maps and keep the local structure of the project working correctly.
  6. Finally, run app in development mode - npm start

Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Front End Testing

Currently basic unit testing of redux actions and reducers exists. Running npm test triggers tests to run and continue to run on file changes.

In addition, npm test -- --coverage (yes there are two --) will show the coverage report. Currently only .js files are being tested and it is specifically set to ignore additional files such as index.js and serviceWorker.js. These options can be changed in the package.json.

Other Information

For the project to build, these files must exist with exact filenames:

  • public/index.html is the page template;
  • src/index.js is the JavaScript entry point.

You can delete or rename the other files.

You may create subdirectories inside src. For faster rebuilds, only files inside src are processed by Webpack.
You need to put any JS and CSS files inside src, otherwise Webpack won’t see them.

Only files inside public can be used from public/index.html.
Read instructions below for using assets from JavaScript and HTML.

You can, however, create more top-level directories.
They will not be included in the production build so you can use them for things like documentation.

Using Process.env

Using process.env.<VARIABLE> requires placing the variable you wish to use in the .env file prefixed with REACT_APP_<YOUR_NAME> which can then be used in the code as process.env.REACT_APP_<YOUR_NAME>. If you want to use the variable in the index.html file it must be wrapped "%<VARIABLE_NAME>%".

Some Notes on the Frontend

Structure

Components/ holds all the React Elements. It also holds most of the other pages such as the Homepage, MoreInfo Page, and Advertisements.

Components/CurrentTransactions/ is the Your Results tab

Components/HistoricalData is the Global Statistics tab

The structure and naming of the components could definitely use some work as we did not originally plan to have as many pages and the project never got refactored based on our timeline. There are also a number of components that really should have the logic simplified and broken out into smaller subsections.

Testing

The tests on UI components are basically worthless - they just perform checking that the component actually renders.

Tests on .js files are better but some of the more complicated areas such as requests and middleware we did not cover.

Nano SpeedTest Back End

Installing Dependencies

Python 3

Make sure you have installed the latest version of Python 3 and pip from the official Python website.

Verify the installation with the follwing command:

$ python --version

Django

These are the Django packages installed by following this tutorial.

$ pip3 install djangorestframework
$ pip3 install markdown
$ pip3 install django-filter

Other Python Dependencies

$ pip3 install requests  # Used for sending HTTP Requests
$ pip3 install nano-python  # RPC wrapper for Nano
$ pip3 install mysqlclient  # We are using a MySQL database
$ pip3 install django-ipware  # Used for getting IP from REST request
$ pip3 install django-ratelimit # Puts a limit on the transaction endpoints to prevent spamming
$ pip3 install django-crontab # Runs task to periodically balance accounts
$ pip3 install django-cors-headers
$ pip3 install numpy

Environment Variable Setup

dPoW API

In order to run the Django server, the following environment variables need to exist (the server will not start without them). They are not provided here for security.

  • NANO_ST__DPOW__ENDPOINT endpoint of the dPoW service
  • NANO_ST__DPOW__API_KEY API key for the dPoW service
  • NANO_ST__DB__NAME
  • NANO_ST__DB__USER
  • NANO_ST__DB__PASSWORD
  • NANO_ST__DB__HOST

Running the Server

Execute the following to host the web API locally.

$ python manage.py runserver <IP:Port (Optional)>

Executing a Django Project Python Shell

One can execute a Django Python shell (similar to a standard Python shell but imports project) using the following command:

$ python manage.py shell

This provides a nice sandbox to interact with the API while coding.

Calling management commands

These commands and code can be found in ./speedtest_api/management/commands/

The following runs the account balancer (attach this to a cron job):

$ python manage.py balance_accounts

The following generates wallets and accounts on available nodes and adds them to the database:

$ python manage.py populate_nodes

The following calculates the Proof of Work for all accounts (unless they have a valid POW):

$ python manage.py regen_pow

The following synchronizes the balance of all accounts from the Nano network to our database balance:

$ python manage.py sync_accounts

Back End Testing

Currently backend tests can be run as follows:

$ python manage.py test

In order to do this you need to have a node set up. We have included a link on setup in the next section.

Setting Up Node

https://github.com/nanocurrency/raiblocks/wiki/Docker-node

Spam prevention

There are several layers of spam protection.

Firstly, each IP is limited at the Django app layer to 15 requests per thread. The backend client is running on 3 threads for a total of 45 requests per day per IP.

Secondly, total number of requests are limited to Nginx at 80/min with 20 burst limit.

Lastly, using Fail2Ban any requests that are over the 80/min with 20 burst are counted up. Any IP with more than 3 violations are banned for a 24 hour period.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].