Skip to content

Instantly share code, notes, and snippets.

Different ways to decode/encode a Substrate public keys (i.e. using bs58 li8brary, and using Polkadot.js util-crypto library)

$ node
const bs58 = require('bs58');
const keyring = require('@polkadot/keyring');
const { decodeAddress, encodeAddress } = require('@polkadot/util-crypto');
@ltfschoen
ltfschoen / latex-setup.md
Created February 23, 2020 18:33
latex-setup
@ltfschoen
ltfschoen / ubuntu-18.04-vm-setup.md
Created January 15, 2020 23:46
ubuntu-18.04-vm-setup
  • Install Virtual Box from: http://download.virtualbox.org/virtualbox/

    • Download/install v6.1
    • Download/install Extension Pack
    • Download Guest Edition
  • Download Ubuntu 18.04 64bit ISO - https://ubuntu.com/download/desktop

  • Virtual Box > Welcome > New > Enter name: ubuntu64bit1804; choose Linux; choose Ubuntu 64-bit; use 4000 MB memory (half of your host machine)

  • Choose "Create a virtual hard disk" VirtalBox type, of fixed size 15GB (at least 4GB will be used with installation files)

@ltfschoen
ltfschoen / ubuntu18.04_osboxes.org.md
Last active January 13, 2020 14:52
osboxes.org ubuntu 18.04 setup
@ltfschoen
ltfschoen / docker-stop.sh
Created December 20, 2019 04:02
Docker Stop/Delete all containers and Delete all images
#!/bin/bash
# Stop all running containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@ltfschoen
ltfschoen / subkey.sh
Last active March 14, 2021 08:20
Polkadot Address Generation with Subkey
#!/bin/sh
# Start Ubuntu in container and install dependencies
docker run --name ubuntutest -t -i ubuntu /bin/bash
apt-get update
apt-get install -y curl
curl https://getsubstrate.io -sSf | bash -s -- --fast
# Install Substrate and Subkey
cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.0 --locked
@ltfschoen
ltfschoen / subkey.sh
Created December 20, 2019 03:56
Polkadot Address Generation with Subkey
#!/bin/sh
# Start Ubuntu in container and install dependencies
docker run --name ubuntutest -t -i ubuntu /bin/bash
apt-get update
apt-get install -y curl
curl https://getsubstrate.io -sSf | bash -s -- --fast
# Install Substrate and Subkey
cargo install --force --git https://github.com/paritytech/substrate subkey
# shasum checksum 256 for https://www.osboxes.org/debian/
shasum -a 256 10G-64bit.7z
brew install p7zip
# extract
7za x 10G-64bit.7z
# gpg verify
cat checksums.txt
shasum -a 256 mac_1.7.8_MyCrypto.dmg