Skip to content

Instantly share code, notes, and snippets.

@emshan
emshan / hyperledger-create.user
Created July 19, 2019 07:32
create user using fabric-ca-client/ verifying id through client identity chaincode(CID)
# for attribute based access control, insert :ecert options in the attibutes
fabric-ca-client register \
--id.name user \
--id.secret password \
--id.type user \
--id.affiliation Org1 \
--id.attrs 'attr=true:ecert, hf.Affiliation=Org1:ecert'
# for enrollment.attrs, attributes named gets copied to ecert
# opt means the attributes can be optional
@emshan
emshan / shelldemon.sh
Last active July 9, 2018 17:00
script for running every 5 sec
nohup watch -n5 'bash script.sh' &
@emshan
emshan / mapStringValue.ts
Last active February 10, 2018 23:46
object convert or map to string : value js / ts
//{ 'c/f/l/k': 1, 'c/f/l/d': 2, 'c/f/w': 2, 'c/d': 1, 'c/e': 2 }
//mapStringValue({
// c: {
// d:1,
// e:2,
// f: {
// w: 2,
// l: {
// k:1,
// d:2