This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const jwt = require('express-jwt'); | |
const path = require('path'); | |
const jwtAuthz = require('express-jwt-authz'); | |
const jwksRsa = require('jwks-rsa'); | |
const cors = require('cors'); | |
require('dotenv').config(); | |
const bodyParser = require('body-parser'); | |
const AuthenticationClient = require('auth0').AuthenticationClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir myfirstapp | |
$ cd myfirstapp/ | |
$ npm init -y | |
Wrote to /Users/shawn/Projects/Sandbox/myfirstapp/package.json: | |
{ | |
"name": "myfirstapp", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import { | |
BrowserRouter as Router, | |
Route | |
} from 'react-router-dom' | |
// import RoleSwitchPage from "./components/RoleSwitchPage"; | |
const { Dharma, Web3 } = require("@dharmaprotocol/dharma.js"); | |
const { Token, LoanRequest } = Dharma.Types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var XMLHttpRequestUpload = /** @class */ (function (_super) { | |
__extends(XMLHttpRequestUpload, _super); | |
function XMLHttpRequestUpload() { | |
var _this = _super.call(this) || this; | |
_this._contentType = null; | |
_this._body = null; | |
_this._reset(); | |
return _this; | |
} | |
XMLHttpRequestUpload.prototype._reset = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node app.js | |
Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. | |
at Object.InvalidConnection (/Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:15632:16) | |
at HttpProvider.sendAsync (/Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:94093:21) | |
at RequestManager.sendAsync (/Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:88113:19) | |
at Object.send (/Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:14667:42) | |
at /Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:5610:10 | |
at new Promise (<anonymous>) | |
at new F (/Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:36169:28) | |
at /Users/shawn/Projects/Blockchain/Sandbox/dharma/node_modules/@dh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Listening on localhost:8545 | |
Local blockchain detected at localhost:8545. | |
Mining block to update blockchain time. | |
evm_mine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const app = express() | |
const { Dharma, Web3 } = require("@dharmaprotocol/dharma.js"); | |
const { LoanRequest } = Dharma.Types; | |
async function f2() { | |
const host = "http://localhost:8545"; | |
const provider = new Web3.providers.HttpProvider(host); | |
const dharma = new Dharma(provider); | |
const loanRequest = await LoanRequest.create(dharma, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check 4 | |
3:5776f7a2:34818:0439b mdbm_lock.cc:487 /home/y/var/run/yfor.mdbm: mlock open error, ylock locks already exist /tmp/.ylock-named//home/y/var/run/yfor.mdbm._int_: No such device | |
ERROR (37 No locks available) in mdbm_open_inner() mdbm.c:4144 | |
3:5776f7a2:34862:0439b mdbm_lock.cc:487 /home/y/var/run/yfor.mdbm: mlock open error, ylock locks already exist /tmp/.ylock-named//home/y/var/run/yfor.mdbm._int_: No such device | |
ERROR (37 No locks available) in mdbm_open_inner() mdbm.c:4144 | |
E 01-160714.215148 17307 yfor /home/y/var/run/yfor.mdbm: Unable to open db | |
Aborted (core dumped) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestAgentAntiEntropy_EnableTagDrift(t *testing.T) { | |
conf := nextConfig() | |
dir, agent := makeAgent(t, conf) | |
defer os.RemoveAll(dir) | |
defer agent.Shutdown() | |
testutil.WaitForLeader(t, agent.RPC, "dc1") | |
args := &structs.RegisterRequest{ | |
Datacenter: "dc1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Incident = store.defineResource({ | |
name: 'incident', | |
relations: { | |
hasMany: { | |
sector: { | |
foreignKey: 'incident_id', | |
localField: 'sectors' | |
} | |
} | |
} |