diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e35bdd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,173 @@ +# Please take extra care not to add rules that will make tracked files ignored. +# To test that, run `git ls-files -i --exclude-standard`. +# To check why a specific file is ignored, run `git check-ignore -v `. + +# === Rule for dotfiles === +# Ignore all dotfiles. +.* +# Exclude specific dotfiles that we want to track. +!deps/**/.* +!.devcontainer/ +!.devcontainer/.devcontainer.json +!test/fixtures/**/.* +!.clang-format +!.cpplint +!.editorconfig +!.eslintignore +!.eslintrc.js +!.eslintrc.yaml +!.gitattributes +!.github +!.gitignore +!.gitkeep +!.gitpod.yml +!.mailmap +!.nycrc +!.yamllint.yaml + +# === Rules for root dir === +/core +/vgcore.* +/v8*.log +/perf.data +/perf.data.old +/tags +/tags.* +/doc/api.xml +/node +/node_g +/gon-config.json +/*.exe +/*.swp +/out +/*.msi +/*.wixpdb +/*.qlog +# For GitHub Codespaces +/pythonenv* + +# === Rules for artifacts of `./configure` === +/icu_config.gypi +/config.gypi +/config.status +/config_fips.gypi + +# === Rules for MSVS artifacts === +Debug/ +Release/ +*.sln +*.suo +*.vcxproj* +UpgradeLog*.XML +_UpgradeReport_Files/ +*.sdf +*.opensdf +*.VC.* +*.wixobj +/tools/msvs/genfiles/ +/npm.wxs +/corepack.wxs +/tools/msvs/msi/**/Release/ +/tools/msvs/msi/**/obj/ +/tools/msvs/msi/**/x64/ +# Exclude MSVS files used for .msi file generation +!tools/msvs/msi/**/custom_actions.vcxproj +!tools/msvs/msi/**/nodemsi.sln + +# === Rules for GYP artifacts === +*-nodegyp* +/gyp-*-tool +/test/addons/??_*/ +/*.mk + +# === Rules for other build artifacts === +/email.md +/deps/v8-* +/deps/icu +/deps/icu*.zip +/deps/icu*.tgz +/deps/icu-tmp +./node_modules +/android-toolchain/ +# generated by gyp on Windows +/deps/openssl/openssl.props +/deps/openssl/openssl.targets +/deps/openssl/openssl.xml +/deps/openssl/openssl-fipsmodule.props +/deps/openssl/openssl-fipsmodule.targets +/deps/openssl/openssl-fipsmodule.xml +# generated by gyp on android +/*.target.mk +/*.host.mk +/deps/openssl/openssl.target.mk +/deps/zlib/zlib.target.mk +# generated by MSVC with /P enabled +tools/*/*.i +tools/*/*.i.tmp + +# === Rules for release artifacts === +/*.tar.* +/*.pkg +/SHASUMS*.txt* + +# === Rules for `node_modules` === +!**/node_modules/** +/node_modules +/tools/doc/node_modules +/tools/clang-format/node_modules + +# === Rules for test artifacts === +/*.tap +/*.xml +/v8*-tap.json +/node_trace.*.log +# coverage related +/gcovr +/build +/coverage + +# === Rules for Xcode artifacts === +*.xcodeproj +*.xcworkspace +*.pbxproj + +# === Rules for files in `/deps` === +# Exclude all files in the vendored `npm`. +!/deps/npm/node_modules +# These are not needed and causes issues for distro packagers. +/deps/npm/node_modules/.bin/ +# Respect V8's .gitignore +!deps/v8/** +# Ignore the libuv book +/deps/uv/docs/code/ +/deps/uv/docs/src/guide/ +# Ignore .github directories +/deps/**/.github/ +# Ignore dependencies fetched by tools/v8/fetch_deps.py +/deps/.cipd + +# === Rules for Windows vcbuild.bat === +/temp-vcbuild + +# === Rules for CMake === +cmake-build-debug/ +CMakeCache.txt +CMakeFiles +CTestTestfile.cmake +cmake_install.cmake +install_manifest.txt +*.cbp + +# === Global Rules === +# Keep last to avoid being excluded +*.pyc +__pycache__ +.DS_Store +*~ + +# === Rules for C++ development === +compile_commands.json + + +/epicboxlib +config.json \ No newline at end of file diff --git a/README.md b/README.md index b2b6829..9d165de 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ # epicboxnodejs -Epicbox version on nodejs with elements of rust and adopt changes in epicbox protocole. +Epicbox Relay Server created with nodejs containing elements of rust, fast send, and updated epicbox protocol. -Added app_mongo_many.js for run many isntances under one domain. Each instance need use the same mongo database, in all instances adopted fastsend method. -For fastsend method only one of instances must have in config_many.json set fast_send_master=true, slaves ips must be set in array fast_send_slaves. -All instances must have the same epicbox domain and epicbox port set ( correct to your used epicbox.domain ). +Added app_mongo_many.js to run multiple instances under one domain. Each instance needs to use the same mongo database, and all instances use the fastsend method. +For fastsend method only one instance must have config_many.json set with fast_send_master=true, slave IPs must be set in array fast_send_slaves. +All instances must have the same epicbox domain and epicbox port set. -Instance with set fast_send_master = true can work like independent alone epicbox ( like preverious version app_mongo.js ). +The instance with fast_send_master = true can work like a single epicbox ( like app_mongo.js ). -For each instance so you must use diffirent config_many.json file ( set other local port, or fast_send_master = false etc. ) so to run epicbox use command: +For each instance you must use a different config_many.json file ( set other local port, or fast_send_master = false etc. ) so to run epicbox use command: node app_mongo_many.js config_many.json -And for next one: +And for the next one: node app_mongo_many.js config_many_slave1.json -Enjoy. \ No newline at end of file +Enjoy. diff --git a/app_mongo.js b/app_mongo.js index 9ebfdc4..74a220b 100644 --- a/app_mongo.js +++ b/app_mongo.js @@ -1,154 +1,59 @@ -/* -This is a program for an elite, narrow group of several Epic Box operators in the world. -If you are not one of them, reading this code is pointless. -*/ - -// -// Add indexes in mongo ( the first two for faster finding second to delete slate from database after set seconds ( 7 days in example = 7*24*60*60=) ) -// use epicbox -// db.slates.createIndex({queue:1, made:1, createdat: 1}) -// -// db.slates.createIndex({messageid:1, made:1}) // -// db.slates.createIndex({ "createdat": 1 }, {expireAfterSeconds: 604800 }) -// - -const fs = require("fs") - -// Html server used for websockets server -const {createServer} = require("http") - -// Used for execute rust module which fast check addreses and verify signatures -const { execFile } = require('node:child_process') - -// For generate uid message id for Slate sending to wallet. -const uid = require('uid2') - -// Websocket for communicate with other epicboxes, and Websocket Server for receive all ws connections from wallets -const { WebSocket, WebSocketServer } = require('ws') - -// Mogodb driver for externally store messageid and slates for ver 2.0.0. of epicbox, tp work with answer by wallet with slate id message -const { MongoClient } = require('mongodb'); - -// Connection URL for mongo, please change if your mongo server is on other location, you can add authorization and open firewall for it. -// each instance of epicbox which you run on your domain must use the same mongodb -- so change to correct ip and remeber open ports in firewall -// it's good idea to add one field (createdat:new Date()) in stored document and set index with timeout which which can delete documents which are old about 3-4 days -// because in special situation when wallet use 2.0.0 and later use older version stored messagid information from mognodb can't be removed by epicbox -var mongourl = "mongodb://localhost:27017" - -var dbName = "epicbox" -var collectionname = "slates" - -var challenge = "7WUDtkSaKyGRUnQ22rE3QUXChV8DmA6NnunDYP4vheTpc" - - -// change to your epicbox domaina -var epicbox_domain = "epicbox.fastepic.eu" -var epicbox_port = 443 - -// change to your port - standard is 3423 - remeber to open locale firewall - in linux sudo ufw 3424 allow -// you can run many instance of this epicbox - simpel copy folder with other name and change this port to next which you want -// remeber to correct set nginx to switch between different instances of epic box - read more in my git about it. -var localepicboxserviceport = 3424 - -// interval for check in intervals if new Slates are for connected wallets ( it is not the same what interval in wallets ! ) -var interval = null - -// time of interval ( ms ) in which epicbox can try repeat send the oldest slate for address. -// -var intervalperiod = 4000 // 4 seconds - - -//Where is executable rust named epicboxlib compiled from epicboxlib subfolder -var pathtoepicboxlib = "./epicboxlib" - -// amount of repeats FastSend message to wallet -var fast_send_repeats = 20 - -// interval in ms of repeat FastSend message to wallet -var fast_send_repeat_interval_ms = 1000 - -var varinterval = 1000*60*5; - -//current version of protocol of epicboxnodejs ( wallet can use lower ) -// -const protver = "2.0.0" - -const vardata = fs.readFileSync('config.json', - {encoding:'utf8', flag:'r'}); - - -function getvars(data){ - - try { - - let v = JSON.parse(data) - - // mongourl = v.mongo_url - // dbName = v.mongo_dbName - // collectionname = v.mongo_collection_name - challenge = v.challenge - epicbox_domain = v.epicbox_domain - epicbox_port = v.epicbox_port - localepicboxserviceport = v.local_epicbox_service_port - intervalperiod = v.interval_period_ms - pathtoepicboxlib = v.path_to_epicboxlib_exec_file - fast_send_repeats = v.fast_send_repeats - fast_send_repeat_interval_ms = v.fast_send_repeat_interval_ms - varinterval = v.var_interval - console.log(data) - - } catch(err) { - - console.error(err) - - } - - -} - -getvars(vardata) - -setInterval(()=>{ - - try{ - - fs.readFile('config.json', 'utf8', (err, data) => { - if (err) { - console.error(err); - return; - } - - let v = JSON.parse(data) - - challenge = v.challenge - epicbox_domain = v.epicbox_domain - epicbox_port = v.epicbox_port - localepicboxserviceport = v.local_epicbox_service_port - intervalperiod = v.interval_period_ms - pathtoepicboxlib = v.path_to_epicboxlib_exec_file - fast_send_repeats = v.fast_send_repeats - fast_send_repeat_interval_ms = v.fast_send_repeat_interval_ms - varinterval = v.var_interval - - - }); - +// Add indexes in mongo +// Before start create user and indexes +/* - } catch(err){ - console.error(err) + db.slates.createIndex({queue:1, made:1, createdat: 1}); + db.slates.createIndex({messageid:1, made:1}); + db.slates.createIndex({ "createdat": 1 }, {expireAfterSeconds: 604800 }); + db.createUser( + { + user: "epicbox", + pwd: passwordPrompt(), // or cleartext password + roles: [ + { role: "readWrite", db: "epicbox" }, + { role: "readWrite", db: "epicbox" } + ] } + ); -}, varinterval) - - +*/ +const fs = require("fs"); +const {createServer} = require("http"); +const { execFile } = require('node:child_process'); +const uid = require('uid2'); +const { WebSocket, WebSocketServer } = require('ws'); +const { MongoClient } = require('mongodb'); -const mongoclient = new MongoClient(mongourl) +const customConfig = process.argv.indexOf('--config'); +//this epicbox protocol version +const protver = "3.0.0"; +/** + * @deprecated in wallet version 3.5.2 + * use dynamic challenge strings + */ +const static_challenge = "7WUDtkSaKyGRUnQ22rE3QUXChV8DmA6NnunDYP4vheTpc"; +//used to reference client socket (ws) to public address (epic address) for slate passthroughs +const clients_publicaddress = {}; +const config = { + mongourl: "mongodb://127.0.0.1:27019", + epicbox_domain: "epicbox.epiccash.com", + epicbox_port: "443", + localepicboxserviceport: "3423", + pathtoepicboxlib: "./epicboxlib", + db_name: "epicbox", + collection_name: "slates", + challenge_interval: 60000, + debugMessage: true, + stats: false, + +}; +let mongoclient = null; +let collection = null; +let statistics = { -var statistics = { - from: new Date(), connectionsInHour: 0, slatesReceivedInHour: 0, @@ -159,11 +64,9 @@ var statistics = { slatesAttempt:0 } +//clean stats every hour setInterval(()=>{ - - statistics = { - from: new Date(), connectionsInHour: 0, slatesReceivedInHour: 0, @@ -171,832 +74,674 @@ setInterval(()=>{ slatesSentInHour: 0, subscribeInHour: 0, activeconnections: 0, - slatesAttempt:0 + slatesAttempt: 0 } - -},60*60*1000); - - +}, 60*60*1000); -const requestListener = function (req, res) { +const requestListener = (req, res) => { res.writeHead(200) res.end(`\n\ -\n\ -\n\ -Epicbox\n\ -\n\ -\n\ -\n\ -\n\ -

Epicbox servers. Local server number 1

\n\ -

Protocol 2.0.0

\n\ -epic-wallet to build with protocol 2.0.0\n\ -

Asia, Australia - epicbox.hyperbig.com

\n\ -

North America, South America - epicbox.epic.tech

\n\ -

US East Cost - epicbox.epicnet.us

\n\ -

Africa, Europe - epicbox.fastepic.eu

\n\ -
\n\ -

More about Epic

\n\ -Epic Cash main webpage\n\ -
\n\ -
\n\ - Example use in toml file.\n\ -\n\ -
\n\
-\n\
-\n\
-[epicbox]\n\
-epicbox_domain = 'epicbox.fastepic.eu'\n\
-epicbox_port = 443\n\
-epicbox_protocol_unsecure = false\n\
-epicbox_address_index = 0\n\
-epicbox_listener_interval = 10\n\
-\n\
-\n\
-
\n\ -

start listen: epic-wallet listen -m epicbox

\n\ -
\n\ -

\n\ -Epicbox Statistics from ${statistics.from.toUTCString()}:\n\ -

\n\ -

\n\ -connections: ${statistics.connectionsInHour}
\n\ -active connections: ${statistics.activeconnections}
\n\ -subscribes: ${statistics.connectionsInHour}
\n\ -received slates: ${statistics.slatesReceivedInHour}
\n\ -relayed slates: ${statistics.slatesRelayedInHour}
\n\ -sending slate attempts: ${statistics.slatesAttempt}
\n\ -

