$ npm run transmute -- ipfs deploy --env local --target ./cli/mock
$ npm run transmute eventstore create
$ npm run transmute -- eventstore permissions --contractAddress 0x1cc9bbbef5918672997dffe449bd71b0eb44fe37
$ npm run transmute -- eventstore grant --contractAddress 0xe2c2f8a71100dcf98815d66350a269f6b781d832 --g admin,write,create:any,"['*']"
$ npm run transmute -- eventstore can --contractAddress 0xe2c2f8a71100dcf98815d66350a269f6b781d832 --q admin,create:any,event
This file contains hidden or 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
describe('canRoleActionResource(role, action, resource) congruity to can(role).action(resource)', () => { | |
it('for defined permissions', async () => { | |
// We start by granting an admin create:any for event store | |
let grantAdminCreateAnyEventStore = { role: 'admin', resource: 'grant', action: 'create:any', attributes: ['*'] } | |
ac.setGrants([grantAdminCreateAnyEventStore]) | |
// A defined permission in Node | |
let acAdminCreateAnyEventStorePerm = ac.can('admin').createAny('grant') | |
assert(acAdminCreateAnyEventStorePerm.granted, "expect admin can create any grant") | |
// Now we do the same in Ethereum | |
let tx = await tac.setGrant('admin', 'grant', 'create:any', ['*'], { |
This file contains hidden or 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 ac = new AccessControl(); | |
ac.grant('user') // define new or modify existing role. also takes an array. | |
.createOwn('video') // equivalent to .createOwn('video', ['*']) | |
.deleteOwn('video') | |
.readAny('video') | |
.grant('admin') // switch to another role without breaking the chain | |
.extend('user') // inherit role capabilities. also takes an array | |
.updateAny('video', ['title']) // explicitly defined attributes | |
.deleteAny('video'); |
This file contains hidden or 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
struct EsEventStruct { | |
address TxOrigin; | |
uint Created; | |
bytes32 EventType; // Event Type + Version | |
bytes1 KeyType; // A — Address, U — UInt, B — Bytes32, X — Bytes32 (ascii) | |
bytes1 ValueType; // A — Address, U — UInt, B — Bytes32, X — Bytes32 (ascii) | |
bytes32 Key; // Key | |
bytes32 Value; // Value | |
} |
This file contains hidden or 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
window.setInterval(function(){ | |
var msg = 'virus ' + Math.random(); | |
// make sure the command does not have a confirmation step... like giphy does | |
// msg = @user ... etc... | |
document.getElementsByClassName('ql-editor')[0].innerHTML = '<p>' + msg + '</p>' | |
window.TS.view.submit(); | |
}, 1 * 1000); |
This file contains hidden or 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
https://www.youtube.com/watch?v=w_yS_bbv0CQ | |
https://www.youtube.com/watch?v=uJaBhnrvzJE |
This file contains hidden or 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
https://dev.havenondemand.com/apis | |
https://cloud.google.com/natural-language/ | |
https://recast.ai/ | |
https://www.luis.ai/ | |
https://api.ai/ | |
https://howdy.ai/botkit/ | |
https://github.com/hackerkid/bots | |
http://linkeddatafragments.org/ |
This file contains hidden or 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 Web3 = require('web3'); | |
var utils = require('ethereumjs-util'); | |
var web3 = new Web3(); | |
var defaultProvider = new web3.providers.HttpProvider('http://localhost:8545'); | |
web3.setProvider(defaultProvider); | |
var account_address = web3.eth.accounts[0]; |
This file contains hidden or 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
while true; do say "troll"; sleep 2; done |