Skip to content

Instantly share code, notes, and snippets.

@assafmo
assafmo / Showcase_of_Secret_Network_for_LinkNow_by_Blocklike.pdf
Last active Jul 14, 2021
Showcase of Secret Network for LinkNow by Blocklike
View Showcase_of_Secret_Network_for_LinkNow_by_Blocklike.pdf
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@assafmo
assafmo / Showcase of Secret Network for Privacy in Cosmos.pdf
Last active Jun 30, 2021
Showcase of Secret Network for Privacy in Cosmos
View Showcase of Secret Network for Privacy in Cosmos.pdf
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@assafmo
assafmo / secretcli.sh
Last active Jun 9, 2021
{secret,terra}cli setup for testnet
View secretcli.sh
sudo wget -O /bin/secretcli https://github.com/enigmampc/SecretNetwork/releases/download/v1.0.4/secretcli-linux-amd64
sudo chmod +x /bin/secretcli
mkdir -p ~/.secretcli/config
echo 'chain-id = "holodeck-2"
indent = true
keyring-backend = "test"
node = "https://chainofsecrets.secrettestnet.io:26667"
output = "json"
@assafmo
assafmo / gist:e7b67c14934e1bbf9f3bfc6406d32264
Created Dec 20, 2020
Google sheets HTTP GET into a single cell
View gist:e7b67c14934e1bbf9f3bfc6406d32264
ARRAYFORMULA(JOIN(CHAR(10),SPLIT(IMPORTDATA("https://google.com")&CHAR(10),CHAR(10))))
@assafmo
assafmo / add_ssh_auth_keys.sh
Created Sep 28, 2020
Add my SSH keys to a new machine
View add_ssh_auth_keys.sh
curl -sSL github.com/assafmo.keys >> ~/.ssh/authorized_keys
@assafmo
assafmo / node_sync_eta.sh
Last active Sep 23, 2020
Node sync progress bar + ETA
View node_sync_eta.sh
#!/bin/bash
NETWORK_BLOCK_NUMBER=$(
curl -s http://client.secretnodes.org:26657/status | jq '.result.sync_info.latest_block_height | tonumber'
)
LOCAL_BLOCK_NUMBER=$(secretcli status | jq '.sync_info.latest_block_height | tonumber')
BLOCKS_LEFT_TO_SYNC=$(jq -n "${NETWORK_BLOCK_NUMBER} - ${LOCAL_BLOCK_NUMBER}")
sudo journalctl -u secret-node -f |
grep -Po 'height=\d+ txs=' |
@assafmo
assafmo / 1_curl_tor.sh
Last active Aug 29, 2020
Use curl with TOR as proxy
View 1_curl_tor.sh
#!/bin/bash
# Install
sudo apt install -y tor
# Use
curl --proxy socks5h://localhost:9050 https://check.torproject.org
@assafmo
assafmo / convert_secret-1_export_to_secret-2_genesis.jq
Last active Sep 8, 2020
Convert secret-1 export to secret-2 genesis.json
View convert_secret-1_export_to_secret-2_genesis.jq
#!/usr/bin/env jq
.chain_id = "secret-2" |
.genesis_time = (now | todate) |
.consensus_params.block.max_gas = "10000000" |
# Initialize x/register
.app_state.register = {
@assafmo
assafmo / uptime.sh
Last active Aug 26, 2020
Calculate validators uptime in the Secret Network
View uptime.sh
seq 2 250000 |
parallel --bar 'secretcli q block {} | jq -r ".block.last_commit.signatures[].validator_address | [{}-1,.] | @csv"'
@assafmo
assafmo / Caddyfile
Last active Jul 8, 2020
caddy conf for reverse proxy
View Caddyfile
bootstrap.int.testnet.enigma.co
header {
Access-Control-Allow-Origin *
Access-Control-Allow-Methods *
Access-Control-Allow-Headers *
}
@corspreflight {
method OPTIONS