arnaucode bfa7b29639 | 6 years ago | |
---|---|---|
.. | ||
blockchainlib | 6 years ago | |
p2plib | 6 years ago | |
.gitignore | 6 years ago | |
README.md | 6 years ago | |
config.json | 6 years ago | |
errors.go | 6 years ago | |
log.go | 6 years ago | |
main.go | 6 years ago | |
peer | 6 years ago | |
readConfig.go | 6 years ago | |
restConfig.go | 6 years ago | |
restRoutes.go | 6 years ago | |
restServer.go | 6 years ago | |
tests.sh | 6 years ago |
To run as a normal peer:
./peer
To run as a p2p server:
./peer server
Needs the config.json file:
{
"ip": "127.0.0.1",
"port": "3001",
"serverip": "127.0.0.1",
"serverport": "3000"
}
GET /
GET /peers
{
"PeerID": "VOnL-15rFsUiCnRoyGFksKvWKcwNBRz5iarRem0Ilvo=",
"peerslist": [
{
"id": "VOnL-15rFsUiCnRoyGFksKvWKcwNBRz5iarRem0Ilvo=",
"ip": "127.0.0.1",
"port": "3000",
"role": "server",
"conn": null
},
{
"id": "Lk9jEP1YcOAzl51yY61GdWADNe35_g5Teh12JeguHhA=",
"ip": "127.0.0.1",
"port": "3003",
"role": "client",
"conn": {}
},
{
"id": "xj78wuyN2_thFBsXOUXnwij4L8vualxQ9GnVRK6RS4c=",
"ip": "127.0.0.1",
"port": "3005",
"role": "client",
"conn": {}
}
],
"date": "0001-01-01T00:00:00Z"
}