arnaucode 08e3915994 | 6 years ago | |
---|---|---|
.. | ||
.gitignore | 6 years ago | |
README.md | 7 years ago | |
blockchain.data | 6 years ago | |
blockchain.go | 7 years ago | |
config.json | 7 years ago | |
connections.go | 7 years ago | |
errors.go | 7 years ago | |
log.go | 7 years ago | |
main.go | 7 years ago | |
messages.go | 7 years ago | |
peer | 7 years ago | |
peers.go | 7 years ago | |
readConfig.go | 7 years ago | |
restConfig.go | 7 years ago | |
restRoutes.go | 7 years ago | |
restServer.go | 7 years ago | |
tests.sh | 7 years ago | |
utils.go | 7 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"
}