Skip to content

Instantly share code, notes, and snippets.

View kianenigma's full-sized avatar
🦀

Kian Paimani kianenigma

🦀
View GitHub Profile
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 31
ETag: W/"1f-5BgiCd8igfyPhK/4unDH1iI+hM0"
Date: Sun, 02 Apr 2017 12:38:17 GMT
Connection: keep-alive
{"err":"Not Found","body":null}%
$ node client.js
node worker.js
const XYZ = require('xyz-core')
const fs = require('fs')
// create a new microservice
let worker = new XYZ({
selfConf: {
name: 'worker.ms',
// rename this if you want to deploy on a VPS
host: '127.0.0.1',
const XYZ = require('xyz-core')
let ms = new XYZ({
selfConf: {
name: 'client.ms',
transport: [{type: 'HTTP', port: 5000}],
host: '127.0.0.1'
}
// worker.js log
[2017-4-2 16:33:6][worker.ms@127.0.0.1:6000] info :: JOIN PING ACCEPTED. response : {"services":{"":{}},"nodes":["127.0.0.1:5000"],"transportServers":{"5000":["CALL","PING"]}}
[2017-4-2 16:33:6][worker.ms@127.0.0.1:6000] info :: A new node {127.0.0.1:5000} added to systemConf
[2017-4-2 16:33:6][worker.ms@127.0.0.1:6000] info :: SR :: System Configuration changed new values: {"nodes":["127.0.0.1:6000","127.0.0.1:5000"]}
// client.js log
[2017-4-2 16:33:6][client.ms@127.0.0.1:5000] info :: A new node {127.0.0.1:6000} added to systemConf
[2017-4-2 16:33:6][client.ms@127.0.0.1:5000] info :: SR :: System Configuration changed new values: {"nodes":["127.0.0.1:5000","127.0.0.1:6000"]}
// client.js log
task/io response: null written
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
const express = require('express')
const XYZ = require('xyz-core')
const app = express()
const EXPRES_PORT = 4001
// setup xyz
const front = new XYZ({
selfConf: {
name: 'front.ms',
[🤑][Era 832, block 2459331] Submit election solution with score [16500990000000000, 5451745585255556702, 121988327374654936401385614129377354] // Event = Event::system(RawEvent::ExtrinsicSuccess(DispatchInfo { weight: 100000000000, class: DispatchClass::Normal, pays_fee: Pays::Yes }))
[✅][Era 832, block 2459336] Submit election solution with score [16500990000000000, 5451745585255556702, 121928348238755152494872377607573740] // Event = Event::system(RawEvent::ExtrinsicSuccess(DispatchInfo { weight: 100000000000, class: DispatchClass::Normal, pays_fee: Pays::Yes }))
[🤑][Era 831, block 2455752] Submit election solution with score [16500990000000000, 5457922662903153046, 122516317281139247930906780823341868] // Event = Event::system(RawEvent::ExtrinsicSuccess(DispatchInfo { weight: 100000000000, class: DispatchClass::Normal, pays_fee: Pays::Yes }))
[🤑][Era 830, block 2452163] Submit election solution with score [15916084254215304, 5439474364711962868, 121522850471876681634293188216488588] // Event = Event::syste
[🤑][Era 863, block 2570013] Submit election solution with score [12488167277027543, 5535955046686416541, 117889898560723930956941881572521535] // Event = "ExtrinsicSuccess"
[🤑][Era 862, block 2566456] Submit election solution with score [12488167277027543, 5532215379933046597, 117826654925713863823779834925522355] // Event = "ExtrinsicSuccess"
[✅ // [0.00000% ,0.00000% ,0.09834% ,]][Era 862, block 2566461] Submit election solution with score [12488167277027543, 5532215379933046597, 117710893888984556173809419900174065] // Event = "ExtrinsicSuccess"
[🤑][Era 861, block 2562902] Submit election solution with score [12488167277027543, 5559266368032409496, 118749283262079244270992278287436446] // Event = "ExtrinsicSuccess"
[✅ // [0.00000% ,0.00000% ,0.04090% ,]][Era 861, block 2562924] Submit election solution with score [12488167277027543, 5559266368032409496, 118700736389524721358337889258988054] // Event = "ExtrinsicSuccess"
[🤑][Era 860, block 2559355] Submit election solution with score [12488167277027543, 555