Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@r8d8
r8d8 / nem-toolchain.md
Last active September 27, 2017 09:00
Command line toolchain for Nem blockchain project announcement

Command line toolchain for Nem blockchain project announcement

We glad to introduce first release set of console utils for NEM blockchain — project nem-toolchain. Idea of projects arise after unsuccessful attempts to find console util for Nem in open sources, that why we decided to make our own.

Current version v0.1 allows create new account — private and public keys pair,and search address by prefix. The project is written in Go — that gives ability to distribute util in compiled form without any external dependencies. asciicast

Nem-toolchain version v0.2

It now can measure generation rate and estimate calculation time. As generation made by random keypair generation, time estimation only possible by probability level. Currently nem-toolchian estimates time for 3 probaility levels - 50%(min), 80%(average), 99.9%(definetly)

Also nem-toolchainnow now has a website with doc and examples, for more info visit here

asciicast

Recently we discovered that our account generation worked wrong.

The reason was usage of invalid hashing algorithm inside go crypto library. We lost our donation address. Error was fixed in v0.2.1, and all binaries released prior to his version was deleted.

If you used nem-toolchain to generate addess, please make new one. And forgot about all early balances 😉

@r8d8
r8d8 / easyelectronics.md
Last active December 14, 2017 22:27
Good resource about electronics, embedded devices, assemblers, etc.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

name: emerald
version: "0.20.0"
about: Command-line interface for Emerald platform
args:
- chain:
short: c
help: Sets a chain name
default_value: mainnet
takes_value: true
- version:
@r8d8
r8d8 / go_style_guide.md
Last active April 13, 2018 14:41
Golang code style

The code should be read sequentially from beginning to end as a good prose, for code it means grouping logic from main high-level concepts to particular low-level details. In the rest, we simply follow S.O.L.I.D principals.

Recommended way to organize the code:

Length limits (inspired by NASA C Style guide):

  • function body <= 60 loc (to be suitable for single screen)
  • source file <= 600 loc
@r8d8
r8d8 / flat_error.rs
Created May 10, 2018 11:53
Serde error while enum flattening
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
pub struct KdfParams {
/// Key derivation function
#[serde(flatten)]
pub kdf: Kdf,
/// `Kdf` length for parameters
pub dklen: usize,
/// Cryptographic salt for `Kdf`
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.8
working_directory: /go/src/github.com/r8d8/nem-toolchain
steps:
- checkout
- run: make setup
- run: make ci
@r8d8
r8d8 / lisp.lua
Last active July 6, 2018 05:10
Lisp in Lua
function eval(x)
if type(x)=="table" then
return eval(x[1])(eval(x[2]),eval(x[3]))
else
return x
end
end
function add(x,y) return x+y end
function sub(x,y) return x-y end