{"id":13566750,"url":"https://github.com/NodesGuru/casper-world-backend","last_synced_at":"2025-04-04T00:32:09.050Z","repository":{"id":114821726,"uuid":"434380929","full_name":"NodesGuru/casper-world-backend","owner":"NodesGuru","description":"This web app monitors Casper network health, including nodes version distribution, VPS centralization, stake distribution (to prevent possible sybil attacks) and stake distribution by country, active/non-active nodes and validators statistics by date, etc.","archived":false,"fork":false,"pushed_at":"2022-01-26T17:58:33.000Z","size":189,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-04T21:37:07.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NodesGuru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-02T21:31:42.000Z","updated_at":"2022-11-06T12:28:23.000Z","dependencies_parsed_at":"2023-12-02T19:30:28.752Z","dependency_job_id":null,"html_url":"https://github.com/NodesGuru/casper-world-backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodesGuru%2Fcasper-world-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodesGuru%2Fcasper-world-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodesGuru%2Fcasper-world-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodesGuru%2Fcasper-world-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NodesGuru","download_url":"https://codeload.github.com/NodesGuru/casper-world-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103290,"owners_count":20884023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:15.892Z","updated_at":"2025-04-04T00:32:08.532Z","avatar_url":"https://github.com/NodesGuru.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Casper Network Stats \u0026 Decentralization Map\n\nThis web app monitors Casper network health, including nodes version distribution, VPS centralization, stake distribution (to prevent possible sybil attacks) and stake distribution by country, active/non-active nodes and validators statistics by date, etc.\n\n---\n## Prerequisites\n\nIt's required to install Git, Node.js, npm,  Yarn and MongoDB.\n\n### Update your system\n```bash\n$ sudo apt update\n$ sudo apt upgrade\n```\n\n### Install git\n```bash\n$ sudo apt install git -y\n```\n\n### Open required ports\n```bash\n$ sudo ufw allow 27017 \n$ sudo ufw allow 80\n$ sudo ufw allow 443\n$ sudo ufw allow 3000\n```\n\n### Install nodejs and npm\n- #### Node installation on Ubuntu\n\n  You can install nodejs and npm easily with apt install, just run the following commands.\n\n      $ curl https://deb.nodesource.com/setup_14.x | sudo bash\n      $ sudo apt install -y nodejs\n\n- #### Other Operating Systems\n  You can find more information about the installation on the [official Node.js website](https://nodejs.org/) and the [official NPM website](https://npmjs.org/).\n\nIf the installation was successful, you should be able to run the following command.\n\n    $ node --version\n    v14.15.5\n\n    $ npm --version\n    v6.14.11\n\n###\n### Install Yarn\nAfter installing node, this project will need yarn too, so just run the following command.\n\n    $ curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg \u003e/dev/null\n    $ echo \"deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list\n    $ sudo apt update \u0026\u0026 sudo apt install yarn -y\n\n###\n### MongoDb installation\nInstall the latest stable version.\n\nIf Ubuntu 20:\n```bash\necho \"deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse\" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list\n```\nIf Ubuntu 18:\n```bash\necho \"deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse\" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list\n```\n\nThen continue with the following:\n```bash\nmkdir -p /data/db\nwget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -\nsudo apt-get update\nsudo apt-get install -y mongodb-org \u003c \"/dev/null\"\necho \"storage:\n  dbPath: /var/lib/mongodb\n  journal:\n    enabled: true\nsystemLog:\n  destination: file\n  logAppend: true\n  path: /var/log/mongodb/mongod.log\nnet:\n  port: 27017\n  bindIp: 127.0.0.1, $(curl ifconfig.me)\nprocessManagement:\n  timeZoneInfo: /usr/share/zoneinfo\n\nsecurity:\n  authorization: enabled\" \u003e /etc/mongod.conf\nsystemctl enable mongod\nsystemctl restart mongod\nsystemctl status mongod\n```\n\nNow we need to create сasper user, do the following:\n\nOpen `mongosh`:\n```bash\nmongosh\n```\nCreate Admin:\n```bash\nuse admin\ndb.createUser(\n{\nuser: \"Admin\",\npwd: \"YOUR_$ECURE_P@ASSW0RD\",\nroles: [ { role: \"userAdminAnyDatabase\", db: \"admin\" }, \"readWriteAnyDatabase\" ]\n}\n)\nexit\n```\nRe-enter with `Admin`:\n```bash\nmongosh -u Admin\n```\nEnter your password, in our case it will be `YOUR_$ECURE_P@ASSW0RD`.\n\nCreate сasper user:\n```bash\nuse casper\ndb.createUser(\n{\nuser: \"Casper\",\npwd: \"YOUR_$ECURE_P@ASSW0RD\",\nroles: [ { role: \"readWrite\", db: \"casper\" } ]\n}\n)\nexit\n```\n\n---\n\n## Install Casper World Backend\n\n    $ git clone https://github.com/nodesguru/casper-world-backend\n    $ cd casper-world-backend\n    $ yarn install\n\n## Configure the application\n\nCreate .env file and fill parameters:\n- RPC=https://node-clarity-mainnet.make.services/rpc\n- MongoDB parameters - could be taken from MongoDb installation section\n\nYou can find an example shown below\n\n    \n    # Casper RPC\n    RPC=https://node-clarity-mainnet.make.services/rpc\n\n    # MONGODB\n    DB_USER=Casper\n    DB_PASSWORD=YOUR_%24ECURE_P%40ASSW0RD\n    DB_HOST=127.0.0.1\n    DB_AUTH_SOURCE=casper\n    \n\n## Test the project\n\nIf you made changes in the project code, then start code testing.\n```bash\nyarn run test\n```\nExpected result: all tests are passed\n\n## Running the project\n\nCreate service file and start the application using commands below:\n\n```bash\necho \"[Unit]\nDescription=Casper Job\nAfter=network-online.target\n[Service]\nUser=$USER\nWorkingDirectory=$HOME/casper-world-backend\nExecStart=$(which yarn) --cwd $HOME/casper-world-backend/ start\nRestart=always\nRestartSec=1\nLimitNOFILE=10000\n[Install]\nWantedBy=multi-user.target\" \u003e $HOME/casper-job.service\nsudo mv $HOME/casper-job.service /etc/systemd/system/casper-job.service\nsudo systemctl daemon-reload\nsudo systemctl enable casper-job\nsudo systemctl restart casper-job\n```\n\n## Documentation\n\nDocumentation is available [here](https://nodesguru.github.io/casper-world-backend/)\n\n## License\n\nReleased under the MIT license.\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nCopyright (c) [ Nodes.Guru ]( https://github.com/nodesguru )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodesGuru%2Fcasper-world-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNodesGuru%2Fcasper-world-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodesGuru%2Fcasper-world-backend/lists"}