- Install
near-cli
- Login contract wallet and export source
export CONTRACT_NAME=contract
- Install
jq
apt-get install jq
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
db.getCollection("wheel_histories").aggregate( | |
[ | |
{ | |
"$match" : { | |
} | |
}, | |
{ | |
"$group" : { | |
"_id" : "$createdAtInt", |
Integer totalSlot = 100000; | |
Double totalLuckyPercent = gifts.stream() | |
.filter(gift -> gift.getQuantity() > 0) | |
.map(gift -> { | |
// Set rate limit | |
if (giftLogs.size() > 0 && gift.getType() == GiftType.GIFT) { | |
return Double.parseDouble("0"); | |
}; | |
return gift.getLuckyPercent(); |
const validateUsername = (username: string): boolean => { | |
const regex = new RegExp("^(?=[a-zA-Z0-9._]{3,30}$)(?!.*[_.]{2})[^_.].*[^_.]$"); | |
return regex.test(username); | |
} |
const Tx = require('ethereumjs-tx'); | |
const Web3 = require('web3'); | |
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/')); | |
const contractAddr = 'CONTRACT_ADDRESS'; | |
const contractAbi = [/* CONTRACT_ABI_ARRAY */]; | |
const contractOwner = { | |
addr: 'CONTRACT_OWNER_ADDRESS', | |
key: 'CONTRACT_OWNER_PRIVATE_KEY' | |
}; |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...