Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
Beldex-Coin
/
beldex-storage-server
Public
Notifications
You must be signed in to change notification settings
Fork
11
Star
7
Code
Issues
1
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
beldex-storage-server
/
mock_beldexd.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
46 lines (38 loc) · 1.52 KB
master
Breadcrumbs
beldex-storage-server
/
mock_beldexd.py
Copy path
Top
File metadata and controls
Code
Blame
46 lines (38 loc) · 1.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import time
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
SWARMS = """0 s5ejmf538y6kk7rxmpx9aei9fze11ox84wuakzmogkenffi7yeqy.mnode e3eai9uukrm1khk8w9exji1pu5bo4jmzz4gwyzyoyx6hqssge3jo.mnode\n
1 zn7s1zdxsznutq4acjnrf8d6i6n4sodshotw1xwsujw5ur863e7o.mnode bhbd9pp5s33x1mxyc9mqo7mzd51rkzeoft7833716abn31tuakmo.mnode\n
2 az6w6yo5x7s8haubja737b64dq41hpwk33mc133nadyeumgkuo7y.mnode we1qu4uq6oji1ciochaknfazaj1yn1x6dposnopn6wuju3d5gb7o.mnode\n
3 p8xkou5gfy87bmaw8whk9bhzfr7xzqjscqjszmmcc67gedcyiaxy.mnode 9pwnzq1ddk3yb1d8oa6qg8mup7yzze149jw8c96x7bnshjik4hxo.mnode\n
4 ur7qa4czknecknfirpyaprubwpmzmmqtasafawipnrr4prykfzbo.mnode o7drfi546edwq8pqhdf5hpof8ib4adenfzfexgagmh9bo868ndfy.mnode
"""
class beldexdHandler(BaseHTTPRequestHandler):
def do_POST(self):
if self.path != '/json_rpc':
# Only doing json_rpc
self.send_response(404)
self.end_headers()
return
length = self.headers.get('Content-Length')
if not length:
self.send_response(404)
self.end_headers()
return
message = self.rfile.read(int(length))
j = json.loads(message)
if j['method']!= 'get_master_nodes':
self.send_response(405)
self.end_headers()
return
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(bytes(SWARMS, "utf8"))
def run():
# Server settings
server_address = ('127.0.0.1', 7777)
httpd = HTTPServer(server_address, beldexdHandler)
print('running server...')
httpd.serve_forever()
run()
You can’t perform that action at this time.