\n\ -\n\ -`); + \n\ + \n\ + Epicbox\n\ + \n\ + \n\ + \n\ + \n\ +

Epicbox server

\n\ +

Protocol version ${protver}

\n\ +

Asia, Australia - epicbox.hyperbig.com

\n\ +

North America, South America - epicbox.epiccash.com

\n\ +

US East Cost - epicbox.epicnet.us

\n\ +

Africa, Europe - epicbox.fastepic.eu

\n\ +

Europe - epicbox.51pool.online

\n\ +
\n\ +

More about Epic

\n\ + Epic Cash website\n\ +
\n\ +
\n\ + Required epic-wallet.toml settings.\n\ + \n\ +
\n\
+        \n\
+        \n\
+        [epicbox]\n\
+        epicbox_domain = 'epicbox.epiccash.com'\n\
+        epicbox_port = 443\n\
+        \n\
+        \n\
+        
\n\ +

start listen: epic-wallet listen -m epicbox

\n\ +
\n\ +

\n\ + Epicbox Statistics from ${statistics.from.toUTCString()}:\n\ +

\n\ +

\n\ + connections: ${statistics.connectionsInHour}
\n\ + active connections: ${statistics.activeconnections}
\n\ + subscribes: ${statistics.connectionsInHour}
\n\ + received slates: ${statistics.slatesReceivedInHour}
\n\ + relayed slates: ${statistics.slatesRelayedInHour}
\n\ + sending slate attempts: ${statistics.slatesAttempt}
\n\ +

\n\ + \n\ + `); } - - - - -// -// HTTMl server creation with function for receives requests -// Used by WebSocketServer -// -const server = createServer(requestListener); - - -// uncommented WebSocket creation with option for zip messages /* -const wss = new WebSocketServer({ - //port: 3425, - server:server, - perMessageDeflate: { - zlibDeflateOptions: { - // See zlib defaults. - chunkSize: 1024, - memLevel: 7, - level: 3 - }, - zlibInflateOptions: { - chunkSize: 10 * 1024 - }, - // Other options settable: - clientNoContextTakeover: true, // Defaults to negotiated value. - serverNoContextTakeover: true, // Defaults to negotiated value. - serverMaxWindowBits: 10, // Defaults to negotiated value. - // Below options specified as default values. - concurrencyLimit: 10, // Limits zlib concurrency for perf. - threshold: 1024 // Size (in bytes) below which messages - // should not be compressed if context takeover is disabled. - } -})*/ - + webserver for port 80 +*/ +const server = createServer(requestListener); -//WebSocket creation using HTTML server +/* + epicbox websocket +*/ const wss = new WebSocketServer({ - server:server, -}) - -// function pon connectione - run when wallets connect by webscoket to epicbox -wss.on('connection', function connection(ws, req) { - - statistics.connectionsInHour = statistics.connectionsInHour+1; - - ws.uid = uid(5); - ws.epicboxver = null; - ws.iphere = null; - // it is taken from nginx - if(req.headers['x-forwarded-for']) ws.iphere = req.headers['x-forwarded-for'].split(',')[0].trim(); - const ip2 = req.socket.remoteAddress; - - console.log(`[${new Date().toLocaleTimeString()}] [${ws.uid}] Connection from ip `, ws.iphere, " nginx/firewall ", ip2) - - ws.queueforsubscribe = null - - - ws.on('close', (code, reason)=>{ - try{ - if(ws.queueforsubscribe!=null) { - console.log(`[${ws.uid}]`," Socket close for ", ws.queueforsubscribe) - ws.queueforsubscribe = null; - - } - console.log( `[${new Date().toLocaleTimeString()}] Close by code: `, code, " and reason ", reason.toString()) - - } catch(err){ - console.error(err) - } + server: server, +}); - }) +wss.on('connection', (ws, req) => { - ws.on('error', (errws) =>{ - console.error(errws) - try{ - - if(ws.queueforsubscribe!=null) { - ws.queueforsubscribe = null; - - } - } catch(err){ - console.error(err) + if(config.stats){ + statistics.connectionsInHour++; } - }); - - // - // Standard method send by wallets or by epicboxes to epicbox - // one Made is added for receive accept from wallets ( epicbox 2.0.0 suggestion ) - // - ws.on('message', function message(data) { - - // console.log('received: %s', data) - try{ - if(data.toString()=="ping") { ws.send("pong"); /*console.log("ping");*/ return; } - if(data.toString()=="pong") {ws.send("ping"); /*console.log("pong");*/return;} - let json=JSON.parse(data) - - if(json.type=="Challenge") { - console.log(json) - console.log('[%s][%s] -> [%s] send return [%s]', new Date().toLocaleTimeString(), ws.iphere, "Challenge", challenge) - // remove for less move on internet, because Challenge is send automatic in interval but old wallets maybe need it - ws.send(JSON.stringify({"type": "Challenge","str": challenge})) - - } else if(json.type=="Subscribe") { - console.log(json) - console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "Subscribe") - subscribe(ws, json) - } else if(json.type=="Unsubscribe") { - console.log(json) - console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "Unsubscribe") - unsubscribe(ws, json) - } else if(json.type=="PostSlate"){ - console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "PostSlate") - postslate(ws, json) - } else if(json.type=="Made"){ - console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "Made") - made(ws, json) - - } else if(json.type=="GetVersion"){ - console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "GetVersion") - let st = JSON.stringify({type:"GetVersion", str:protver}) - console.log(st) - ws.send(JSON.stringify({type:"GetVersion", str:protver})) - - } else if(json.type=="FastSend"){ - console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "GetVersion") - fastsend(ws) - - } else console.log('received: %s', data); - - } catch(err){ - + ws.uid = uid(5); + ws.epicboxver = null; + ws.ip = null; + ws.challenge = null; + ws.epicPublicAddress = null; + //don't send challenges or slates to busy client + ws.process_slate = false; + //count send attempts to client + ws.sendslate_attempts = 0; + ws.max_sendslate_attempts = 0; + ws.pending_challenge = false; + ws.client_details = { + wallet_version: '', + wallet_mode: '', + protocol_version: '' + }; + + + if (req.headers['x-forwarded-for']){ + ws.ip = req.headers['x-forwarded-for'].split(',')[0].trim(); + } else { + ws.ip = req.socket.remoteAddress; } - }); - - // here we send Challenge to wallet or other epicbox when connected - let jsonhello = {"type":"Challenge","str":challenge} + console.log(`[${new Date().toLocaleTimeString()}] [${ws.uid}] New connection from `, ws.ip); - ws.send(JSON.stringify(jsonhello)); - -}); + // send a Challenge to wallet or other epicbox when first time connect + // challenges are send in interval every x seconds later + challenge(ws); + ws.on('close', (code, reason) => { -// -// Start fast send for 5 seconds -// + if(ws.client_details.wallet_mode == 'listener'){ + delete clients_publicaddress[ws.epicPublicAddress]; + } + ws.epicPublicAddress = null; + console.log('[%s] - [%s][%s] -> [%s] code: %s, reason: %s', new Date().toLocaleTimeString(), ws.uid, ws.ip, "Close connection", code, reason.toString()); + }); -async function fastsend(ws){ + ws.on('error', (err) => { + if(ws.client_details.wallet_mode == 'listener'){ + delete clients_publicaddress[ws.epicPublicAddress]; + } + ws.epicPublicAddress = null; + console.log('[%s] - [%s][%s] -> [%s] error: %s', new Date().toLocaleTimeString(), ws.uid, ws.ip, "Error", err); + }); - ws.fastsendcounter = 0; + ws.on('message', (data) => { + let message = null; + + try{ + message = JSON.parse(data); + }catch(err){ + console.log("Error parsing json data from client.", err); + if(ws.client_details.wallet_mode == 'listener'){ + delete clients_publicaddress[ws.epicPublicAddress]; + } + ws.epicPublicAddress = null; + return ws.close(code = 3000, reason = 'Error parsing message.'); + } - ws.fastsendInterval = setInterval(function(){ + let type = message.type; + + /* TODO: + - clients should set version via setVersion type + - split wallet client from epicbox client + */ + switch (type.toLowerCase()) { + case "ping": + ws.send("pong"); + break; + case "pong": + ws.send("ping"); + break; + /** + * @deprecated epicbox protocol version 3.0.0 + * clients should not be allowed to trigger challenge/subscribe requests + */ + case "challenge": + challenge(ws); + break; + case "subscribe": + subscribe(ws, message); + break; + case "unsubscribe": + unsubscribe(ws); + break; + case "postslate": + validatePostslate(ws, message); + break; + //made is send after slate was successfully processed in wallet + case "made": + made(ws, message); + break; + /** + * @deprecated epicbox protocol version 3.0.0 + */ + case "getversion": + ws.send(JSON.stringify({type: "GetVersion", str: protver})) + break; + /** + * @deprecated epicbox protocol version 3.0.0 + */ + case "fastsend": + ws.send(JSON.stringify({type:"Ok"})); + break; + case "clientdetails": + clientdetails(ws, message); + break; + } + //end switch message type - ws.send(JSON.stringify({type:"FastSend"})); - ws.fastsendcounter = ws.fastsendcounter + 1; - if(ws.fastsendcounter>fast_send_repeats) { + console.log('[%s] - [%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.uid, ws.ip, type); + config.debugMessage ? console.log("Message", message) : null; - ws.fastsendcounter = 0; - clearInterval(ws.fastsendInterval); - } - }, fast_send_repeat_interval_ms); - + }); +}); +/* + get current unix timestamp +*/ +const getTimestamp = () => { + return Math.floor(Date.now() / 1000); } -// -// Subscribe function run when wallet send Subscribe message -// -async function subscribe(ws, json){ - console.log(`[${ws.uid}]`," subscribe ", json.address) - - try{ - - // check if wallet wants use ver 2.0.0 - if(json.hasOwnProperty("ver") && json.ver=="2.0.0") ws.epicboxver = "2.0.0"; - - - // start check using externally rust program for verify signature send from wallet - const child = execFile(pathtoepicboxlib, ["verifysignature", json.address , challenge, json.signature], (error, stdout, stderr) => { - if (error) { - throw error; - } - - var isTrueSet = (stdout === 'true'); - - // if sugnature is OK - if(isTrueSet) { - - - -// for backward for older wallets /* - try { - - const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); - - // find message id send in Made message from vallet - collection.find({ queue: json.address, made: false}).sort({ "createdat" : 1 }).limit(1).toArray().then((findResult)=>{ - - - if(findResult.length>0) { - - statistics.slatesAttempt = statistics.slatesAttempt + 1 - console.log("try check and send from subscribe for ", json.address) - - - let fromrabbit = JSON.parse(findResult[0].payload) - let answer= {} - answer.type="Slate" - answer.from = findResult[0].replyto - answer.str = fromrabbit.str - answer.signature = fromrabbit.signature - answer.challenge = fromrabbit.challenge - - let answerstr = null - - if(ws.epicboxver == "2.0.0"){ - - let messageid = findResult[0].messageid - - answer.epicboxmsgid = messageid - answer.ver = ws.epicboxver - answerstr = JSON.stringify(answer) - ws.send(answerstr) - console.log("Sent to 2.0.0 ", json.address) - - } else { - - answerstr = JSON.stringify(answer) - ws.send(answerstr) - console.log("Looks sent to ", json.address) - collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ - - - }); - - } - - - } else { - // console.log("msgrabbit ", msgrabbit) - //console.log("Error ", err) - } - - - }); - - - } catch(err){ - console.log(err) - } - + send challenge to client. + the first challenge must use the old static challenge string for backward compatibility. + older epicbox clients with protocol version 2.0.0 + new epicbox/clients can use a dynamic challenge. + //TODO if client blocks then this send messages are waiting in the queue + @param {object} ws - Client socket */ -// and for backward for older wallets - - - - statistics.subscribeInHour = statistics.subscribeInHour+1 - if(ws.epicboxver) console.log(ws.epicboxver) - // here we store address of wallet which is queue in RabbitMq - ws.queueforsubscribe = json.address - - ws.send(JSON.stringify({type:"Ok"})) - - } else { - console.log("Signature error") - ws.send(JSON.stringify({type:"Error", kind:"signature error", description:"Signature error"})) - } - }); - - } catch(err){ - console.log(err) - ws.send(JSON.stringify({type:"Error", kind:"signature error", description:"Signature error"})) - } +const challenge = (ws) => { + //we do not know clients epicbox version on first challenge request. + //todo. client should send its version when connect to epicbox via client_details + let challenge = ws.epicboxver == "2.0.0" || ws.epicboxver == null ? static_challenge : uid(32); + ws.challenge = challenge; + ws.send(JSON.stringify({"type": "Challenge", "str": challenge})); + ws.pending_challenge = true; } -// -// run when wallet sent Unsuscribe Message -// -async function unsubscribe(ws, json){ - - try{ - - ws.queueforsubscribe = null; - - // fast send Ok message to wallet, because unsubscribe rather always without error - ws.send(JSON.stringify({type:"Ok"})); //return; - - } catch(e) { - console.log(e) - } - +/* + Information about the clients wallet version, Client command and supported epixbox protocol + @param {object} ws - Client socket + @param {json} message - Client message see epic wallet +*/ +const clientdetails = (ws, message) => { + ws.client_details = message; + ws.send(JSON.stringify({type:"Ok"})); } -// -// Run when wallet or other epicbox want send to epicbox Slate -// it can send to other epicbox when to address domain is differnet when our epicbox domain -// -async function postslate(ws, json){ - - try { - console.log("postslate from ", json.from, "to ", json.to) - - let from = json.from.split('@') - from = from[0] - - // use externally rust program to verify addresses - it is the same which is used to verify signatures - const childadd = execFile(pathtoepicboxlib, ['verifyaddress', json.from, json.to], (erroradr, stdoutadr, stderradr) => { - if(erroradr){ - throw erroradr - } - - var isTrueSetadr = (stdoutadr === 'true'); - - if(isTrueSetadr) { - - // use rust program to verify signatures - const child = execFile(pathtoepicboxlib, ["verifysignature", from , json.str, json.signature], (error, stdout, stderr) => { - - if (error) { - throw error; - } - - var isTrueSet = (stdout === 'true'); - - - if(isTrueSet) { - - statistics.slatesReceivedInHour = statistics.slatesReceivedInHour + 1 - preparePostSlate(ws, json, "") - - } else { - - // check again signatures --- why ? it is rather never used, but it is in orginal rust code. - const child2 = execFile(pathtoepicboxlib, ["verifysignature", from , challenge, json.signature], (error, stdout, stderr) => { - - var isTrueSet2 = (stdout === 'true'); - if(isTrueSet2){ - - statistics.slatesReceivedInHour = statistics.slatesReceivedInHour + 1 - preparePostSlate(ws, json, challenge); - - } else { - ws.send(JSON.stringify({type:"Error", kind:"postslate error", description:"PostSlate error"})) - } - }) - } - - }) - - } else { - ws.send(JSON.stringify({type:"Error", kind:"postslate error", description:"PostSlate Addresses error"})) - - } - }) - +/* + Subscribe + validate client address and send back a pending slate + @param {object} ws - Client socket + @param {json} message - Client message see epic wallet +*/ +const subscribe = (ws, message) => { - } catch(err){ - console.error("postslate ", err) - ws.send(JSON.stringify({type:"Error", kind:"postslate error", description:"PostSlate error"})) + try{ - } + //set used epicbox protocol version + if(message.hasOwnProperty("ver")){ + switch (message.ver) { + case "2.0.0": + ws.epicboxver = "2.0.0"; + break; + default: + //new version is + ws.epicboxver = "3.0.0"; + break; + } + } + // verify that client is the owner of the public key + let args = ["verifysignature", message.address, ws.challenge, message.signature]; + const child = execFile(config.pathtoepicboxlib, args, (error, stdout, stderr) => { + if (error) throw error; + + // if signature is OK + if(stdout === 'true'){ + + if(config.stats){ + statistics.subscribeInHour++; + } + + // client proved that he is the owner of the public address + ws.epicPublicAddress = message.address; + + //add client listener for passthrough slates; + if(clients_publicaddress[ws.epicPublicAddress] == undefined && ws.client_details.wallet_mode == 'listener'){ + clients_publicaddress[ws.epicPublicAddress] = ws; + } + + ws.lastSubscriptionTime = getTimestamp(); + ws.pending_challenge = false; + + //if at some case a made request was not send back from client + //we set 'process_slate' back to false after 3 successfully subscriptions + //and let the client try to process not made slates again. + //max resets are limited to 3 rounds. + if(ws.sendslate_attempts >= 3 && ws.max_sendslate_attempts <= 3){ + ws.sendslate_attempts = 0; + ws.max_sendslate_attempts++; + ws.process_slate = false; + } + + //if it's not possible for client to process not made slates after 3 rounds (=9 attempts), + //then delete all not made slates from client in db + if(ws.max_sendslate_attempts >= 3){ + collection.deleteMany({ queue: ws.epicPublicAddress, made: false}); + ws.sendslate_attempts = 0; + ws.max_sendslate_attempts = 0; + ws.process_slate = false; + } + + //get not processed tx for client + //prevent sending same slate multible times + if(ws.process_slate == false){ + collection.find({ queue: ws.epicPublicAddress, made: false}).sort({ "createdat" : 1 }).limit(1).toArray().then( (res) => { + + if(res && res.length > 0) { + + if(config.stats){ + statistics.slatesAttempt++; + } + + let dbslate = res[0]; + let payload = JSON.parse(dbslate.payload); + let slate = { + type: "Slate", + from: dbslate.replyto, + str: payload.str, + signature: payload.signature, + challenge: payload.challenge, + }; + + if(ws.epicboxver == "2.0.0" || ws.epicboxver == "3.0.0"){ + slate.epicboxmsgid = dbslate.messageid; + slate.ver = ws.epicboxver; + }else{ + collection.updateOne({ messageid:dbslate.messageid }, { $set: { made:true } }); + } + + //TODO: check if this was already send on previous interval to client but client does block + //if client blocks, this will end in multible made requests + //we must set a flag here if the slate to client was already send but client did not process yet for any reasons. + + ws.send(JSON.stringify(slate)); + ws.process_slate = true; + console.log("Sent slate to", ws.epicPublicAddress); + config.debugMessage ? console.log(slate) : null; + + }else{ + + //no slate found but subscribe was ok + ws.send(JSON.stringify({type:"Ok"})); + + } + //end if result > 0 + + }); + }else{ + //send back some response + ws.sendslate_attempts++; + ws.send(JSON.stringify({type:"Ok"})); + } + + }else{ + //client cannot prove that he is the owner of the public address + if(ws.client_details.wallet_mode == 'listener'){ + delete clients_publicaddress[ws.epicPublicAddress]; + } + ws.epicPublicAddress = null; + ws.send(JSON.stringify({type: "Error", kind: "signature error", description: "Invalid signature."})); + } + }); + + }catch(err){ + console.log("Erro execute epicboxlib", err); + } } +/* + Unsubscribe and close client connection + @param {object} ws - Client socket +*/ +const unsubscribe = (ws) => { -// -// run only for wallets used ver 2.0.0 -// for standard wallets never used -// it say by message Made that slate was received and correct made in wallet -// then epicbox can remove Slate from RabbotMq and message id from mongodb -// -function made(ws, json){ - - console.log(json); - - try { - - if(json.hasOwnProperty("epicboxmsgid") && ws.epicboxver=="2.0.0" && json.hasOwnProperty("ver") && json.ver=="2.0.0"){ - - - // check signature by externally rust app - const child = execFile(pathtoepicboxlib, ["verifysignature", json.address , challenge, json.signature], (error, stdout, stderr) => { - if (error) { - throw error; - } - - var isTrueSet = (stdout === 'true'); - - if(isTrueSet) { - - console.log("Made signature OK") - - const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); - console.log("Update for ", json.epicboxmsgid) - collection.updateOne({messageid:json.epicboxmsgid, made:false}, {$set:{made:true}}).then((updateResult)=>{ - - console.log("make update result ", updateResult) - - //ws.send(JSON.stringify({type:"Ok"})) - - }).catch(console.error) - + if(ws.epicPublicAddress != null){ + if(ws.client_details.wallet_mode == 'listener'){ + delete clients_publicaddress[ws.epicPublicAddress]; } - - }); - - - } - - } catch( err ){ - - console.log(err) - } + ws.epicPublicAddress = null; + ws.close(1000, "Work complete."); + } } +/* + client sends a new tx or a response to an tx + validate address format and signature + @param {object} ws - Client socket + @param {json} message - Client message see epic wallet +*/ +const validatePostslate = (ws, message) => { -// -// run from postslate or forpostpostslat -// prepare received Slate for store in RabbitMq or send to other epicbox if domain of to address is different from this epicbox domain -// -function preparePostSlate(ws, json, chall){ - - let str = JSON.parse(json.str) - let addressto= {} - addressto.publicKey = str.destination.public_key - addressto.domain = str.destination.domain - addressto.port = str.destination.port - if(addressto.port==null ) addressto.port = 443; else addressto.port = Number(addressto.port); - - if(addressto.domain==epicbox_domain && addressto.port===epicbox_port){ - - let signed_payload = {str: json.str, challenge: chall, signature: json.signature} - signed_payload = JSON.stringify(signed_payload) - - let buf = Buffer.from(signed_payload) - let epicboxreplyto = json.from - - - const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); - - - // here insert slate to mongo - here is added messageId which is used in ver. 2.0.0 - - collection.insertOne({ queue:addressto.publicKey, made:false, payload:buf, replyto: epicboxreplyto, createdat: new Date(), expiration:86400000, messageid:uid(32) }).then((insertResult)=>{ - - ws.send(JSON.stringify({type:"Ok"})); - - // fast send if only one slate in database - - // find message id send in Made message from vallet - collection.find({ queue: addressto.publicKey, made: false}).sort({ "createdat" : 1 }).toArray().then((findResult)=>{ - - if(findResult.length==1){ - - - wss.clients.forEach(function each(client) { - if (client.readyState === 1 && client.queueforsubscribe!=null && client.queueforsubscribe==addressto.publicKey) { - - - - statistics.slatesAttempt = statistics.slatesAttempt + 1 - console.log("try check and send ", client.queueforsubscribe) - - - let fromrabbit = JSON.parse(findResult[0].payload) - let answer= {} - answer.type="Slate" - answer.from = findResult[0].replyto - answer.str = fromrabbit.str - answer.signature = fromrabbit.signature - answer.challenge = fromrabbit.challenge - - let answerstr = null - - if(client.epicboxver == "2.0.0"){ - - let messageid = findResult[0].messageid - - answer.epicboxmsgid = messageid - answer.ver = client.epicboxver - answerstr = JSON.stringify(answer) - client.send(answerstr) - console.log("Sent to 2.0.0 ", client.queueforsubscribe) - - } else { + try { + console.log("postslate from ", message.from, "to ", message.to); - answerstr = JSON.stringify(answer) - client.send(answerstr) - console.log("Looks sent to ", client.queueforsubscribe) - collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ + let publickey = message.from.split('@'); + publickey = publickey[0]; + // use epicboxlib to verify address format + let args = ['verifyaddress', message.from, message.to]; + execFile(config.pathtoepicboxlib, args, (error, stdout, stderr) => { + if(error) throw error; - }); + if(stdout === 'true') { - } - + //verify that the message we receive was signed from publickey + let args = ["verifysignature", publickey, message.str, message.signature]; + execFile(config.pathtoepicboxlib, args, (error, stdout, stderr) => { - + if (error) throw error; + if(stdout === 'true') { - } - }) + if(config.stats){ + statistics.slatesReceivedInHour++; + } + postSlate(ws, message); + }else{ + console.log("Error postslate signature", publickey); + ws.send(JSON.stringify({type: "Error", kind: "postslate error", description: "Invalid signature."})); } - }) - - }).catch((err)=>{ - - ws.send(JSON.stringify({type:"Error", kind:"Slate send error", description:"Slate problem"})) - console.error(err) - - }) - - - - - - } else { - // connect by wss to other epicbox - // when received Challange send by Message PostSlate Slate received from wallet. - // - // - sock = new WebSocket("wss://"+addressto.domain+":"+addressto.port) - sock.on('error', console.error) - sock.on('open', ()=>{console.log("Connect "+addressto.domain+":"+addressto.port)}) - sock.on('message',(mes)=>{ - try{ - ames = JSON.parse(mes) - if(ames.type=="Challenge") { - let reqqq = {type:"PostSlate", from:json.from, to:json.to, str:json.str, signature:json.signature} - sock.send(JSON.stringify(reqqq)) - - fs.writeFile('./test51pool.txt', JSON.stringify(reqqq), err => { - if (err) { - console.error(err); - } - // file written successfully - }); - - console.log("Send to wss://"+addressto.domain+":"+addressto.port) - } - if(ames.type=="Ok") { - statistics.slatesRelayedInHour = statistics.slatesRelayedInHour + 1 - console.log("Sent correct to wss://"+addressto.domain+":"+addressto.port) - ws.send(JSON.stringify({type:"Ok"})); - } - - } catch(ee){ - console.error(ee) - ws.send(JSON.stringify({type:"Error", kind:"Slate send error remote server", description:"Slate problem remote server"})); - } - }) - } + }); + }else{ + console.log("Error validate address format", message.from, message.to); + ws.send(JSON.stringify({type:"Error", kind:"postslate error", description: "Wrong address format."})); + } + }); -} - - - -// -// function warking in interval repeted in 3 sec. after finish loop -// it check all connected websockets to epicbox and if they are in Subscribe mode check if new Slate are waitng for it -// if new slate is ... when send it. -// check if wallet use 2.0.0 version -// -function forInterval(){ - - clearInterval(interval) - - let foractiveconnections = 0 - - wss.clients.forEach(function each(client) { - if (client.readyState === 1 && client.queueforsubscribe!=null) { - foractiveconnections = foractiveconnections + 1 - //console.log("Checking ", client.queueforsubscribe) - try { - - const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); - - // find message id send in Made message from vallet - collection.find({ queue: client.queueforsubscribe, made: false}).sort({ "createdat" : 1 }).limit(1).toArray().then((findResult)=>{ - + }catch(err){ + console.error("Error postslate", err); + } - if(findResult.length>0) { +} - statistics.slatesAttempt = statistics.slatesAttempt + 1 - console.log("try check and send ", client.queueforsubscribe) +/* + client sends made response if successfully processed slate + @param {object} ws - Client socket + @param {json} message - Client message see epic wallet +*/ +const made = (ws, message) => { + + if(ws.epicPublicAddress != null && message.hasOwnProperty("epicboxmsgid") && message.hasOwnProperty("ver") && (message.ver == "2.0.0" || message.ver == "3.0.0")){ + let args = []; + if(message.ver == "3.0.0"){ + args = ["verifysignature", ws.epicPublicAddress, message.epicboxmsgid, message.signature]; + }else{ + args = ["verifysignature", ws.epicPublicAddress, ws.challenge, message.signature]; + } + const child = execFile(config.pathtoepicboxlib, args, (error, stdout, stderr) => { + if (error) throw error; + + if(stdout === 'true') { + console.log("Update for ", message.epicboxmsgid); + collection.updateOne({queue: ws.epicPublicAddress, messageid: message.epicboxmsgid, made:false}, { $set: {made:true}}).then( (updateResult) => { + config.debugMessage ? console.log("DB update result", updateResult) : null; + ws.send(JSON.stringify({type:"Ok"})); + ws.process_slate = false; + ws.sendslate_attempts = 0; + //if this slate was processed then send the next slate to client via challenge->subscribe + challenge(ws); + + }); + }else{ + ws.send(JSON.stringify({type: "Error", kind: "made error", description: "Invalid signature."})); + } + }); + } +} - let fromrabbit = JSON.parse(findResult[0].payload) - let answer= {} - answer.type="Slate" - answer.from = findResult[0].replyto - answer.str = fromrabbit.str - answer.signature = fromrabbit.signature - answer.challenge = fromrabbit.challenge - let answerstr = null +/* + store tx in db or forward to foreign epicbox + if domain does not match our epicbox domain + @param {object} ws - Client socket + @param {json} message - Client message see epic wallet +*/ +const postSlate = (ws, json) => { - if(client.epicboxver == "2.0.0"){ + let str = {}; + try{ + str = JSON.parse(json.str); + }catch(err){ + console.log("Error parsing message string", err); + return; + } - let messageid = findResult[0].messageid - - answer.epicboxmsgid = messageid - answer.ver = client.epicboxver - answerstr = JSON.stringify(answer) - client.send(answerstr) - console.log("Sent to 2.0.0 ", client.queueforsubscribe) + let addressto = {}; + addressto.publicKey = str.destination.public_key; + addressto.domain = str.destination.domain; + addressto.port = str.destination.port != null ? str.destination.port : 443; + + if(addressto.domain === config.epicbox_domain && addressto.port === config.epicbox_port){ + + //challenge is not required, we keep it for backward compatibility + let signed_payload = JSON.stringify({str: json.str, challenge: "", signature: json.signature}); + let messageid = uid(32); + // insert slate to db + collection.insertOne({ + queue: addressto.publicKey, + made: false, + payload: Buffer.from(signed_payload), + replyto: json.from, + createdat: new Date(), + expiration: 86400000, + messageid: messageid + + }).catch((err)=>{ + console.error("Error insert to db", err); + }); + + //check if receiver is online, then pass slate through for faster processing + let receiver = clients_publicaddress[addressto.publicKey]; + if(receiver != undefined && receiver.process_slate == false && receiver.readyState === 1){ + + if(config.stats){ + statistics.slatesAttempt++; + } + + let slate = { + type: "Slate", + from: json.from, + str: json.str, + signature: json.signature, + challenge: "", + }; + + //TODO: cleanup version stuff, kick out old clients <2.0.0 + if(receiver.epicboxver == "2.0.0" || receiver.epicboxver == "3.0.0"){ + slate.epicboxmsgid = messageid; + slate.ver = receiver.epicboxver; + }else{ + collection.updateOne({ messageid:messageid }, { $set: { made:true } }); + } - } else { + ws.send(JSON.stringify({type:"Ok"})); - answerstr = JSON.stringify(answer) - client.send(answerstr) - console.log("Looks sent to ", client.queueforsubscribe) - collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ + receiver.send(JSON.stringify(slate)); + receiver.process_slate = true; + console.log("Passthrough slate to", receiver.epicPublicAddress); + config.debugMessage ? console.log(slate) : null; + }else{ + ws.send(JSON.stringify({type:"Ok"})); + } - }); + }else{ + + // forward tx to foreign epicbox + sock = new WebSocket("wss://" + addressto.domain +":"+ addressto.port); + sock.on('error', console.error); + sock.on('open', () => { + console.log("Connect "+ addressto.domain +":"+ addressto.port); + }); + sock.on('message', (data) => { + try{ + message = JSON.parse(data); + if(message.type === "Challenge") { + let slate = {type: "PostSlate", from: json.from, to: json.to, str: json.str, signature: json.signature}; + sock.send(JSON.stringify(slate)); + } + + if( message.type === "Ok" ) { + + if(config.stats){ + statistics.slatesRelayedInHour++; + } - } - + console.log("Sent to wss://"+ addressto.domain +":"+ addressto.port); + ws.send(JSON.stringify({type:"Ok"})); + } - } else { - // console.log("msgrabbit ", msgrabbit) - //console.log("Error ", err) - } + }catch(err){ + console.error("Error forward slate to foreign epicbox", err); + ws.send(JSON.stringify({type: "Error", kind: "foreign epicbox", description:"Error send Slate to foreign epicbox"})); + } + }); - }); + } +} - - } catch(err){ - console.log(err) +/* + send recurring challenge -> subscribe cycles to all clients +*/ +const challengeInterval = () => { + + wss.clients.forEach( (ws) => { + + if (ws.readyState === 1 + && ws.epicPublicAddress !== null + //do not spam clients with challenge requests + //do not send new challenge if old challenge request was not subscribed (when client blocks) + && (ws.pending_challenge == false || (getTimestamp() - ws.lastSubscriptionTime >= config.challenge_interval)) + ) { + try{ + + challenge(ws); + }catch(err){ + console.log("Send Interval challenge error ", err); + } } - - } }); - statistics.activeconnections = foractiveconnections - - interval = setInterval( forInterval, intervalperiod); - } +/* + load config for epixbox custom settings +*/ +const loadConfig = async(filePath) =>{ + try{ -function forIntervalChallenge(){ - - console.log("Challenge Interval") - - wss.clients.forEach(function each(client) { - if (client.readyState === 1 && client.queueforsubscribe!=null && client.epicboxver == "2.0.0") { - - try{ - - client.send(JSON.stringify({"type": "Challenge","str": challenge})) - - } catch(err){ - - console.log("Send Interval challenge error ", err) - } - } - }); - - -} - - + let jsonData = fs.readFileSync(filePath, 'utf8'); + let data = JSON.parse(jsonData); -// must be replice -let changeStream; -async function run() { - try { - - const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); + config.mongourl = data.mongo_url != undefined ? data.mongo_url : config.mongourl; + config.epicbox_domain = data.epicbox_domain != undefined ? data.epicbox_domain : config.epicbox_domain; + config.epicbox_port = data.epicbox_port != undefined ? data.epicbox_port : config.epicbox_port; + config.localepicboxserviceport = data.local_epicbox_service_port != undefined ? data.local_epicbox_service_port: config.localepicboxserviceport; + config.pathtoepicboxlib = data.path_to_epicboxlib_exec_file != undefined ? data.path_to_epicboxlib_exec_file : config.pathtoepicboxlib; + config.db_name = data.mongo_dbName != undefined ? data.mongo_dbName : config.db_name; + config.collection_name = data.mongo_collection_name != undefined ? data.mongo_collection_name : config.collection_name; + config.challenge_interval = data.challenge_interval != undefined ? data.challenge_interval : config.challenge_interval; + config.debugMessage = data.debug != undefined ? data.debug : config.debugMessage; + config.stats = data.stats != undefined ? data.stats : config.stats; - // Open a Change Stream on the "haikus" collection - changeStream = collection.watch(); - // Print change events - for await (const change of changeStream) { - console.log("Received change:\n", change); + } catch(err){ + console.error(err); } - await changeStream.close(); - - } finally { - console.log("End") - } -} - - -// -// main starting function -// -async function main() { - await mongoclient.connect(); - console.log('Connected successfully to mongo'); +} - //run().catch(console.log); - - server.listen(localepicboxserviceport) - - interval = setInterval( forInterval, 2000); - - setInterval(forIntervalChallenge, 3*60*1000); +const startEpicbox = async() => { - return "Epicbox ready to work."; + let configPath = customConfig != -1 && process.argv[customConfig+1] != undefined ? process.argv[customConfig+1] : './config.json'; + console.log("Use config:", configPath); + await loadConfig(configPath); + mongoclient = new MongoClient(config.mongourl); + let db = mongoclient.db(config.db_name); + collection = db.collection(config.collection_name); + await mongoclient.connect(); + console.log('Connected successfully to MongoDB'); + server.listen(config.localepicboxserviceport); + setInterval(challengeInterval, config.challenge_interval); + console.log("Epicbox ready to work."); } // We are using this single function to handle multiple signals -function handle(signal) { - console.log(`So the signal which I have Received is: ${signal}`); - +const handle = (signal) => { + console.log(`So the signal which I have Received is: ${signal}`); wss.clients.forEach(function each(client) { - client.close(); - }); mongoclient.close(); process.exit() - } - + process.on('SIGINT', handle); process.on('SIGBREAK', handle); //process.on("SIGTERM", handle); //process.on("SIGKILL", handle); - -main() - .then(console.log) - .catch(console.error) - -// That's all -// It is one day created software and seven days finding bugs :))) -// If you has suggestion or something is starnge for you simple ask me on keybase or telegram -// Thank you for reading. Sorry my English. - - - +startEpicbox(); diff --git a/app_mongo_many.js b/app_mongo_many.js index e7d2819..056cfa2 100644 --- a/app_mongo_many.js +++ b/app_mongo_many.js @@ -1,5 +1,5 @@ /* -This is a program for an elite, narrow group of several Epic Box operators in the world. +This is a program for an elite, narrow group of several Epic Box operators in the world. If you are not one of them, reading this code is pointless. */ @@ -18,7 +18,7 @@ const fs = require("fs") // Html server used for websockets server const {createServer} = require("http") -// Used for execute rust module which fast check addreses and verify signatures +// Used for execute rust module which fast check addreses and verify signatures const { execFile } = require('node:child_process') // For generate uid message id for Slate sending to wallet. @@ -56,7 +56,7 @@ var interval = null // time of interval ( ms ) in which epicbox can try repeat send the oldest slate for address. // -var intervalperiod = 4000 // 4 seconds +var intervalperiod = 4000 // 4 seconds //Where is executable rust named epicboxlib compiled from epicboxlib subfolder @@ -84,7 +84,7 @@ var fast_send_master_ip = "localhost" var fast_send_port = 3427 -// interval for read data from config.json +// interval for read data from config.json var varinterval = 1000*60*5; @@ -101,11 +101,11 @@ const vardata = fs.readFileSync('config_many.json', function getvars(data){ - + try { let v = JSON.parse(data) - + mongourl = v.mongo_url dbName = v.mongo_dbName collectionname = v.mongo_collection_name @@ -117,18 +117,18 @@ function getvars(data){ pathtoepicboxlib = v.path_to_epicboxlib_exec_file fast_send_repeats = v.fast_send_repeats fast_send_repeat_interval_ms = v.fast_send_repeat_interval_ms - + fast_send_master = v.fast_send_master, fast_send_slaves = v.fast_send_slaves, fast_send_master_ip = v.fast_send_master_ip, - fast_send_port = v.fast_send_port + fast_send_port = v.fast_send_port varinterval = v.var_interval console.log(data) - + } catch(err) { console.error(err) - + } @@ -148,9 +148,9 @@ setInterval(()=>{ console.error(err); return; } - + let v = JSON.parse(data) - + challenge = v.challenge epicbox_domain = v.epicbox_domain epicbox_port = v.epicbox_port @@ -180,7 +180,7 @@ const mongoclient = new MongoClient(mongourl) var statistics = { - + from: new Date(), connectionsInHour: 0, slatesReceivedInHour: 0, @@ -193,7 +193,7 @@ var statistics = { setInterval(()=>{ - + statistics = { from: new Date(), @@ -203,7 +203,7 @@ setInterval(()=>{ slatesSentInHour: 0, subscribeInHour: 0, activeconnections: 0, - slatesAttempt:0 + slatesAttempt:0 } },60*60*1000); @@ -281,11 +281,7 @@ var ws_fastsend = null; function startfastsendslave(){ - - ws_fastsend = new WebSocket('ws://'+fast_send_master_ip+":"+fast_send_port); - - ws_fastsend.on('error', (err)=>{ @@ -303,8 +299,6 @@ function startfastsendslave(){ }); - - ws_fastsend.on('open', function open() { ws_fastsend.send(JSON.stringify({type:"HelloMaster", domain:epicbox_domain, port: epicbox_port })); }); @@ -323,7 +317,7 @@ function startfastsendslave(){ ws_fastsend.close(); } - + } else if(json.type=="FastSendMessage"){ @@ -331,20 +325,15 @@ function startfastsendslave(){ wss.clients.forEach(function each(client) { if (client.readyState === 1 && client.queueforsubscribe!=null && client.queueforsubscribe==json.queueforsubscribe) { - - const db = mongoclient.db(dbName); const collection = db.collection(collectionname); - - // find message id send without made = false because can be more the same wallet connected .. ???? + + // find message id send without made = false because can be more the same wallet connected .. ???? // maybe findOne will be better here collection.find({ messageid: json.uid}).toArray().then((findResult)=>{ - if(findResult.length>0){ - - statistics.slatesAttempt = statistics.slatesAttempt + 1 console.log("try check and send ", client.queueforsubscribe) @@ -361,44 +350,41 @@ function startfastsendslave(){ if(client.epicboxver == "2.0.0"){ - let messageid = findResult[0].messageid - + let messageid = findResult[0].messageid + answer.epicboxmsgid = messageid answer.ver = client.epicboxver - answerstr = JSON.stringify(answer) - client.send(answerstr) + answerstr = JSON.stringify(answer) + client.send(answerstr) console.log("Sent to 2.0.0 ", client.queueforsubscribe) } else { - answerstr = JSON.stringify(answer) + answerstr = JSON.stringify(answer) client.send(answerstr) - console.log("Looks sent to ", client.queueforsubscribe) + console.log("Looks sent to ", client.queueforsubscribe) collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ - }); } } // end if - + }) // collection find } //end if - })// end wss.clients - - - + }) // end wss.clients - } + } } catch(err){ console.error(err) } - }); + + }); } @@ -412,7 +398,7 @@ if(fast_send_master) { if(req.headers['x-forwarded-for']) ws.iphere = req.headers['x-forwarded-for'].split(',')[0].trim(); const ip2 = req.socket.remoteAddress; - + fast_send_slaves.forEach((slave, index)=>{ if(ip2!=slave && ws.iphere!=slave) { @@ -425,7 +411,6 @@ if(fast_send_master) { return; - } else { console.log("Trusted connected ip: "+ip2+" "+ws.iphere) @@ -437,39 +422,36 @@ if(fast_send_master) { ws.on('error', console.error); ws.on('message', function message(data) { - + try{ let json = JSON.parse(data); if(json.type=="FastSendMessage") { - - // send message about new slate to slaves received from other slave + + // send message about new slate to slaves received from other slave ws_fastsend_master.clients.forEach(function each(client) { if (client !== ws && client.readyState === WebSocket.OPEN) { client.send(data); console.log("Send message about new slate to slaves received from other slave") } }); - + // check owns connected wallets if could receive this slate wss.clients.forEach(function each(client) { if (client.readyState === 1 && client.queueforsubscribe!=null && client.queueforsubscribe==json.queueforsubscribe) { - console.log("Found wallet where need send Slate - Master") + console.log("Found wallet where need send Slate - Master") const db = mongoclient.db(dbName); const collection = db.collection(collectionname); - - // find message id send without made = false because can be more the same wallet connected .. ???? + + // find message id send without made = false because can be more the same wallet connected .. ???? // maybe findOne will be better here collection.find({ messageid: json.uid}).toArray().then((findResult)=>{ - if(findResult.length>0){ - - statistics.slatesAttempt = statistics.slatesAttempt + 1 console.log("try check and send ", client.queueforsubscribe) @@ -486,34 +468,32 @@ if(fast_send_master) { if(client.epicboxver == "2.0.0"){ - let messageid = findResult[0].messageid - + let messageid = findResult[0].messageid + answer.epicboxmsgid = messageid answer.ver = client.epicboxver - answerstr = JSON.stringify(answer) - client.send(answerstr) + answerstr = JSON.stringify(answer) + client.send(answerstr) console.log("Sent to 2.0.0 ", client.queueforsubscribe) } else { - answerstr = JSON.stringify(answer) + answerstr = JSON.stringify(answer) client.send(answerstr) - console.log("Looks sent to ", client.queueforsubscribe) + console.log("Looks sent to ", client.queueforsubscribe) collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ - }); } } // end if - + }) // collection find } //end if - })// end wss.clients - + }) // end wss.clients } else if (json.type=="HelloMaster"){ @@ -545,7 +525,7 @@ if(fast_send_master) { } else { - startfastsendslave() + startfastsendslave() } @@ -564,7 +544,7 @@ if(fast_send_master) { const server = createServer(requestListener); -// uncommented WebSocket creation with option for zip messages +// uncommented WebSocket creation with option for zip messages /* const wss = new WebSocketServer({ //port: 3425, @@ -593,12 +573,12 @@ const wss = new WebSocketServer({ //WebSocket creation using HTTML server const wss = new WebSocketServer({ - server:server, + server:server, }) -// function pon connectione - run when wallets connect by webscoket to epicbox +// function pon connectione - run when wallets connect by webscoket to epicbox wss.on('connection', function connection(ws, req) { - + statistics.connectionsInHour = statistics.connectionsInHour+1; ws.uid = uid(5); @@ -612,30 +592,30 @@ wss.on('connection', function connection(ws, req) { ws.queueforsubscribe = null - ws.on('close', (code, reason)=>{ - try{ - if(ws.queueforsubscribe!=null) { - console.log(`[${ws.uid}]`," Socket close for ", ws.queueforsubscribe) - ws.queueforsubscribe = null; - } - console.log( `[${new Date().toLocaleTimeString()}] Close by code: `, code, " and reason ", reason.toString()) + try { - } catch(err){ - console.error(err) - } + if(ws.queueforsubscribe!=null) { + console.log(`[${ws.uid}]`," Socket close for ", ws.queueforsubscribe) + ws.queueforsubscribe = null; + } + console.log( `[${new Date().toLocaleTimeString()}] Close by code: `, code, " and reason ", reason.toString()) + + } catch(err){ + console.error(err) + } }) ws.on('error', (errws) =>{ console.error(errws) - try{ - + try { + if(ws.queueforsubscribe!=null) { ws.queueforsubscribe = null; - - } + } + } catch(err){ console.error(err) } @@ -647,13 +627,13 @@ wss.on('connection', function connection(ws, req) { // one Made is added for receive accept from wallets ( epicbox 2.0.0 suggestion ) // ws.on('message', function message(data) { - + // console.log('received: %s', data) try{ if(data.toString()=="ping") { ws.send("pong"); /*console.log("ping");*/ return; } - if(data.toString()=="pong") {ws.send("ping"); /*console.log("pong");*/return;} + if(data.toString()=="pong") {ws.send("ping"); /*console.log("pong");*/return; } let json=JSON.parse(data) - + if(json.type=="Challenge") { console.log(json) console.log('[%s][%s] -> [%s] send return [%s]', new Date().toLocaleTimeString(), ws.iphere, "Challenge", challenge) @@ -663,11 +643,11 @@ wss.on('connection', function connection(ws, req) { } else if(json.type=="Subscribe") { console.log(json) console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "Subscribe") - subscribe(ws, json) + subscribe(ws, json) } else if(json.type=="Unsubscribe") { console.log(json) console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "Unsubscribe") - unsubscribe(ws, json) + unsubscribe(ws, json) } else if(json.type=="PostSlate"){ console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "PostSlate") postslate(ws, json) @@ -678,18 +658,19 @@ wss.on('connection', function connection(ws, req) { } else if(json.type=="GetVersion"){ console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "GetVersion") let st = JSON.stringify({type:"GetVersion", str:protver}) - console.log(st) + console.log(st) ws.send(JSON.stringify({type:"GetVersion", str:protver})) } else if(json.type=="FastSend"){ console.log('[%s][%s] -> [%s]', new Date().toLocaleTimeString(), ws.iphere, "GetVersion") fastsend(ws) - } else console.log('received: %s', data); + } else console.log('received: %s', data); } catch(err){ - + } + }); // here we send Challenge to wallet or other epicbox when connected @@ -719,8 +700,8 @@ async function fastsend(ws){ clearInterval(ws.fastsendInterval); } - }, fast_send_repeat_interval_ms); - + }, fast_send_repeat_interval_ms); + } @@ -729,21 +710,21 @@ async function fastsend(ws){ // async function subscribe(ws, json){ console.log(`[${ws.uid}]`," subscribe ", json.address) - + try{ - - // check if wallet wants use ver 2.0.0 - if(json.hasOwnProperty("ver") && json.ver=="2.0.0") ws.epicboxver = "2.0.0"; - - - // start check using externally rust program for verify signature send from wallet + + // check if wallet wants use ver 2.0.0 + if(json.hasOwnProperty("ver") && json.ver=="2.0.0") ws.epicboxver = "2.0.0"; + + + // start check using externally rust program for verify signature send from wallet const child = execFile(pathtoepicboxlib, ["verifysignature", json.address , challenge, json.signature], (error, stdout, stderr) => { if (error) { throw error; } - + var isTrueSet = (stdout === 'true'); - + // if sugnature is OK if(isTrueSet) { @@ -752,9 +733,9 @@ async function subscribe(ws, json){ // for backward for older wallets /* try { - + const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); + const collection = db.collection(collectionname); // find message id send in Made message from vallet collection.find({ queue: json.address, made: false}).sort({ "createdat" : 1 }).limit(1).toArray().then((findResult)=>{ @@ -778,49 +759,48 @@ async function subscribe(ws, json){ if(ws.epicboxver == "2.0.0"){ - let messageid = findResult[0].messageid - + let messageid = findResult[0].messageid + answer.epicboxmsgid = messageid answer.ver = ws.epicboxver - answerstr = JSON.stringify(answer) - ws.send(answerstr) + answerstr = JSON.stringify(answer) + ws.send(answerstr) console.log("Sent to 2.0.0 ", json.address) } else { - answerstr = JSON.stringify(answer) + answerstr = JSON.stringify(answer) ws.send(answerstr) - console.log("Looks sent to ", json.address) + console.log("Looks sent to ", json.address) collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ }); } - + } else { // console.log("msgrabbit ", msgrabbit) //console.log("Error ", err) - } + } - }); + }); - } catch(err){ console.log(err) } */ -// and for backward for older wallets +// and for backward for older wallets statistics.subscribeInHour = statistics.subscribeInHour+1 - if(ws.epicboxver) console.log(ws.epicboxver) - // here we store address of wallet which is queue in RabbitMq - ws.queueforsubscribe = json.address + if(ws.epicboxver) console.log(ws.epicboxver) + // here we store address of wallet which is queue in RabbitMq + ws.queueforsubscribe = json.address ws.send(JSON.stringify({type:"Ok"})) @@ -829,7 +809,7 @@ async function subscribe(ws, json){ ws.send(JSON.stringify({type:"Error", kind:"signature error", description:"Signature error"})) } }); - + } catch(err){ console.log(err) ws.send(JSON.stringify({type:"Error", kind:"signature error", description:"Signature error"})) @@ -841,17 +821,17 @@ async function subscribe(ws, json){ // run when wallet sent Unsuscribe Message // async function unsubscribe(ws, json){ - + try{ - + ws.queueforsubscribe = null; - // fast send Ok message to wallet, because unsubscribe rather always without error + // fast send Ok message to wallet, because unsubscribe rather always without error ws.send(JSON.stringify({type:"Ok"})); //return; } catch(e) { console.log(e) - } + } } @@ -861,7 +841,7 @@ async function unsubscribe(ws, json){ // it can send to other epicbox when to address domain is differnet when our epicbox domain // async function postslate(ws, json){ - + try { console.log("postslate from ", json.from, "to ", json.to) @@ -873,10 +853,10 @@ async function postslate(ws, json){ if(erroradr){ throw erroradr } - + var isTrueSetadr = (stdoutadr === 'true'); - if(isTrueSetadr) { + if(isTrueSetadr) { // use rust program to verify signatures const child = execFile(pathtoepicboxlib, ["verifysignature", from , json.str, json.signature], (error, stdout, stderr) => { @@ -884,37 +864,37 @@ async function postslate(ws, json){ if (error) { throw error; } - + var isTrueSet = (stdout === 'true'); - - + + if(isTrueSet) { - + statistics.slatesReceivedInHour = statistics.slatesReceivedInHour + 1 preparePostSlate(ws, json, "") - + } else { - + // check again signatures --- why ? it is rather never used, but it is in orginal rust code. const child2 = execFile(pathtoepicboxlib, ["verifysignature", from , challenge, json.signature], (error, stdout, stderr) => { - + var isTrueSet2 = (stdout === 'true'); if(isTrueSet2){ statistics.slatesReceivedInHour = statistics.slatesReceivedInHour + 1 preparePostSlate(ws, json, challenge); - + } else { ws.send(JSON.stringify({type:"Error", kind:"postslate error", description:"PostSlate error"})) } }) - } + } }) } else { ws.send(JSON.stringify({type:"Error", kind:"postslate error", description:"PostSlate Addresses error"})) - + } }) @@ -923,7 +903,7 @@ async function postslate(ws, json){ console.error("postslate ", err) ws.send(JSON.stringify({type:"Error", kind:"postslate error", description:"PostSlate error"})) - } + } } @@ -938,20 +918,20 @@ async function postslate(ws, json){ function made(ws, json){ console.log(json); - + try { if(json.hasOwnProperty("epicboxmsgid") && ws.epicboxver=="2.0.0" && json.hasOwnProperty("ver") && json.ver=="2.0.0"){ - // check signature by externally rust app + // check signature by externally rust app const child = execFile(pathtoepicboxlib, ["verifysignature", json.address , challenge, json.signature], (error, stdout, stderr) => { if (error) { throw error; } var isTrueSet = (stdout === 'true'); - + if(isTrueSet) { console.log("Made signature OK") @@ -963,16 +943,16 @@ function made(ws, json){ console.log("make update result ", updateResult) - //ws.send(JSON.stringify({type:"Ok"})) + //ws.send(JSON.stringify({type:"Ok"})) }).catch(console.error) } - + }); - - } + + } } catch( err ){ @@ -997,16 +977,16 @@ function preparePostSlate(ws, json, chall){ if(addressto.port==null ) addressto.port = 443; else addressto.port = Number(addressto.port); if(addressto.domain==epicbox_domain && addressto.port===epicbox_port){ - - let signed_payload = {str: json.str, challenge: chall, signature: json.signature} + + let signed_payload = {str: json.str, challenge: chall, signature: json.signature} signed_payload = JSON.stringify(signed_payload) - + let buf = Buffer.from(signed_payload) let epicboxreplyto = json.from const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); + const collection = db.collection(collectionname); // here insert slate to mongo - here is added messageId which is used in ver. 2.0.0 @@ -1032,7 +1012,7 @@ function preparePostSlate(ws, json, chall){ } catch(errtoslaves){ //console.log(errtoslaves) - } + } } else { @@ -1081,49 +1061,40 @@ function preparePostSlate(ws, json, chall){ if(client.epicboxver == "2.0.0"){ - let messageid = findResult[0].messageid - + let messageid = findResult[0].messageid + answer.epicboxmsgid = messageid answer.ver = client.epicboxver - answerstr = JSON.stringify(answer) - client.send(answerstr) + answerstr = JSON.stringify(answer) + client.send(answerstr) console.log("Sent to 2.0.0 ", client.queueforsubscribe) } else { - answerstr = JSON.stringify(answer) + answerstr = JSON.stringify(answer) client.send(answerstr) - console.log("Looks sent to ", client.queueforsubscribe) + console.log("Looks sent to ", client.queueforsubscribe) collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ }); } - - - - } }) - } - }) + }) }).catch((err)=>{ - - ws.send(JSON.stringify({type:"Error", kind:"Slate send error", description:"Slate problem"})) + + ws.send(JSON.stringify({type:"Error", kind:"Slate send error", description:"Slate problem"})) console.error(err) }) - - - - } else { // connect by wss to other epicbox // when received Challange send by Message PostSlate Slate received from wallet. @@ -1149,28 +1120,25 @@ function preparePostSlate(ws, json, chall){ console.log("Send to wss://"+addressto.domain+":"+addressto.port) } if(ames.type=="Ok") { - statistics.slatesRelayedInHour = statistics.slatesRelayedInHour + 1 - console.log("Sent correct to wss://"+addressto.domain+":"+addressto.port) - ws.send(JSON.stringify({type:"Ok"})); - } - + statistics.slatesRelayedInHour = statistics.slatesRelayedInHour + 1 + console.log("Sent correct to wss://"+addressto.domain+":"+addressto.port) + ws.send(JSON.stringify({type:"Ok"})); + } } catch(ee){ - console.error(ee) - ws.send(JSON.stringify({type:"Error", kind:"Slate send error remote server", description:"Slate problem remote server"})); + console.error(ee) + ws.send(JSON.stringify({type:"Error", kind:"Slate send error remote server", description:"Slate problem remote server"})); } }) } - } - // // function warking in interval repeted in 3 sec. after finish loop // it check all connected websockets to epicbox and if they are in Subscribe mode check if new Slate are waitng for it // if new slate is ... when send it. -// check if wallet use 2.0.0 version +// check if wallet use 2.0.0 version // function forInterval(){ @@ -1183,9 +1151,9 @@ function forInterval(){ foractiveconnections = foractiveconnections + 1 //console.log("Checking ", client.queueforsubscribe) try { - + const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); + const collection = db.collection(collectionname); // find message id send in Made message from vallet collection.find({ queue: client.queueforsubscribe, made: false}).sort({ "createdat" : 1 }).limit(1).toArray().then((findResult)=>{ @@ -1209,40 +1177,35 @@ function forInterval(){ if(client.epicboxver == "2.0.0"){ - let messageid = findResult[0].messageid - + let messageid = findResult[0].messageid + answer.epicboxmsgid = messageid answer.ver = client.epicboxver - answerstr = JSON.stringify(answer) - client.send(answerstr) + answerstr = JSON.stringify(answer) + client.send(answerstr) console.log("Sent to 2.0.0 ", client.queueforsubscribe) } else { - answerstr = JSON.stringify(answer) + answerstr = JSON.stringify(answer) client.send(answerstr) - console.log("Looks sent to ", client.queueforsubscribe) + console.log("Looks sent to ", client.queueforsubscribe) collection.updateOne({messageid:findResult[0].messageid, made:false}, {$set:{made:true} }).then((updateResult)=>{ - }); } - } else { // console.log("msgrabbit ", msgrabbit) //console.log("Error ", err) - } - + } - }); + }); - - } catch(err){ + } catch(err) { console.log(err) } - } }); @@ -1254,14 +1217,13 @@ function forInterval(){ } - function forIntervalChallenge(){ console.log("Challenge Interval") wss.clients.forEach(function each(client) { if (client.readyState === 1 && client.queueforsubscribe!=null && client.epicboxver == "2.0.0") { - + try{ client.send(JSON.stringify({"type": "Challenge","str": challenge})) @@ -1271,8 +1233,8 @@ function forIntervalChallenge(){ console.log("Send Interval challenge error ", err) } } - }); + }); } @@ -1282,9 +1244,9 @@ function forIntervalChallenge(){ let changeStream; async function run() { try { - + const db = mongoclient.db(dbName); - const collection = db.collection(collectionname); + const collection = db.collection(collectionname); // Open a Change Stream on the "haikus" collection changeStream = collection.watch(); @@ -1293,7 +1255,7 @@ async function run() { console.log("Received change:\n", change); } await changeStream.close(); - + } finally { console.log("End") } @@ -1309,12 +1271,12 @@ async function main() { console.log('Connected successfully to mongo'); //run().catch(console.log); - + server.listen(localepicboxserviceport) - + interval = setInterval( forInterval, 2000); - setInterval(forIntervalChallenge, 3*60*1000); + setInterval(forIntervalChallenge, 1*60*1000); // 60 sec return "Epicbox ready to work."; @@ -1327,7 +1289,7 @@ function handle(signal) { wss.clients.forEach(function each(client) { - + client.close(); }); @@ -1336,7 +1298,7 @@ function handle(signal) { process.exit() } - + process.on('SIGINT', handle); process.on('SIGBREAK', handle); //process.on("SIGTERM", handle); @@ -1352,5 +1314,3 @@ main() // If you has suggestion or something is starnge for you simple ask me on keybase or telegram // Thank you for reading. Sorry my English. - - diff --git a/config.json b/config.json deleted file mode 100644 index a5cfb1e..0000000 --- a/config.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "mongo_url": "mongodb://localhost:2701", - "mongo_dbName": "epicbox", - "mongo_collection_name": "slates", - "challenge": "7WUDtkSaKyGRUnQ22rE3QUXChV8DmA6NnunDYP4vheTpc", - "epicbox_domain": "epicbox.fastepic.eu", - "epicbox_port": 443, - "local_epicbox_service_port": 3424, - "interval_period_ms": 4000, - "path_to_epicboxlib_exec_file": "./epicboxlib", - "fast_send_repeats": 20, - "fast_send_repeat_interval_ms": 1000, - "var_interval": 300000 -} \ No newline at end of file diff --git a/default_config.json b/default_config.json new file mode 100644 index 0000000..6a71eb0 --- /dev/null +++ b/default_config.json @@ -0,0 +1,13 @@ +{ + "mongo_url": "mongodb://localhost:27017/epicbox", + "mongo_dbName": "epicbox", + "mongo_collection_name": "slates", + "epicbox_domain": "epicbox.your-domain.com", + "epicbox_port": 443, + "local_epicbox_service_port": 3423, + "path_to_epicboxlib_exec_file": "./epicboxlib", + "challenge_interval": 60000, + "debug": false, + "stats": false + +} diff --git a/epicboxlib/Cargo.lock b/epicboxlib/Cargo.lock index 4ef2320..ec45414 100644 --- a/epicboxlib/Cargo.lock +++ b/epicboxlib/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -17,15 +17,31 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array 0.14.7", +] + [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ - "memchr 2.5.0", + "memchr 2.7.1", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -58,9 +74,9 @@ checksum = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -115,9 +131,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -134,7 +150,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "safemem", ] @@ -144,6 +160,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" + [[package]] name = "base64ct" version = "1.6.0" @@ -156,7 +178,7 @@ version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0e8c8a600052b52482eff2cf4d810e462fdff1f656ac1ecb6232132a1ed7def" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "crunchy 0.1.6", ] @@ -198,6 +220,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "blake2-rfc" version = "0.2.18" @@ -237,7 +265,7 @@ checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ "block-padding", "byte-tools 0.3.1", - "byteorder 1.4.3", + "byteorder 1.5.0", "generic-array 0.12.4", ] @@ -247,7 +275,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", ] [[package]] @@ -261,9 +298,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-tools" @@ -285,9 +322,9 @@ checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -295,16 +332,30 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" dependencies = [ - "byteorder 1.4.3", - "either", + "byteorder 1.5.0", "iovec", ] +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cexpr" @@ -327,20 +378,54 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.17", "serde", - "time", "wasm-bindgen", - "winapi 0.3.9", + "windows-targets 0.48.5", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", ] [[package]] @@ -389,30 +474,20 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.49" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "colored" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" +checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" dependencies = [ - "atty", + "is-terminal", "lazy_static", "winapi 0.3.9", ] @@ -423,17 +498,27 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -449,79 +534,28 @@ dependencies = [ [[package]] name = "croaring" -version = "0.3.10" -source = "git+https://github.com/EricShimizuKarbstein/croaring-rs.git?branch=not-native-march#59e23d8d8b0cef377d6dc506a1b872b09eebba47" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7266f0a7275b00ce4c4f4753e8c31afdefe93828101ece83a06e2ddab1dd1010" dependencies = [ + "byteorder 1.5.0", "croaring-sys", - "libc", ] [[package]] name = "croaring-sys" -version = "0.3.10" -source = "git+https://github.com/EricShimizuKarbstein/croaring-rs.git?branch=not-native-march#59e23d8d8b0cef377d6dc506a1b872b09eebba47" -dependencies = [ - "bindgen", - "cc", - "libc", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg 1.1.0", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard 1.1.0", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "e47112498c394a7067949ebc07ef429b7384a413cf0efcf675846a47bcd307fb" dependencies = [ - "autocfg 1.1.0", - "cfg-if 0.1.10", - "lazy_static", + "cc", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -536,22 +570,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "crypto-mac" -version = "0.11.1" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", - "subtle", + "generic-array 0.14.7", + "rand_core 0.6.4", + "typenum", ] [[package]] -name = "ct-logs" -version = "0.4.0" +name = "crypto-mac" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a4bf5107667e12bf6ce31a3a5066d67acc88942b6742117a41198734aaccaa" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "sct", + "generic-array 0.14.7", + "subtle", ] [[package]] @@ -560,62 +596,18 @@ version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d59fed08e452f286b251f88b2fc64a01f50a7b263aa09557ad7285d9e7fa" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "clear_on_drop", "digest 0.8.1", "rand_core 0.3.1", "subtle", ] -[[package]] -name = "cxx" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2 1.0.51", - "quote 1.0.23", - "scratch", - "syn 1.0.109", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" -dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", -] - [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "digest" @@ -641,7 +633,17 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", ] [[package]] @@ -695,9 +697,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "enum_primitive" @@ -723,54 +725,54 @@ dependencies = [ [[package]] name = "epic_api" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "bigint", + "bytes 0.5.6", "easy-jsonrpc-mw", "epic_chain", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_core", "epic_p2p", "epic_pool", "epic_store", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "failure", - "failure_derive", - "futures", - "http", + "epic_util", + "futures 0.3.30", + "http 0.2.11", "hyper", "hyper-rustls", "hyper-timeout", + "hyper-tls", "lazy_static", "log", "regex", - "ring", + "ring 0.16.20", "rustls", + "rustls-pemfile", "serde", "serde_derive", "serde_json", + "thiserror", "tokio", - "tokio-core", "tokio-rustls", - "tokio-tcp", - "url 1.7.2", + "url", ] [[package]] name = "epic_chain" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "bigint", "bit-vec", "bitflags 1.3.2", - "byteorder 1.4.3", + "byteorder 1.5.0", "chrono", "croaring", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "epic_keychain 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_core", + "epic_keychain", "epic_store", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_util", "failure", "failure_derive", "lazy_static", @@ -783,51 +785,17 @@ dependencies = [ [[package]] name = "epic_core" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" -dependencies = [ - "bigint", - "blake2-rfc", - "byteorder 1.4.3", - "chrono", - "croaring", - "enum_primitive", - "epic_keychain 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "failure", - "failure_derive", - "keccak-hash", - "lazy_static", - "log", - "lru-cache", - "md5", - "num 0.2.1", - "num-bigint 0.2.6", - "progpow", - "rand 0.6.5", - "randomx", - "serde", - "serde_derive", - "serde_json", - "sha2 0.8.2", - "siphasher", - "uuid 0.6.5", - "zeroize", -] - -[[package]] -name = "epic_core" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?branch=master#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "bigint", "blake2-rfc", - "byteorder 1.4.3", + "byteorder 1.5.0", "chrono", "croaring", "enum_primitive", - "epic_keychain 3.3.2 (git+https://github.com/EpicCash/epic?branch=master)", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?branch=master)", + "epic_keychain", + "epic_util", "failure", "failure_derive", "keccak-hash", @@ -851,36 +819,13 @@ dependencies = [ [[package]] name = "epic_keychain" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" -dependencies = [ - "blake2-rfc", - "byteorder 1.4.3", - "digest 0.9.0", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "hmac", - "lazy_static", - "log", - "pbkdf2", - "rand 0.6.5", - "ripemd160", - "serde", - "serde_derive", - "serde_json", - "sha2 0.9.9", - "uuid 0.6.5", - "zeroize", -] - -[[package]] -name = "epic_keychain" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?branch=master#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "blake2-rfc", - "byteorder 1.4.3", + "byteorder 1.5.0", "digest 0.9.0", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?branch=master)", + "epic_util", "hmac", "lazy_static", "log", @@ -897,17 +842,17 @@ dependencies = [ [[package]] name = "epic_p2p" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "bitflags 1.3.2", - "bytes", + "bytes 0.4.12", "chrono", "enum_primitive", "epic_chain", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_core", "epic_store", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_util", "log", "lru-cache", "net2", @@ -920,15 +865,15 @@ dependencies = [ [[package]] name = "epic_pool" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "blake2-rfc", "chrono", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "epic_keychain 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_core", + "epic_keychain", "epic_store", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_util", "failure", "failure_derive", "log", @@ -939,14 +884,14 @@ dependencies = [ [[package]] name = "epic_store" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "croaring", "env_logger", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_core", + "epic_util", "failure", "failure_derive", "libc", @@ -960,33 +905,12 @@ dependencies = [ [[package]] name = "epic_util" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?tag=v3.3.2#e22cee1a2132f43e517dd8aed870744d7445f287" -dependencies = [ - "backtrace", - "base64 0.9.3", - "byteorder 1.4.3", - "grin_secp256k1zkp", - "lazy_static", - "log", - "log4rs", - "parking_lot 0.6.4", - "rand 0.6.5", - "serde", - "serde_derive", - "walkdir", - "zeroize", - "zip", -] - -[[package]] -name = "epic_util" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic?branch=master#e22cee1a2132f43e517dd8aed870744d7445f287" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic?branch=master#6d45da07bd227f4c3e0eb131de3022a8c19055d9" dependencies = [ "backtrace", "base64 0.9.3", - "byteorder 1.4.3", + "byteorder 1.5.0", "grin_secp256k1zkp", "lazy_static", "log", @@ -1002,8 +926,8 @@ dependencies = [ [[package]] name = "epic_wallet_config" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic-wallet?branch=master#a323ae6c9bbe19ae173f7d080fd3915c88e6b821" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic-wallet?branch=master#4318af0057afe96268af68604d4675fead5466b0" dependencies = [ "dirs", "epic_wallet_util", @@ -1015,43 +939,49 @@ dependencies = [ [[package]] name = "epic_wallet_libwallet" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic-wallet?branch=master#a323ae6c9bbe19ae173f7d080fd3915c88e6b821" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic-wallet?branch=master#4318af0057afe96268af68604d4675fead5466b0" dependencies = [ + "aead", "blake2-rfc", - "byteorder 1.4.3", + "byteorder 1.5.0", + "chacha20poly1305", "chrono", "data-encoding", + "digest 0.9.0", "ed25519-dalek", "epic_wallet_config", "epic_wallet_util", - "failure", - "failure_derive", "lazy_static", "log", "rand 0.5.6", + "regex", + "ring 0.16.20", "serde", "serde_derive", "serde_json", + "sha2 0.9.9", "sha3", "sqlite", "strum", "strum_macros", + "thiserror", + "tungstenite", "uuid 0.7.4", ] [[package]] name = "epic_wallet_util" -version = "3.3.2" -source = "git+https://github.com/EpicCash/epic-wallet?branch=master#a323ae6c9bbe19ae173f7d080fd3915c88e6b821" +version = "3.5.0" +source = "git+https://github.com/EpicCash/epic-wallet?branch=master#4318af0057afe96268af68604d4675fead5466b0" dependencies = [ "dirs", "epic_api", "epic_chain", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", - "epic_keychain 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_core", + "epic_keychain", "epic_store", - "epic_util 3.3.2 (git+https://github.com/EpicCash/epic?tag=v3.3.2)", + "epic_util", "rand 0.5.6", "serde", "serde_derive", @@ -1070,7 +1000,7 @@ name = "epicboxlib" version = "1.0.1" dependencies = [ "colored", - "epic_core 3.3.2 (git+https://github.com/EpicCash/epic?branch=master)", + "epic_core", "epic_wallet_libwallet", "failure", "grin_secp256k1zkp", @@ -1078,38 +1008,34 @@ dependencies = [ "parking_lot 0.6.4", "rand 0.5.6", "regex", - "ring", + "ring 0.16.20", "serde", "serde_derive", "serde_json", "sha2 0.7.1", + "thiserror", "ws", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" -version = "0.2.8" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", "libc", - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "failure" -version = "0.1.8" +name = "failure" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" dependencies = [ @@ -1123,8 +1049,8 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.76", + "quote 1.0.35", "syn 1.0.109", "synstructure", ] @@ -1137,23 +1063,20 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.16", - "windows-sys 0.45.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -1162,7 +1085,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "rand 0.5.6", "rustc-hex", "static_assertions", @@ -1170,9 +1093,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1184,13 +1107,28 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "percent-encoding 2.2.0", + "percent-encoding", ] [[package]] @@ -1222,13 +1160,92 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] -name = "futures-cpupool" -version = "0.1.8" +name = "futures" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ - "futures", - "num_cpus", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr 2.7.1", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] @@ -1257,9 +1274,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1276,11 +1293,22 @@ dependencies = [ "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + [[package]] name = "gimli" -version = "0.27.2" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -1290,9 +1318,9 @@ checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" [[package]] name = "grin_secp256k1zkp" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af3c4c4829b3e2e7ee1d9a542833e4244912fbb887fabe44682558159b068a7" +checksum = "b04798e32404c0af082b6a209ad4df1ab1d9ec3a5a5056f284cfa32f74e59ce6" dependencies = [ "arrayvec 0.3.25", "cc", @@ -1306,20 +1334,21 @@ dependencies = [ [[package]] name = "h2" -version = "0.1.26" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" dependencies = [ - "byteorder 1.4.3", - "bytes", + "bytes 1.5.0", "fnv", - "futures", - "http", - "indexmap", - "log", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.11", + "indexmap 2.1.0", "slab", - "string", - "tokio-io", + "tokio", + "tokio-util", + "tracing", ] [[package]] @@ -1334,6 +1363,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.3.3" @@ -1354,12 +1389,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hmac" @@ -1373,25 +1405,35 @@ dependencies = [ [[package]] name = "http" -version = "0.1.21" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes 1.5.0", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ - "bytes", + "bytes 1.5.0", "fnv", - "itoa 0.4.8", + "itoa", ] [[package]] name = "http-body" -version = "0.1.0" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes", - "futures", - "http", - "tokio-buf", + "bytes 1.5.0", + "http 0.2.11", + "pin-project-lite", ] [[package]] @@ -1400,6 +1442,12 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + [[package]] name = "humantime" version = "1.3.0" @@ -1411,108 +1459,97 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.36" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ - "bytes", - "futures", - "futures-cpupool", + "bytes 1.5.0", + "futures-channel", + "futures-core", + "futures-util", "h2", - "http", + "http 0.2.11", "http-body", "httparse", - "iovec", - "itoa 0.4.8", - "log", - "net2", - "rustc_version", - "time", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", "tokio", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", + "tower-service", + "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.14.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2aa6b1681795bf4da8063f718cd23145aa0c9a5143d9787b345aa60d38ee4" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ - "ct-logs", - "futures", - "http", + "futures-util", + "http 0.2.11", "hyper", + "log", "rustls", - "tokio-core", - "tokio-io", + "rustls-native-certs", + "tokio", "tokio-rustls", - "tokio-tcp", - "webpki", - "webpki-roots", ] [[package]] name = "hyper-timeout" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ec7c8e526ed674ce148323e1f2010f76f546fcdca99a2c721e04bc7bf5b6f7" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "futures", "hyper", + "pin-project-lite", "tokio", - "tokio-io", "tokio-io-timeout", - "tokio-reactor", - "tokio-service", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes 1.5.0", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", ] [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "windows-core", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - -[[package]] -name = "idna" -version = "0.1.5" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "cc", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1529,31 +1566,31 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg 1.1.0", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] -name = "instant" -version = "0.1.12" +name = "indexmap" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "cfg-if 1.0.0", + "equivalent", + "hashbrown 0.14.3", ] [[package]] -name = "io-lifetimes" -version = "1.0.5" +name = "inout" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "libc", - "windows-sys 0.45.0", + "generic-array 0.14.7", ] [[package]] @@ -1566,22 +1603,27 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "0.4.8" +name = "is-terminal" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +dependencies = [ + "hermit-abi 0.3.3", + "rustix", + "windows-sys 0.52.0", +] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -1592,7 +1634,7 @@ version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc15eef5f8b6bef5ac5f7440a957ff95d036e2f98706947741bfc93d1976db4c" dependencies = [ - "futures", + "futures 0.1.31", "log", "serde", "serde_derive", @@ -1601,9 +1643,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -1642,9 +1684,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "liblmdb-sys" @@ -1666,15 +1708,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1683,9 +1716,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lmdb-zero" @@ -1715,25 +1748,25 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" dependencies = [ - "scopeguard 1.1.0", + "scopeguard 1.2.0", ] [[package]] name = "lock_api" -version = "0.3.4" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ - "scopeguard 1.1.0", + "autocfg 1.1.0", + "scopeguard 1.2.0", ] [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ - "cfg-if 1.0.0", "serde", ] @@ -1777,12 +1810,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "maybe-uninit" version = "2.0.0" @@ -1806,9 +1833,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap" @@ -1820,20 +1847,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg 1.1.0", -] - [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -1857,6 +1875,17 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "mio-extras" version = "2.0.6" @@ -1865,21 +1894,10 @@ checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", "log", - "mio", + "mio 0.6.23", "slab", ] -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio", -] - [[package]] name = "miow" version = "0.2.2" @@ -1892,11 +1910,29 @@ dependencies = [ "ws2_32-sys", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "net2" -version = "0.2.38" +version = "0.2.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" dependencies = [ "cfg-if 0.1.10", "libc", @@ -1929,7 +1965,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.1.42", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -1943,7 +1979,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.2.4", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -1953,7 +1989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" dependencies = [ "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.17", "rand 0.4.6", "rustc-serialize", ] @@ -1966,7 +2002,7 @@ checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ "autocfg 1.1.0", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -1975,7 +2011,7 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.17", "rustc-serialize", ] @@ -1986,7 +2022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ "autocfg 1.1.0", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -1996,7 +2032,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg 1.1.0", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -2007,7 +2043,7 @@ checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ "autocfg 1.1.0", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -2018,7 +2054,7 @@ checksum = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" dependencies = [ "num-bigint 0.1.44", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.17", "rustc-serialize", ] @@ -2031,7 +2067,7 @@ dependencies = [ "autocfg 1.1.0", "num-bigint 0.2.6", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -2040,35 +2076,35 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg 1.1.0", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.3", "libc", ] [[package]] name = "object" -version = "0.30.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "memchr 2.5.0", + "memchr 2.7.1", ] [[package]] @@ -2079,9 +2115,9 @@ checksum = "4eae0151b9dacf24fcc170d9995e511669a082856a91f958a2fe380bfab3fb22" [[package]] name = "once_cell" -version = "1.17.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -2095,13 +2131,57 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl" +version = "0.10.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +dependencies = [ + "bitflags 2.4.1", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "ordered-float" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.17", ] [[package]] @@ -2146,13 +2226,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.9.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.6.3", - "rustc_version", + "lock_api 0.4.11", + "parking_lot_core 0.9.9", ] [[package]] @@ -2164,7 +2243,7 @@ dependencies = [ "libc", "rand 0.5.6", "rustc_version", - "smallvec", + "smallvec 0.6.14", "winapi 0.3.9", ] @@ -2180,23 +2259,21 @@ dependencies = [ "rand 0.6.5", "redox_syscall 0.1.57", "rustc_version", - "smallvec", + "smallvec 0.6.14", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.6.3" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if 0.1.10", - "cloudabi", + "cfg-if 1.0.0", "libc", - "redox_syscall 0.1.57", - "rustc_version", - "smallvec", - "winapi 0.3.9", + "redox_syscall 0.4.1", + "smallvec 1.11.2", + "windows-targets 0.48.5", ] [[package]] @@ -2231,21 +2308,38 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "1.0.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "percent-encoding" -version = "2.2.0" +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" + +[[package]] +name = "poly1305" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash", +] [[package]] name = "ppv-lite86" @@ -2297,7 +2391,7 @@ dependencies = [ "hamming", "primal-bit", "primal-estimate", - "smallvec", + "smallvec 0.6.14", ] [[package]] @@ -2331,9 +2425,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -2394,11 +2488,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "proc-macro2 1.0.51", + "proc-macro2 1.0.76", ] [[package]] @@ -2452,13 +2546,24 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.1.1" @@ -2480,12 +2585,22 @@ dependencies = [ ] [[package]] -name = "rand_core" +name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "rand_core 0.4.2", + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", ] [[package]] @@ -2500,7 +2615,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", ] [[package]] @@ -2508,6 +2623,9 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", +] [[package]] name = "rand_hc" @@ -2610,9 +2728,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] @@ -2623,38 +2741,67 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", + "getrandom 0.1.16", "redox_syscall 0.1.57", "rust-argon2", ] [[package]] name = "regex" -version = "1.7.1" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr 2.7.1", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", - "memchr 2.5.0", + "memchr 2.7.1", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" -version = "0.13.5" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", - "lazy_static", "libc", - "untrusted", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi 0.3.9", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom 0.2.12", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", ] [[package]] @@ -2677,14 +2824,14 @@ dependencies = [ "base64 0.13.1", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.8.15", + "crossbeam-utils", ] [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hex" @@ -2694,9 +2841,9 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc-serialize" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401" [[package]] name = "rustc_version" @@ -2709,37 +2856,65 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.13.1" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b71057b31981152970d57399c25f72e27a6ee0d207a669d8304cabf44705b" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ - "base64 0.9.3", "log", - "ring", + "ring 0.17.7", + "rustls-webpki", "sct", - "untrusted", - "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.6", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safemem" @@ -2757,10 +2932,13 @@ dependencies = [ ] [[package]] -name = "scoped-tls" -version = "0.1.2" +name = "schannel" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] [[package]] name = "scopeguard" @@ -2770,24 +2948,41 @@ checksum = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "scratch" -version = "1.0.4" +name = "sct" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5e082f6ea090deaf0e6dd04b68360fd5cddb152af6ce8927c9d25db299f98c" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] [[package]] -name = "sct" -version = "0.4.0" +name = "security-framework" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8f61f9e6eadd062a71c380043d28036304a4706b3c4dd001ff3387ed00745a" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "ring", - "untrusted", + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] @@ -2807,9 +3002,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -2826,22 +3021,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ - "itoa 1.0.6", + "itoa", "ryu", "serde", ] @@ -2852,7 +3047,7 @@ version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "indexmap", + "indexmap 1.9.3", "ryu", "serde", "yaml-rust", @@ -2870,6 +3065,17 @@ dependencies = [ "opaque-debug 0.2.3", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.7.1" @@ -2920,6 +3126,15 @@ dependencies = [ "opaque-debug 0.2.3", ] +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "siphasher" version = "0.2.3" @@ -2928,9 +3143,9 @@ checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg 1.1.0", ] @@ -2944,11 +3159,39 @@ dependencies = [ "maybe-uninit", ] +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "sqlite" -version = "0.30.4" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1908664131c21a38e5b531344d52a196ec338af5bf44f7fa2c83d539e9561d" +checksum = "05439db7afa0ce0b38f6d1b4c691f368adde108df021e15e900fec6a1af92488" dependencies = [ "libc", "sqlite3-sys", @@ -2956,9 +3199,9 @@ dependencies = [ [[package]] name = "sqlite3-src" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1815a7a02c996eb8e5c64f61fcb6fd9b12e593ce265c512c5853b2513635691" +checksum = "bfc95a51a1ee38839599371685b9d4a926abb51791f0bc3bf8c3bb7867e6e454" dependencies = [ "cc", "pkg-config", @@ -2966,9 +3209,9 @@ dependencies = [ [[package]] name = "sqlite3-sys" -version = "0.14.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d47c99824fc55360ba00caf28de0b8a0458369b832e016a64c13af0ad9fbb9ee" +checksum = "f2752c669433e40ebb08fde824146f50d9628aa0b66a3b7fc6be34db82a8063b" dependencies = [ "libc", "sqlite3-src", @@ -2986,15 +3229,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes", -] - [[package]] name = "strsim" version = "0.8.0" @@ -3048,8 +3282,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.76", + "quote 1.0.35", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2 1.0.76", + "quote 1.0.35", "unicode-ident", ] @@ -3059,30 +3304,30 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.76", + "quote 1.0.35", "syn 1.0.109", "unicode-xid 0.2.4", ] [[package]] name = "tempfile" -version = "3.4.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall 0.2.16", + "redox_syscall 0.4.1", "rustix", - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -3098,22 +3343,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3127,17 +3372,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", -] - [[package]] name = "tiny-keccak" version = "1.5.0" @@ -3164,269 +3398,144 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "0.1.22" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ - "bytes", - "futures", - "mio", + "backtrace", + "bytes 1.5.0", + "libc", + "mio 0.8.10", "num_cpus", - "tokio-codec", - "tokio-current-thread", - "tokio-executor", - "tokio-fs", - "tokio-io", - "tokio-reactor", - "tokio-sync", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "tokio-udp", - "tokio-uds", -] - -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes", - "either", - "futures", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", ] [[package]] -name = "tokio-codec" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" -dependencies = [ - "bytes", - "futures", - "tokio-io", -] - -[[package]] -name = "tokio-core" -version = "0.1.18" +name = "tokio-io-timeout" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b1395334443abca552f63d4f61d0486f12377c2ba8b368e523f89e828cffd4" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "bytes", - "futures", - "iovec", - "log", - "mio", - "scoped-tls", + "pin-project-lite", "tokio", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-timer", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures", -] - -[[package]] -name = "tokio-fs" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" -dependencies = [ - "futures", - "tokio-io", - "tokio-threadpool", ] [[package]] -name = "tokio-io" -version = "0.1.13" +name = "tokio-macros" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "bytes", - "futures", - "log", + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] -name = "tokio-io-timeout" +name = "tokio-native-tls" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ce81f15cfd7982fac684f9057a1299eebeb79e98a8a709969b9aa51123129" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "bytes", - "futures", - "tokio-io", - "tokio-timer", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures", - "lazy_static", - "log", - "mio", - "num_cpus", - "parking_lot 0.9.0", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", + "native-tls", + "tokio", ] [[package]] name = "tokio-rustls" -version = "0.7.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d62fa3e015426e3c64039d9d20adf054a3c9b4d9445560f1c41c75bef3eab" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] -name = "tokio-service" -version = "0.1.0" +name = "tokio-util" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ - "futures", + "bytes 1.5.0", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", ] [[package]] -name = "tokio-sync" -version = "0.1.8" +name = "toml" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" dependencies = [ - "fnv", - "futures", + "serde", ] [[package]] -name = "tokio-tcp" -version = "0.1.4" +name = "tower-service" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes", - "futures", - "iovec", - "mio", - "tokio-io", - "tokio-reactor", -] +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] -name = "tokio-threadpool" -version = "0.1.18" +name = "tracing" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures", - "lazy_static", - "log", - "num_cpus", - "slab", - "tokio-executor", + "pin-project-lite", + "tracing-core", ] [[package]] -name = "tokio-timer" -version = "0.2.13" +name = "tracing-core" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ - "crossbeam-utils 0.7.2", - "futures", - "slab", - "tokio-executor", + "once_cell", ] [[package]] -name = "tokio-udp" -version = "0.1.6" +name = "traitobject" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" -dependencies = [ - "bytes", - "futures", - "log", - "mio", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] +checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" [[package]] -name = "tokio-uds" -version = "0.2.7" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" -dependencies = [ - "bytes", - "futures", - "iovec", - "libc", - "log", - "mio", - "mio-uds", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "toml" -version = "0.4.10" +name = "tungstenite" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" dependencies = [ - "serde", + "byteorder 1.5.0", + "bytes 1.5.0", + "data-encoding", + "http 1.0.0", + "httparse", + "log", + "native-tls", + "rand 0.8.5", + "sha1", + "thiserror", + "url", + "utf-8", ] -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - [[package]] name = "typemap" version = "0.3.3" @@ -3438,9 +3547,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" @@ -3448,22 +3557,22 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2143cded94692b156c356508d92888acc824db5bffc0b4089732264c6fcf86d4" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "crunchy 0.2.2", "rustc-hex", ] [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" -version = "1.0.7" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775c11906edafc97bc378816b94585fbd9a054eabaf86fdd0ced94af449efab7" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -3482,9 +3591,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -3498,6 +3607,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsafe-any" version = "0.4.2" @@ -3509,32 +3628,33 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] -name = "url" -version = "1.7.2" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.3.0", - "percent-encoding 2.2.0", + "idna", + "percent-encoding", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "uuid" version = "0.6.5" @@ -3556,6 +3676,12 @@ dependencies = [ "serde", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "vec_map" version = "0.8.2" @@ -3570,23 +3696,20 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi 0.3.9", "winapi-util", ] [[package]] name = "want" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "futures", - "log", "try-lock", ] @@ -3598,15 +3721,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3614,66 +3737,56 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ - "quote 1.0.23", + "quote 1.0.35", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] -name = "webpki" -version = "0.18.1" +name = "web-sys" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d7967316d8411ca3b01821ee6c332bde138ba4363becdb492f12e514daa17f" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85d1f408918fd590908a70d36b7ac388db2edc221470333e4d6e5b598e44cabf" -dependencies = [ - "untrusted", - "webpki", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -3715,9 +3828,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi 0.3.9", ] @@ -3728,86 +3841,146 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows-targets", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "ws" @@ -3815,16 +3988,16 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" dependencies = [ - "byteorder 1.4.3", - "bytes", + "byteorder 1.5.0", + "bytes 0.4.12", "httparse", "log", - "mio", + "mio 0.6.23", "mio-extras", "rand 0.7.3", "sha-1", "slab", - "url 2.3.1", + "url", ] [[package]] @@ -3848,23 +4021,22 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.7" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", - "synstructure", + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3873,7 +4045,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", "crc32fast", "thiserror", ] diff --git a/epicboxlib/epicboxlib/Cargo.toml b/epicboxlib/epicboxlib/Cargo.toml index b6609a3..0c9c1be 100644 --- a/epicboxlib/epicboxlib/Cargo.toml +++ b/epicboxlib/epicboxlib/Cargo.toml @@ -6,16 +6,17 @@ description = "A library that encapsulates epicbox integration." keywords = [ "epicbox", "vault713", "epic", "mimblewimble", "rust", "crypto", "cryptocurrency", "wallet713" ] license = "Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" [dependencies] +thiserror = "1" colored = "1.7" failure = "0.1" log = "0.4" parking_lot = {version = "0.6"} rand = "0.5" regex = "1" -ring = "0.13" +ring = "0.16.20" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/epicboxlib/epicboxlib/src/client/epicbox_publisher.rs b/epicboxlib/epicboxlib/src/client/epicbox_publisher.rs index 96889e2..0dc0cb8 100644 --- a/epicboxlib/epicboxlib/src/client/epicbox_publisher.rs +++ b/epicboxlib/epicboxlib/src/client/epicbox_publisher.rs @@ -1,6 +1,6 @@ -use crate::error::Result; +use crate::error::ResultSingle; use crate::types::{EpicboxAddress, Slate}; pub trait EpicboxPublisher { - fn post_slate(&self, slate: &Slate, to: &EpicboxAddress) -> Result<()>; + fn post_slate(&self, slate: &Slate, to: &EpicboxAddress) -> ResultSingle<()>; } diff --git a/epicboxlib/epicboxlib/src/client/epicbox_subscriber.rs b/epicboxlib/epicboxlib/src/client/epicbox_subscriber.rs index 731f415..3146ac4 100644 --- a/epicboxlib/epicboxlib/src/client/epicbox_subscriber.rs +++ b/epicboxlib/epicboxlib/src/client/epicbox_subscriber.rs @@ -1,8 +1,8 @@ -use crate::error::Result; +use crate::error::ResultSingle; use crate::client::EpicboxSubscriptionHandler; pub trait EpicboxSubscriber { - fn subscribe(&mut self, handler: Box) -> Result<()>; + fn subscribe(&mut self, handler: Box) -> ResultSingle<()>; fn unsubscribe(&self); fn is_running(&self) -> bool; } diff --git a/epicboxlib/epicboxlib/src/error.rs b/epicboxlib/epicboxlib/src/error.rs new file mode 100644 index 0000000..1f6babb --- /dev/null +++ b/epicboxlib/epicboxlib/src/error.rs @@ -0,0 +1,42 @@ +use crate::types::EpicboxError; + +pub type ResultSingle = std::result::Result; + +#[derive(Clone, thiserror::Error, PartialEq, Debug)] +pub enum Error { + #[error("Generic Error: {}", 0)] + GenericError(String), + #[error("Secp error")] + SecpError(secp256k1zkp::Error), + #[error("Base58 Error: invalid character!")] + InvalidBase58Character(char, usize), + #[error("Base58 Error: invalid length!")] + InvalidBase58Length, + #[error("Base58 Error: invalid checksum!")] + InvalidBase58Checksum, + #[error("Base58 Error: invalid network!")] + InvalidBase58Version, + #[error("Base58 Error: invalid key!")] + InvalidBase58Key, + #[error("Could not parse number from string!")] + NumberParsingError, + #[error("Could not parse `{}` to a epicbox address!", 0)] + EpicboxAddressParsingError(String), + #[error("Encryption Error: unable to encrypt message")] + Encryption, + #[error("Decryption Error: unable to decrypt message")] + Decryption, + #[error("VerifyProof Error: unable to verify proof")] + VerifyProof, + #[error("Websocket Error: epicbox websocket terminated unexpectedly!")] + EpicboxWebsocketAbnormalTermination, + #[error("Protocol Error: epicbox protocol error `{}`", 0)] + EpicboxProtocolError(EpicboxError), +} + +impl From for Error { + fn from(error: secp256k1zkp::Error) -> Error { + Error::SecpError(error) + } +} + diff --git a/epicboxlib/epicboxlib/src/error/error_kind.rs b/epicboxlib/epicboxlib/src/error/error_kind.rs deleted file mode 100644 index 41786e4..0000000 --- a/epicboxlib/epicboxlib/src/error/error_kind.rs +++ /dev/null @@ -1,34 +0,0 @@ -use failure::Fail; -use crate::types::EpicboxError; - -#[derive(Clone, Eq, PartialEq, Debug, Fail)] -pub enum ErrorKind { - #[fail(display = "\x1b[31;1merror:\x1b[0m {}", 0)] - GenericError(String), - #[fail(display = "\x1b[31;1merror:\x1b[0m secp error")] - SecpError, - #[fail(display = "\x1b[31;1merror:\x1b[0m invalid character!")] - InvalidBase58Character(char, usize), - #[fail(display = "\x1b[31;1merror:\x1b[0m invalid length!")] - InvalidBase58Length, - #[fail(display = "\x1b[31;1merror:\x1b[0m invalid checksum!")] - InvalidBase58Checksum, - #[fail(display = "\x1b[31;1merror:\x1b[0m invalid network!")] - InvalidBase58Version, - #[fail(display = "\x1b[31;1merror:\x1b[0m invalid key!")] - InvalidBase58Key, - #[fail(display = "\x1b[31;1merror:\x1b[0m could not parse number from string!")] - NumberParsingError, - #[fail(display = "\x1b[31;1merror:\x1b[0m could not parse `{}` to a epicbox address!", 0)] - EpicboxAddressParsingError(String), - #[fail(display = "\x1b[31;1merror:\x1b[0m unable to encrypt message")] - Encryption, - #[fail(display = "\x1b[31;1merror:\x1b[0m unable to decrypt message")] - Decryption, - #[fail(display = "\x1b[31;1merror:\x1b[0m unable to verify proof")] - VerifyProof, - #[fail(display = "\x1b[31;1merror:\x1b[0m epicbox websocket terminated unexpectedly!")] - EpicboxWebsocketAbnormalTermination, - #[fail(display = "\x1b[31;1merror:\x1b[0m epicbox protocol error `{}`", 0)] - EpicboxProtocolError(EpicboxError), -} diff --git a/epicboxlib/epicboxlib/src/error/mod.rs b/epicboxlib/epicboxlib/src/error/mod.rs deleted file mode 100644 index f224f83..0000000 --- a/epicboxlib/epicboxlib/src/error/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod error_kind; -mod result; - -pub use error_kind::ErrorKind; -pub use result::Result; -pub use failure::Error; \ No newline at end of file diff --git a/epicboxlib/epicboxlib/src/error/result.rs b/epicboxlib/epicboxlib/src/error/result.rs deleted file mode 100644 index 805da7a..0000000 --- a/epicboxlib/epicboxlib/src/error/result.rs +++ /dev/null @@ -1,3 +0,0 @@ -use failure::Error; - -pub type Result = std::result::Result; \ No newline at end of file diff --git a/epicboxlib/epicboxlib/src/lib.rs b/epicboxlib/epicboxlib/src/lib.rs index 69eccf5..7a6a50c 100644 --- a/epicboxlib/epicboxlib/src/lib.rs +++ b/epicboxlib/epicboxlib/src/lib.rs @@ -1,6 +1,5 @@ extern crate colored; extern crate failure; -#[macro_use] extern crate log; extern crate parking_lot; extern crate regex; diff --git a/epicboxlib/epicboxlib/src/types/epicbox_address.rs b/epicboxlib/epicboxlib/src/types/epicbox_address.rs index fba5ae6..065342f 100644 --- a/epicboxlib/epicboxlib/src/types/epicbox_address.rs +++ b/epicboxlib/epicboxlib/src/types/epicbox_address.rs @@ -1,7 +1,7 @@ use regex::Regex; use std::fmt::{self, Display}; -use crate::error::{ErrorKind, Result}; +use crate::error::{Error, ResultSingle}; use crate::utils::crypto::Base58; use crate::utils::is_mainnet; use crate::utils::secp::PublicKey; @@ -20,7 +20,7 @@ pub fn version_bytes() -> Vec { } } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq)] pub struct EpicboxAddress { pub public_key: String, pub domain: String, @@ -52,11 +52,11 @@ impl EpicboxAddress { } } - pub fn from_str(s: &str) -> Result { + pub fn from_str(s: &str) -> ResultSingle { let re = Regex::new(EPICBOX_ADDRESS_REGEX).unwrap(); let captures = re.captures(s); if captures.is_none() { - Err(ErrorKind::EpicboxAddressParsingError(s.to_string()))?; + Err(Error::EpicboxAddressParsingError(s.to_string()))?; } let captures = captures.unwrap(); @@ -71,11 +71,11 @@ impl EpicboxAddress { Ok(EpicboxAddress::new(public_key, domain, port)) } - pub fn from_str_raw(s: &str) -> Result { + pub fn from_str_raw(s: &str) -> ResultSingle { let re = Regex::new(EPICBOX_ADDRESS_REGEX).unwrap(); let captures = re.captures(s); if captures.is_none() { - Err(ErrorKind::EpicboxAddressParsingError(s.to_string()))?; + Err(Error::EpicboxAddressParsingError(s.to_string()))?; } let captures = captures.unwrap(); @@ -95,7 +95,7 @@ impl EpicboxAddress { )) } - pub fn public_key(&self) -> Result { + pub fn public_key(&self) -> ResultSingle { PublicKey::from_base58_check(&self.public_key, version_bytes()) } diff --git a/epicboxlib/epicboxlib/src/types/epicbox_message.rs b/epicboxlib/epicboxlib/src/types/epicbox_message.rs index abd0d6d..46d46a7 100644 --- a/epicboxlib/epicboxlib/src/types/epicbox_message.rs +++ b/epicboxlib/epicboxlib/src/types/epicbox_message.rs @@ -1,7 +1,8 @@ use rand::{Rng, thread_rng}; -use ring::{aead, digest, pbkdf2}; +use ring::{aead, pbkdf2}; +use std::num::NonZeroU32; -use crate::error::{ErrorKind, Result}; +use crate::error::{Error, ResultSingle}; use crate::utils::{from_hex, to_hex}; use crate::utils::secp::{Secp256k1, PublicKey, SecretKey}; use crate::types::EpicboxAddress; @@ -21,65 +22,98 @@ impl EpicboxMessage { destination: &EpicboxAddress, receiver_public_key: &PublicKey, secret_key: &SecretKey, - ) -> Result { - let secp = Secp256k1::new(); - let mut common_secret = receiver_public_key.clone(); - common_secret - .mul_assign(&secp, secret_key) - .map_err(|_| ErrorKind::Encryption)?; - let common_secret_ser = common_secret.serialize_vec(&secp, true); - let common_secret_slice = &common_secret_ser[1..33]; - - let salt: [u8; 8] = thread_rng().gen(); - let nonce: [u8; 12] = thread_rng().gen(); - let mut key = [0; 32]; - pbkdf2::derive(&digest::SHA512, 100, &salt, common_secret_slice, &mut key); - let mut enc_bytes = message.as_bytes().to_vec(); - let suffix_len = aead::CHACHA20_POLY1305.tag_len(); - for _ in 0..suffix_len { - enc_bytes.push(0); - } - let sealing_key = aead::SealingKey::new(&aead::CHACHA20_POLY1305, &key) - .map_err(|_| ErrorKind::Encryption)?; - aead::seal_in_place(&sealing_key, &nonce, &[], &mut enc_bytes, suffix_len) - .map_err(|_| ErrorKind::Encryption)?; - - Ok(EpicboxMessage { - destination: Some(destination.clone()), - encrypted_message: to_hex(enc_bytes), - salt: to_hex(salt.to_vec()), - nonce: to_hex(nonce.to_vec()), - }) + ) -> ResultSingle { + let secp = Secp256k1::new(); + let mut common_secret = receiver_public_key.clone(); + common_secret + .mul_assign(&secp, secret_key) + .map_err(|_| Error::Encryption)?; + let common_secret_ser = common_secret.serialize_vec(&secp, true); + let common_secret_slice = &common_secret_ser[1..33]; + + let salt: [u8; 8] = thread_rng().gen(); + let nonce: [u8; 12] = thread_rng().gen(); + let mut key = [0; 32]; + + pbkdf2::derive( + ring::pbkdf2::PBKDF2_HMAC_SHA512, + NonZeroU32::new(100).unwrap(), + &salt, + common_secret_slice, + &mut key, + ); + + let mut enc_bytes = message.as_bytes().to_vec(); + + let unbound_key = aead::UnboundKey::new(&aead::CHACHA20_POLY1305, &key).unwrap(); + let sealing_key: aead::LessSafeKey = aead::LessSafeKey::new(unbound_key); + let aad = aead::Aad::from(&[]); + let res = sealing_key.seal_in_place_append_tag( + aead::Nonce::assume_unique_for_key(nonce), + aad, + &mut enc_bytes, + ); + if let Err(_) = res { + return Err(Error::Encryption)?; + } + Ok(EpicboxMessage { + destination: Some(destination.clone()), + encrypted_message: to_hex(enc_bytes), + salt: to_hex(salt.to_vec()), + nonce: to_hex(nonce.to_vec()), + }) } - pub fn key(&self, sender_public_key: &PublicKey, secret_key: &SecretKey) -> Result<[u8; 32]> { - let salt = from_hex(self.salt.clone()).map_err(|_| ErrorKind::Decryption)?; + pub fn key(&self, sender_public_key: &PublicKey, secret_key: &SecretKey) -> ResultSingle<[u8; 32]> { + let salt = from_hex(self.salt.clone()).map_err(|_| Error::Decryption)?; - let secp = Secp256k1::new(); - let mut common_secret = sender_public_key.clone(); - common_secret - .mul_assign(&secp, secret_key) - .map_err(|_| ErrorKind::Decryption)?; - let common_secret_ser = common_secret.serialize_vec(&secp, true); - let common_secret_slice = &common_secret_ser[1..33]; + let secp = Secp256k1::new(); + let mut common_secret = sender_public_key.clone(); + common_secret + .mul_assign(&secp, secret_key) + .map_err(|_| Error::Decryption)?; + let common_secret_ser = common_secret.serialize_vec(&secp, true); + let common_secret_slice = &common_secret_ser[1..33]; - let mut key = [0; 32]; - pbkdf2::derive(&digest::SHA512, 100, &salt, common_secret_slice, &mut key); + let mut key = [0; 32]; - Ok(key) + let len = std::num::NonZeroU32::new(100).unwrap(); + + pbkdf2::derive( + pbkdf2::PBKDF2_HMAC_SHA512, + len, + &salt, + common_secret_slice, + &mut key, + ); + + Ok(key) } - pub fn decrypt_with_key(&self, key: &[u8; 32]) -> Result { - let mut encrypted_message = - from_hex(self.encrypted_message.clone()).map_err(|_| ErrorKind::Decryption)?; - let nonce = from_hex(self.nonce.clone()).map_err(|_| ErrorKind::Decryption)?; + pub fn decrypt_with_key(&self, key: &[u8; 32]) -> ResultSingle { + let mut encrypted_message = + from_hex(self.encrypted_message.clone()).map_err(|_| Error::Decryption)?; + let nonce = from_hex(self.nonce.clone()).map_err(|_| Error::Decryption)?; + + let mut n = [0u8; 12]; + n.copy_from_slice(&nonce[0..12]); + + let unbound_key = aead::UnboundKey::new(&aead::CHACHA20_POLY1305, key).unwrap(); + let opening_key: aead::LessSafeKey = aead::LessSafeKey::new(unbound_key); + let aad = aead::Aad::from(&[]); + let res = opening_key.open_in_place( + aead::Nonce::assume_unique_for_key(n), + aad, + &mut encrypted_message, + ); - let opening_key = aead::OpeningKey::new(&aead::CHACHA20_POLY1305, key) - .map_err(|_| ErrorKind::Decryption)?; - let decrypted_data = - aead::open_in_place(&opening_key, &nonce, &[], 0, &mut encrypted_message) - .map_err(|_| ErrorKind::Decryption)?; + if let Err(_) = res { + return Err(Error::Encryption)?; + } + for _ in 0..aead::AES_256_GCM.tag_len() { + encrypted_message.pop(); + } - String::from_utf8(decrypted_data.to_vec()).map_err(|_| ErrorKind::Decryption.into()) + String::from_utf8(encrypted_message.to_vec()).map_err(|_| Error::Decryption.into()) } } diff --git a/epicboxlib/epicboxlib/src/utils/base58.rs b/epicboxlib/epicboxlib/src/utils/base58.rs index 1598a0d..161891e 100644 --- a/epicboxlib/epicboxlib/src/utils/base58.rs +++ b/epicboxlib/epicboxlib/src/utils/base58.rs @@ -1,4 +1,4 @@ -use crate::error::{ErrorKind, Result}; +use crate::error::{Error, ResultSingle}; use sha2::{Digest, Sha256}; const ALPHABET: &'static [u8] = b"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; @@ -22,8 +22,8 @@ pub trait ToBase58 { /// A trait for converting base58 encoded values. pub trait FromBase58 { /// Convert a value of `self`, interpreted as base58 encoded data, into an owned vector of bytes, returning a vector. - fn from_base58(&self) -> Result>; - fn from_base58_check(&self, version_bytes: usize) -> Result<(Vec, Vec)>; + fn from_base58(&self) -> ResultSingle>; + fn from_base58_check(&self, version_bytes: usize) -> ResultSingle<(Vec, Vec)>; } impl ToBase58 for [u8] { @@ -71,14 +71,14 @@ impl ToBase58 for [u8] { fn to_base58_check(&self, version: Vec) -> String { let mut payload: Vec = version.iter().chain(self.iter()).map(|x| *x).collect(); - let mut checksum = double_sha256(&payload); + let checksum = double_sha256(&payload); payload.append(&mut checksum[..4].to_vec()); payload.to_base58() } } impl FromBase58 for str { - fn from_base58(&self) -> Result> { + fn from_base58(&self) -> ResultSingle> { let mut bin = [0u8; 132]; let mut out = [0u32; (132 + 3) / 4]; let bytesleft = (bin.len() % 4) as u8; @@ -94,12 +94,12 @@ impl FromBase58 for str { while i < self.len() { if (b58[i] & 0x80) != 0 { // High-bit set on invalid digit - Err(ErrorKind::InvalidBase58Character(b58[i] as char, i))?; + Err(Error::InvalidBase58Character(b58[i] as char, i))?; } if B58_DIGITS_MAP[b58[i] as usize] == -1 { // // Invalid base58 digit - Err(ErrorKind::InvalidBase58Character(b58[i] as char, i))?; + Err(Error::InvalidBase58Character(b58[i] as char, i))?; } let mut c = B58_DIGITS_MAP[b58[i] as usize] as u64; @@ -113,12 +113,12 @@ impl FromBase58 for str { if c != 0 { // Output number too big (carry to the next int32) - Err(ErrorKind::InvalidBase58Length)?; + Err(Error::InvalidBase58Length)?; } if (out[0] & zeromask) != 0 { // Output number too big (last int32 filled too far) - Err(ErrorKind::InvalidBase58Length)?; + Err(Error::InvalidBase58Length)?; } i += 1; @@ -153,16 +153,16 @@ impl FromBase58 for str { Ok(bin[leading_zeros - zcount..].to_vec()) } - fn from_base58_check(&self, version_bytes: usize) -> Result<(Vec, Vec)> { + fn from_base58_check(&self, version_bytes: usize) -> ResultSingle<(Vec, Vec)> { let mut payload: Vec = self.from_base58()?; if payload.len() < 5 { - Err(ErrorKind::InvalidBase58Checksum)?; + Err(Error::InvalidBase58Checksum)?; } let checksum_index = payload.len() - 4; let provided_checksum = payload.split_off(checksum_index); let checksum = double_sha256(&payload)[..4].to_vec(); if checksum != provided_checksum { - Err(ErrorKind::InvalidBase58Checksum)?; + Err(Error::InvalidBase58Checksum)?; } Ok(( payload[..version_bytes].to_vec(), diff --git a/epicboxlib/epicboxlib/src/utils/crypto.rs b/epicboxlib/epicboxlib/src/utils/crypto.rs index 1363fab..d22f90b 100644 --- a/epicboxlib/epicboxlib/src/utils/crypto.rs +++ b/epicboxlib/epicboxlib/src/utils/crypto.rs @@ -1,21 +1,21 @@ use sha2::{Digest, Sha256}; -use crate::error::{ErrorKind, Result}; +use crate::error::{Error, ResultSingle}; use super::base58::{FromBase58, ToBase58}; use super::secp::{Message, Secp256k1, Signature, Commitment, PublicKey, SecretKey}; use super::{from_hex, to_hex}; pub trait Hex { - fn from_hex(str: &str) -> Result; + fn from_hex(str: &str) -> ResultSingle; fn to_hex(&self) -> String; } pub trait Base58 { - fn from_base58(str: &str) -> Result; + fn from_base58(str: &str) -> ResultSingle; fn to_base58(&self) -> String; - fn from_base58_check(str: &str, version_bytes: Vec) -> Result; - fn from_base58_check_raw(str: &str, version_bytes: usize) -> Result<(T, Vec)>; + fn from_base58_check(str: &str, version_bytes: Vec) -> ResultSingle; + fn from_base58_check_raw(str: &str, version_bytes: usize) -> ResultSingle<(T, Vec)>; fn to_base58_check(&self, version: Vec) -> String; } @@ -26,10 +26,10 @@ fn serialize_public_key(public_key: &PublicKey) -> Vec { } impl Hex for PublicKey { - fn from_hex(str: &str) -> Result { + fn from_hex(str: &str) -> ResultSingle { let secp = Secp256k1::new(); let hex = from_hex(str.to_string())?; - PublicKey::from_slice(&secp, &hex).map_err(|_| ErrorKind::InvalidBase58Key.into()) + PublicKey::from_slice(&secp, &hex).map_err(|_| Error::InvalidBase58Key.into()) } fn to_hex(&self) -> String { @@ -38,31 +38,31 @@ impl Hex for PublicKey { } impl Base58 for PublicKey { - fn from_base58(str: &str) -> Result { + fn from_base58(str: &str) -> ResultSingle { let secp = Secp256k1::new(); let str = str::from_base58(str)?; - PublicKey::from_slice(&secp, &str).map_err(|_| ErrorKind::InvalidBase58Key.into()) + PublicKey::from_slice(&secp, &str).map_err(|_| Error::InvalidBase58Key.into()) } fn to_base58(&self) -> String { serialize_public_key(self).to_base58() } - fn from_base58_check_raw(str: &str, version_bytes: usize) -> Result<(PublicKey, Vec)> { + fn from_base58_check_raw(str: &str, version_bytes: usize) -> ResultSingle<(PublicKey, Vec)> { let secp = Secp256k1::new(); let (version_bytes, key_bytes) = str::from_base58_check(str, version_bytes)?; - let public_key = PublicKey::from_slice(&secp, &key_bytes).map_err(|_| ErrorKind::InvalidBase58Key)?; + let public_key = PublicKey::from_slice(&secp, &key_bytes).map_err(|_| Error::InvalidBase58Key)?; Ok((public_key, version_bytes)) } - fn from_base58_check(str: &str, version_expect: Vec) -> Result { + fn from_base58_check(str: &str, version_expect: Vec) -> ResultSingle { let secp = Secp256k1::new(); let n_version = version_expect.len(); let (version_actual, key_bytes) = str::from_base58_check(str, n_version)?; if version_actual != version_expect { - return Err(ErrorKind::InvalidBase58Version.into()); + return Err(Error::InvalidBase58Version.into()); } - PublicKey::from_slice(&secp, &key_bytes).map_err(|_| ErrorKind::InvalidBase58Key.into()) + PublicKey::from_slice(&secp, &key_bytes).map_err(|_| Error::InvalidBase58Key.into()) } fn to_base58_check(&self, version: Vec) -> String { @@ -71,10 +71,10 @@ impl Base58 for PublicKey { } impl Hex for Signature { - fn from_hex(str: &str) -> Result { + fn from_hex(str: &str) -> ResultSingle { let secp = Secp256k1::new(); let hex = from_hex(str.to_string())?; - Signature::from_der(&secp, &hex).map_err(|_| ErrorKind::SecpError.into()) + Signature::from_der(&secp, &hex).map_err(|e| Error::SecpError(e)) } fn to_hex(&self) -> String { @@ -85,10 +85,10 @@ impl Hex for Signature { } impl Hex for SecretKey { - fn from_hex(str: &str) -> Result { + fn from_hex(str: &str) -> ResultSingle { let secp = Secp256k1::new(); let data = from_hex(str.to_string())?; - SecretKey::from_slice(&secp, &data).map_err(|_| ErrorKind::SecpError.into()) + SecretKey::from_slice(&secp, &data).map_err(|e| Error::SecpError(e)) } fn to_hex(&self) -> String { @@ -97,7 +97,7 @@ impl Hex for SecretKey { } impl Hex for Commitment { - fn from_hex(str: &str) -> Result { + fn from_hex(str: &str) -> ResultSingle { let data = from_hex(str.to_string())?; Ok(Commitment::from_vec(data)) } @@ -107,29 +107,29 @@ impl Hex for Commitment { } } -pub fn public_key_from_secret_key(secret_key: &SecretKey) -> Result { +pub fn public_key_from_secret_key(secret_key: &SecretKey) -> ResultSingle { let secp = Secp256k1::new(); - PublicKey::from_secret_key(&secp, secret_key).map_err(|_| ErrorKind::SecpError.into()) + PublicKey::from_secret_key(&secp, secret_key).map_err(|e| Error::SecpError(e)) } -pub fn sign_challenge(challenge: &str, secret_key: &SecretKey) -> Result { +pub fn sign_challenge(challenge: &str, secret_key: &SecretKey) -> ResultSingle { let mut hasher = Sha256::new(); hasher.input(challenge.as_bytes()); let message = Message::from_slice(hasher.result().as_slice())?; let secp = Secp256k1::new(); secp.sign(&message, secret_key) - .map_err(|_| ErrorKind::SecpError.into()) + .map_err(|e| Error::SecpError(e)) } pub fn verify_signature( challenge: &str, signature: &Signature, public_key: &PublicKey, -) -> Result<()> { +) -> ResultSingle<()> { let mut hasher = Sha256::new(); hasher.input(challenge.as_bytes()); let message = Message::from_slice(hasher.result().as_slice())?; let secp = Secp256k1::new(); secp.verify(&message, signature, public_key) - .map_err(|_| ErrorKind::SecpError.into()) + .map_err(|e| Error::SecpError(e)) } diff --git a/epicboxlib/epicboxlib/src/utils/mod.rs b/epicboxlib/epicboxlib/src/utils/mod.rs index c21a04a..9375cd7 100644 --- a/epicboxlib/epicboxlib/src/utils/mod.rs +++ b/epicboxlib/epicboxlib/src/utils/mod.rs @@ -1,5 +1,5 @@ use std::fmt::Write; -use crate::error::{Result, ErrorKind}; +use crate::error::{Error, ResultSingle}; pub use epic_core::global::is_mainnet; @@ -17,9 +17,9 @@ pub fn to_hex(bytes: Vec) -> String { } /// Decode a hex string into bytes. -pub fn from_hex(hex_str: String) -> Result> { +pub fn from_hex(hex_str: String) -> ResultSingle> { if hex_str.len() % 2 == 1 { - Err(ErrorKind::NumberParsingError)?; + Err(Error::NumberParsingError)?; } let hex_trim = if &hex_str[..2] == "0x" { hex_str[2..].to_owned() @@ -28,8 +28,8 @@ pub fn from_hex(hex_str: String) -> Result> { }; let vec = split_n(&hex_trim.trim()[..], 2) .iter() - .map(|b| u8::from_str_radix(b, 16).map_err(|_| ErrorKind::NumberParsingError.into())) - .collect::>>()?; + .map(|b| u8::from_str_radix(b, 16).map_err(|_| Error::NumberParsingError.into())) + .collect::>>()?; Ok(vec) } diff --git a/epicboxlib/src/main.rs b/epicboxlib/src/main.rs index fb46836..df7605f 100644 --- a/epicboxlib/src/main.rs +++ b/epicboxlib/src/main.rs @@ -1,57 +1,48 @@ extern crate epicboxlib; -use epicboxlib::error::{ErrorKind, Result}; -use epicboxlib::types::{EpicboxAddress, EpicboxError, EpicboxRequest, EpicboxResponse}; +use epicboxlib::error::{Error, ResultSingle}; +use epicboxlib::types::{EpicboxAddress, EpicboxError}; use epicboxlib::utils::crypto::{verify_signature, Base58, Hex}; use epicboxlib::utils::secp::{PublicKey, Signature}; use std::env; fn main() { - - - let args: Vec = env::args().collect(); - - - let verifysignature: &str = "verifysignature"; - let verifyaddress: &str = "verifyaddress"; - - if verifysignature.eq(args[1].as_str()) { - - let answer = match verify_signature_main(args[2].as_str(), args[3].as_str(), args[4].as_str()){ - - Ok(answer) => true, - Err(e) => false, - }; - - print!("{}", answer); - - } else if verifyaddress.eq(args[1].as_str()) { - - let mut fromok = true; - let mut took = true; - let from_address = EpicboxAddress::from_str_raw(&args[2]); - if from_address.is_err() { - fromok = false; - } - - - let to_address = EpicboxAddress::from_str_raw(&args[3]); - if to_address.is_err() { - took = false - } - print!("{}", (fromok && took)); - - - } else { print!("{}", false);} - + let args: Vec = env::args().collect(); + + let verifysignature: &str = "verifysignature"; + let verifyaddress: &str = "verifyaddress"; + + if verifysignature.eq(args[1].as_str()) { + let answer = + match verify_signature_main(args[2].as_str(), args[3].as_str(), args[4].as_str()) { + Ok(_answer) => true, + Err(_e) => false, + }; + + print!("{}", answer); + } else if verifyaddress.eq(args[1].as_str()) { + let mut fromok = true; + let mut took = true; + let from_address = EpicboxAddress::from_str_raw(&args[2]); + if from_address.is_err() { + fromok = false; + } + + let to_address = EpicboxAddress::from_str_raw(&args[3]); + if to_address.is_err() { + took = false + } + print!("{}", (fromok && took)); + } else { + print!("{}", false); + } } - -fn verify_signature_main( public_key: &str, challenge: &str, signature: &str) -> Result<()> { - let (public_key, _) = PublicKey::from_base58_check_raw(public_key, 2)?; - let signature = Signature::from_hex(signature)?; - verify_signature(challenge, &signature, &public_key) - .map_err(|_| ErrorKind::EpicboxProtocolError(EpicboxError::InvalidSignature))?; - Ok(()) +fn verify_signature_main(public_key: &str, challenge: &str, signature: &str) -> ResultSingle<()> { + let (public_key, _) = PublicKey::from_base58_check_raw(public_key, 2)?; + let signature = Signature::from_hex(signature)?; + verify_signature(challenge, &signature, &public_key) + .map_err(|_| Error::EpicboxProtocolError(EpicboxError::InvalidSignature))?; + Ok(()) } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ebfa2cc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,355 @@ +{ + "name": "epicboxnodejs", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "epicboxnodejs", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "mongodb": "^5.1.0", + "uid2": "^1.0.0", + "ws": "^8.12.1" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.1.tgz", + "integrity": "sha512-t7c5K033joZZMspnHg/gWPE4kandgc2OxE74aYOtGKfgB9VPuVJPix0H6fhmm2erj5PBJ21mqcx34lpIGtUCsQ==", + "optional": true, + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@types/node": { + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" + }, + "node_modules/@types/whatwg-url": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", + "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "dependencies": { + "@types/node": "*", + "@types/webidl-conversions": "*" + } + }, + "node_modules/bson": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz", + "integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==", + "engines": { + "node": ">=14.20.1" + } + }, + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, + "node_modules/mongodb": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.9.2.tgz", + "integrity": "sha512-H60HecKO4Bc+7dhOv4sJlgvenK4fQNqqUIlXxZYQNbfEWSALGAwGoyJd/0Qwk4TttFXUOHJ2ZJQe/52ScaUwtQ==", + "dependencies": { + "bson": "^5.5.0", + "mongodb-connection-string-url": "^2.6.0", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=14.20.1" + }, + "optionalDependencies": { + "@mongodb-js/saslprep": "^1.1.0" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.0.0", + "kerberos": "^1.0.0 || ^2.0.0", + "mongodb-client-encryption": ">=2.3.0 <3", + "snappy": "^7.2.2" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", + "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "dependencies": { + "@types/whatwg-url": "^8.2.1", + "whatwg-url": "^11.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "optional": true, + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/uid2": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-1.0.0.tgz", + "integrity": "sha512-+I6aJUv63YAcY9n4mQreLUt0d4lvwkkopDNmpomkAUz0fAkEMV9pRWxN0EjhW1YfRhcuyHg2v3mwddCDW1+LFQ==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + }, + "dependencies": { + "@mongodb-js/saslprep": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.1.tgz", + "integrity": "sha512-t7c5K033joZZMspnHg/gWPE4kandgc2OxE74aYOtGKfgB9VPuVJPix0H6fhmm2erj5PBJ21mqcx34lpIGtUCsQ==", + "optional": true, + "requires": { + "sparse-bitfield": "^3.0.3" + } + }, + "@types/node": { + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "requires": { + "undici-types": "~5.26.4" + } + }, + "@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" + }, + "@types/whatwg-url": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", + "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "requires": { + "@types/node": "*", + "@types/webidl-conversions": "*" + } + }, + "bson": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz", + "integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==" + }, + "ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + }, + "memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, + "mongodb": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.9.2.tgz", + "integrity": "sha512-H60HecKO4Bc+7dhOv4sJlgvenK4fQNqqUIlXxZYQNbfEWSALGAwGoyJd/0Qwk4TttFXUOHJ2ZJQe/52ScaUwtQ==", + "requires": { + "@mongodb-js/saslprep": "^1.1.0", + "bson": "^5.5.0", + "mongodb-connection-string-url": "^2.6.0", + "socks": "^2.7.1" + } + }, + "mongodb-connection-string-url": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", + "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "requires": { + "@types/whatwg-url": "^8.2.1", + "whatwg-url": "^11.0.0" + } + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" + }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + }, + "socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "requires": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + } + }, + "sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "optional": true, + "requires": { + "memory-pager": "^1.0.2" + } + }, + "tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "requires": { + "punycode": "^2.1.1" + } + }, + "uid2": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-1.0.0.tgz", + "integrity": "sha512-+I6aJUv63YAcY9n4mQreLUt0d4lvwkkopDNmpomkAUz0fAkEMV9pRWxN0EjhW1YfRhcuyHg2v3mwddCDW1+LFQ==" + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==" + }, + "whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "requires": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + } + }, + "ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "requires": {} + } + } +} diff --git a/package.json b/package.json index cc59cc2..a37e708 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "epicboxnodejs", "version": "1.0.0", "description": "", - "main": "app.js", + "main": "app_mongo.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },