Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install #1

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
53721ea
nav
devyin7 Feb 7, 2020
0ea173c
add footer and darapp
devyin7 Feb 8, 2020
6af166b
add valdiate store
devyin7 Feb 8, 2020
390fa16
add new UI create wallet and alert private key
devyin7 Feb 10, 2020
ff535d5
add create from private key form
devyin7 Feb 10, 2020
420bc76
add assets
devyin7 Feb 14, 2020
9b2b732
add mixin and store mosaics , namespace
devyin7 Feb 17, 2020
c808b2f
add wallet date
devyin7 Feb 18, 2020
0654976
add validate form
devyin7 Feb 19, 2020
2925cb8
add valdiate filter mosaic
devyin7 Feb 21, 2020
961b83f
new navbar - delete item
devyin7 Feb 21, 2020
f6c6fb9
nav new list item
devyin7 Feb 21, 2020
94a56ff
add valdiate dt
devyin7 Feb 26, 2020
eaf75fa
add config
devyin7 Mar 2, 2020
ec635e9
add stora db
devyin7 Mar 4, 2020
b7c98ba
add remove data
devyin7 Mar 4, 2020
0b45678
add new validate
devyin7 Mar 9, 2020
3a8529d
add loger
devyin7 Mar 9, 2020
8dfc11c
add store
devyin7 Mar 11, 2020
5f441b8
add filtel comp
devyin7 Mar 12, 2020
1d33c69
new filter type
devyin7 Mar 17, 2020
336db8e
add card new offer
devyin7 Mar 18, 2020
fcc05d4
add commit offer
devyin7 Mar 22, 2020
1359def
add newOffer
devyin7 Mar 27, 2020
cdd4bdd
add config db
devyin7 Mar 29, 2020
f63ce6a
add create table and bata base
devyin7 Mar 29, 2020
aac0648
add
devyin7 Apr 8, 2020
683f9ee
add
devyin7 Apr 8, 2020
8c9f0f5
dd use db
devyin7 Apr 8, 2020
f6e4620
buider
devyin7 Apr 9, 2020
27fb726
add filter
devyin7 Apr 13, 2020
243ab5d
add login
devyin7 Apr 14, 2020
d5ea6ca
add
devyin7 Apr 14, 2020
5c56701
add
devyin7 Apr 15, 2020
fce6c4e
add validate amount
devyin7 Apr 15, 2020
afc7da3
src/views/
devyin7 Apr 15, 2020
7420174
Data
Apr 15, 2020
281914a
Merge branch 'feature/refactoring-ui' of https://github.com/proximax-…
Apr 15, 2020
c241269
add all offers
devyin7 Apr 15, 2020
64d0326
GRaphics
Apr 15, 2020
ce1f90b
Merge branch 'feature/refactoring-ui' of https://github.com/proximax-…
Apr 15, 2020
7bd0fc7
Offers
Apr 15, 2020
0ec7768
Type search
Apr 15, 2020
42b49d0
add validate
devyin7 Apr 16, 2020
27b6b84
Type search
Apr 16, 2020
546da59
FIX BUGS
Apr 16, 2020
09c7490
add valdiate
devyin7 Apr 16, 2020
3d933a4
revolver conflict
devyin7 Apr 16, 2020
f596568
add
devyin7 Apr 16, 2020
3d77cad
add console
devyin7 Apr 16, 2020
f05e618
add validate new info wallet
devyin7 Apr 20, 2020
4e935a6
ade validatte
devyin7 Apr 21, 2020
63aa247
add UI remove offers
devyin7 Apr 21, 2020
4d74128
add
devyin7 Apr 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add config
  • Loading branch information
devyin7 committed Mar 2, 2020
commit eaf75fa8f41156fe71d6b114670332aa04ba5f05
22 changes: 22 additions & 0 deletions bridgedb/lib/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const r = require('rethinkdb')
const Log = require('./log')

const DB = {
conn: null,
async connect () {
try {
Log.info(' >> Connecting to RethinkDB...')
const host = process.env.db_host || '192.168.1.69'
const port = process.env.db_port || 32769
const db = process.env.db_name || 'dexWallet'
const user = process.env.db_user || undefined
const password = process.env.db_password || undefined
DB.conn = await r.connect({ host, port, db, user, password })
Log.info(' >> RethinkDB Connected!')
} catch (error) {
console.error(error)
process.exit(-1)
}
}
}
module.exports = DB
37 changes: 37 additions & 0 deletions bridgedb/lib/log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const winston = require('winston')
const path = require('path')

const filename = path.join(__dirname, '../log/bridge.log')
const config = {
levels: {
error: 0,
debug: 1,
warn: 2,
data: 3,
info: 4,
verbose: 5,
silly: 6,
custom: 7
},
colors: {
error: 'red',
debug: 'blue',
warn: 'yellow',
data: 'grey',
info: 'green',
verbose: 'cyan',
silly: 'magenta',
custom: 'yellow'
}
}
winston.addColors(config.colors)
const Log = winston.createLogger({
levels: config.levels,
format: winston.format.combine(winston.format.colorize({ all: true }), winston.format.simple()),
transports: [
new winston.transports.Console({ handleExceptions: true }),
new winston.transports.File({ filename })
]
})

module.exports = Log
26 changes: 26 additions & 0 deletions bridgedb/lib/queries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const r = require('rethinkdb')
const DB = require('./db')

// const standardValue = { includeInitial: true, includeTypes: true, includeStates: true }
// const standardQuery = {
// includeInitial: true,
// includeTypes: true,
// includeStates: true,
// includeOffsets: true
// }
// const noRangeQuery = { includeInitial: true, includeTypes: true }

const Queries = {}
// A simple value query for a public user record. We do not emit sensitive fields (email, etc.) here. Note that the
// pluck operation has to come after the changefeed request.
Queries.changesTable = params => {
return r
.table('offers')
.changes()
.run(DB.conn)
}
Queries.getAlloffertTx = params => {
return r.table('offers').run(DB.conn)
}

module.exports = Queries
6 changes: 6 additions & 0 deletions bridgedb/log/bridge.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
info:  >> Connecting to RethinkDB...
info:  >> listening on port 3700
info:  >> RethinkDB Connected!
info:  >> Connecting to RethinkDB...
info:  >> listening on port 3700
info:  >> RethinkDB Connected!
75 changes: 75 additions & 0 deletions bridgedb/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const express = require('express')
const path = require('path')
const app = express()

const DB = require('./lib/db')
// const queries = require('./lib/queries')
const Log = require('./lib/log')
const http = require('http').createServer(app)
const io = require('socket.io')(http)

app.use(express.static(path.join(__dirname, '../public')))
// app.get('/', function (req, res) {
// res.sendFile(__dirname + '/index.html');
// });

io.on('connection', function (socket) {
console.log('a user connected')
socket.on('customEmit', function (msg) {
console.log('channel custom emit', msg)
io.emit('customEmit', 'Hola hemos recibido tu mensaje desde custom emit: ' + msg)
})
socket.on('disconnect', function () {
console.log('user disconnected')
})
socket.on('chat_message', function (msg) {
console.log('message: ' + msg)
io.emit('chat_message', 'Hola hemos recibido tu mensaje: ' + msg)
})
})
app.set('port', process.env.PORT || 3700)
http.listen(app.get('port'), () => {
Log.info(` >> listening on port ${app.get('port')}`)
})

// connect rethinkdb module
DB.connect().then(successMessage => {
// changesTable()
})

// ################ queries rethinkdb #############
// function changesTable () {
// queries.changesTable(null).then(function (cursor) {
// console.log('changesTable')
// cursor.each(function (err, change) {
// console.log('change::', change)
// console.error('err', err)
// Stream.emit('push-offertTx', 'test', { changeTx: change })
// })
// })
// }
// function getAllOffertTx() {
// queries.getAlloffertTx(null).then(function(cursor) {
// console.log('getAlloffertTx')
// cursor.toArray(function(err, result) {
// if (err) throw err
// Stream.emit('push-offertTx', '', { tx: result })
// })
// })
// }
// ################ Routers api ###################
// app.get('/offertTx', function (req, res) {
// res.status(200).set({
// Connection: 'keep-alive',
// 'Cache-control': 'no-cache',
// 'Content-Type': 'text/event-stream'
// })
// console.log('llego aqui')
// Stream.on('push-offertTx', function (event, data) {
// res.write(`data: ${JSON.stringify(data)}\n\n`)
// })
// getAllOffertTx()
// changesTable()
// })

// #####
Loading