Skip to content

Instantly share code, notes, and snippets.

@nnkken
nnkken / genesis.json
Last active May 26, 2021
Genesis file for likecoin-chain-testnet-internal-sheungwan
View genesis.json
{
"genesis_time": "2021-05-26T03:30:00Z",
"chain_id": "likecoin-testnet-sanpokong-1",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
@nnkken
nnkken / 200000-addresses.js
Created Jun 23, 2020
create 200000 Cosmos addresses test
View 200000-addresses.js
const crypto = require('crypto');
const secp256k1 = require('secp256k1');
const bech32 = require('bech32');
const createHash = require('create-hash');
function createSigner(privateKey) {
const publicKeyArr = secp256k1.publicKeyCreate(privateKey, true);
const publicKey = Buffer.from(publicKeyArr);
const sha256 = createHash('sha256');
const ripemd = createHash('ripemd160');
View genesis.json
{
"genesis_time": "2019-11-25T08:30:32.551547Z",
"chain_id": "local-test-chain",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
View keybase.md

Keybase proof

I hereby claim:

  • I am nnkken on github.
  • I am nnkken (https://keybase.io/nnkken) on keybase.
  • I have a public key ASA7JfqneYUkGEU9I9zgQOdkHTVWDuGTX6dh3koqYD0vwwo

To claim this, I am signing this object:

@nnkken
nnkken / sign.js
Created Nov 7, 2019
Cosmos SDK transaction signing and verifying
View sign.js
const secp256k1 = require('secp256k1');
const bech32 = require('bech32');
const createHash = require('create-hash');
const jsonStringify = require('fast-json-stable-stringify');
function createSigner(privateKey) {
console.log(`private key: ${privateKey.toString('hex')}`);
const publicKey = secp256k1.publicKeyCreate(privateKey, true);
console.log(`public key: ${publicKey.toString('base64')}`);
const sha256 = createHash('sha256');
View setjump.c
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf env;
int my_func(int a, int b) {
if (b == 0) {
printf("do not allow division by 0\n");
longjmp(env, 1);
@nnkken
nnkken / main.go
Created Aug 3, 2019
Cosmos decode tx
View main.go
package main
import (
"fmt"
"encoding/base64"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authTypes "github.com/cosmos/cosmos-sdk/x/auth/types"
nameTypes "github.com/cosmos/sdk-application-tutorial/x/nameservice/types"
)
@nnkken
nnkken / build.sh
Last active May 31, 2019
Instruction of joining LikeChain Cosmos Testnet
View build.sh
#!/bin/bash
set -e
COSMOS_BUILD_TAG="v0.34.6"
git clone https://github.com/cosmos/cosmos-sdk
pushd cosmos-sdk
git checkout $COSMOS_BUILD_TAG
make install tools
View draft-ietf-oauth-security-topics-11.md
Web Authorization Protocol                                T. Lodderstedt
Internet-Draft                                                   yes.com
Intended status: Best Current Practice                        J. Bradley
Expires: 1 July 2019                                              Yubico
                                                             A. Labunets
                                                                Facebook
                                                                 D. Fett
                                                                 yes.com
                                                        28 December 2018
@nnkken
nnkken / Relay.sol
Last active Sep 15, 2018
Comparing gas consumption for parsing JSON and Amino messages
View Relay.sol
// Copyright (C) 2018 LikeCoin Foundation Limited
//
// This file is part of LikeCoin Smart Contract.
//
// LikeCoin Smart Contract is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// LikeCoin Smart Contract is distributed in the hope that it will be useful,