Skip to content

Instantly share code, notes, and snippets.

module.exports = {
storageProviders: {
puttyimages: '0x0102030405060708091011121314151617181920',
},
};
@nnkken
nnkken / README.md
Last active August 6, 2018 03:11
Example ABCI server

This is an example ABCI server program, which gives you a basic impression about how does an ABCI server works with Tendermint.

You can also try to delete the DB (/tmp/num-adder.db), or reset block info (tendermint unsafe_reset_all) to see what will happen.

Tendermint version

0.22.8-40d6dc2e

Run the node

@nnkken
nnkken / Relay.sol
Last active September 15, 2018 11:04
Comparing gas consumption for parsing JSON and Amino messages
// 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,
@nnkken
nnkken / draft-ietf-oauth-security-topics-11.md
Created February 25, 2019 08:54
OAuth 2.0 related RFCs
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 / build.sh
Last active May 31, 2019 15:30
Instruction of joining LikeChain Cosmos Testnet
#!/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
@nnkken
nnkken / main.go
Created August 3, 2019 13:40
Cosmos decode tx
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 / setjump.c
Created September 14, 2019 11:54
Setjump test
#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 / sign.js
Created November 7, 2019 03:55
Cosmos SDK transaction signing and verifying
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');
@nnkken
nnkken / keybase.md
Created November 13, 2019 09:00
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:

{
"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": {