Skip to content

Instantly share code, notes, and snippets.

View thanhson1085's full-sized avatar

Nguyen Sy Thanh Son thanhson1085

  • Hanoi, Vietnam
View GitHub Profile
/*
* RPC: https://rpc.tomochain.com mainnet, https://testnet.tomochain.com testnet
* chainId: 88 mainnet, 89 testnet
*/
const Web3 = require('web3')
const rpc = 'https://testnet.tomochain.com'
const chainId = 89
const pkey = 'YOUR_PKEY' // token holder pkey
/*
* RPC: https://rpc.tomochain.com mainnet, https://rpc.testnet.tomochain.com testnet
* chainId: 88 mainnet, 89 testnet
*/
const Web3 = require('web3')
const rpc = 'https://rpc.testnet.tomochain.com'
const chainId = 89
const pkey = 'YOUR_PKEY' // token holder pkey
/*
* RPC: https://rpc.tomochain.com mainnet, https://testnet.tomochain.com testnet
* chainId: 88 mainnet, 89 testnet
* Owner address: balance at least 50000 TOMO
* Coinbase is node address. You can create a empty wallet with https://wallet.testnet.tomochain.com
*/
const rpc = 'https://testnet.tomochain.com'
chainId = 89
const pkey = '[OWNER_PKEY]' // include 0x
curl -sSL https://get.docker.com/ | sh
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
#!/bin/bash
# get tomochain container id
container_id=$(docker ps -q -f "name=tomochain")
cur_date=$(date +%Y-%m-%d)
# remove all peers
echo "\n----------------Save logs to /tmn/tomochain-${cur_date}.log----------------\n"
docker logs $container_id &> /tmp/tomochain-${cur_date}.log
#!/bin/sh
# get tomochain container id
container_id=$(docker ps -q -f "name=tomochain")
# remove all peers
echo "\n------------------------\n!! Removing all peers\n------------------------\n"
docker exec -t $container_id tomo attach data/tomo.ipc --exec "for (i = 0; i < admin.peers.length; i++) { admin.removePeer(admin.peers[i].id) }"
# add TomoChain peers
#!/bin/sh
# get tomochain container id
container_id=$(docker ps -q -f "name=tomochain")
# remove first peer
echo "\n------------------------\n!! Removing all peers\n------------------------\n"
docker exec -t $container_id tomo attach data/tomo.ipc --exec "for (i = 0; i < admin.peers.length; i++) { admin.removePeer(admin.peers[i].id) }"
# restart node
{
"config": {
"chainId": 89,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {
0x7B5F70cd5311B3039BA0b83e8B54B6dEf943Fb7E