Skip to content

Instantly share code, notes, and snippets.

@libotony
libotony / genesis.json
Last active Mar 29, 2021
Genesis file for VIP-193 enabled testnet
View genesis.json
{
"launchTime": 1617091200,
"gasLimit": 10000000,
"extraData": "193 TestNet",
"accounts": [
{
"address": "0xa477d5b50daf4c673308da10eecfc817eb9f5f21",
"balance": "50000000000000000000000000000",
"energy": "1000000000000000000000000000"
},
@libotony
libotony / ALLOW_ALL.conf
Last active Mar 11, 2021
PUBLIC THOR NODE WITH NGINX
View ALLOW_ALL.conf
map $http_upgrade $connection_upgrade {
default upgrade;
"" close;
}
upstream BACKEND {
server 127.0.0.1:8669;
keepalive 64;
}
@libotony
libotony / test_speed.sh
Created Jul 24, 2020
Evaluate load time by curl
View test_speed.sh
curl -o /dev/null -s -w "namelookup: %{time_namelookup}s\nconnect: %{time_connect}s\nappconnect: %{time_appconnect}s\npretransfer: %{time_pretransfer}s\nredirect: %{time_redirect}s\nstarttransfer: %{time_starttransfer}s\n-------------------------\ntotal: %{time_total}s\n" --resolve "explore.vechain.org:443:164.90.187.219" https://explore.vechain.org/blocks/0x00634e680262af793cdab1b5a520282336f9eefb7f4a7b2d73f60fc02a2de1c5/
@libotony
libotony / delegated-tx.js
Created May 23, 2019
Build delegated tx by thor-devkit.js
View delegated-tx.js
const originPriv = Buffer.from('c962bfd916c0f8d4c1866b11a24802815cf58ba981354fad0ac734d0217cfe73', 'hex')
const txOrigin = cry.publicKeyToAddress(cry.secp256k1.derivePublicKey(originPriv))
const delegatorPriv = Buffer.from('dce1443bd2ef0c2631adc1c67e5c93f13dc23a41c18b536effbbdcbcdb96fb65', 'hex')
const delegator = cry.publicKeyToAddress(cry.secp256k1.derivePublicKey(delegatorPriv))
const tx = new Transaction({
chainTag: 0x27,
blockRef: '0x002b99c540c4e267',
expiration: 30 * 8640, // Expires after 30 days
@libotony
libotony / install-solidity-at-4-on-mac.md
Last active May 13, 2019
Install Solidity@0.4.x on Mac by HomeBrew
View install-solidity-at-4-on-mac.md
  • Create a file solidity@4.rb
  • Run brew install ./solidity@4.rb

If you would like to find other versions of solidity, go to the homebrew-ethereum, find the version you need to install, replace the version and sha256in the file, then install.

@libotony
libotony / Setup own VeChain Thor network.md
Last active Feb 18, 2019
Setup your own VeChain Thor network
View Setup own VeChain Thor network.md

Requirements

  1. At least one MasterNode
  2. At least one Rich Account
  3. At least two public nodes that can connect each other
  4. Executor Can be an address or Executor Contract(Vote contract among steering committee)

Configure Steps

Here we change genesis/testnet.go, this will allow us to build a network with peer to peer network. Furthermore you can change genesis/devnet.go to run a dev-net in solo mode, this allows you to do test locally.

@libotony
libotony / build-thor-on-windows.md
Last active Dec 18, 2018
build thor on windows
View build-thor-on-windows.md
  1. Install MSYS2 from Official Webisite
  2. Follow the instructions in the Official Webisite to update the packages
  3. Start MSYS2 with MinGW-w64
  4. Install required softwares via run pacman -S git make mingw-w64-x86_64-gcc mingw-w64-x86_64-go
  5. Run git clone https://github.com/vechain/thor.git
  6. Run make dep
  7. Run make clean
  8. Run make all
View mysql_backup.sh
#!/bin/bash
## 备份计划任务
##
## 每天凌晨1:30一次全量备份
## 每天间隔1小时一次增量备份
## 30 1 * * * backup.sh full
## 00 * * * * backup.sh inc
##
## 恢复数据步骤:
@libotony
libotony / ps-grep-kill.sh
Created Apr 26, 2017 — forked from itomg/ps-grep-kill.sh
ps grep awk xargs kill
View ps-grep-kill.sh
ps aux|grep cron-14|awk '{print $2}'|xargs echo
ps aux|grep cron-14|awk '{print $2}'|xargs kill
ps aux|grep cron-14|awk '{print $2}'|xargs kill -9