Skip to content

Instantly share code, notes, and snippets.

View ylv-io's full-sized avatar
🤑
Building Internet Money

Igor Yalovoy ylv-io

🤑
Building Internet Money
View GitHub Profile
@ylv-io
ylv-io / RequestExtensions.cs
Created April 24, 2018 20:08
Detects client's IP Address Behind Cloudflare using ASP.NET MVC
public static class RequestExtensions
{
public static string GetIpAddress(this HttpRequestBase request)
{
if (request.Headers["CF-CONNECTING-IP"] != null)
return request.Headers["CF-CONNECTING-IP"];
var ipAddress = request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (!string.IsNullOrEmpty(ipAddress))
@ylv-io
ylv-io / BitcoinCashConverter.cs
Last active May 7, 2018 20:22
Bitcoin Cash conversion between legacy and new format using C#
// credit goes to library https://github.com/cashaddress/SharpCashAddr
var newAddress = "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu".OldAddrToCashAddr();
var oldAddress = "bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy".CashAddrToOldAddr();
{{!-- Related posts --}}
{{#get "posts" filter="tags:[{{tags[*].slug}}]+id:-{{id}}" limit="3" include="tags" as |related_posts|}}
{{#foreach related_posts}}
{{#if @first}}
<section class="read-next inner">
<h2 class="read-next-title">Read Next</h2>
{{/if}}
<article class="{{post_class}}">
<header class="post-header">
<div class="post-meta">
cleos
ERROR: RequiredError: Subcommand required
Command Line Interface to EOSIO Client
Usage: cleos [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
-u,--url TEXT=http://localhost:8888/
the http/https URL where nodeos is running
--wallet-url TEXT=http://localhost:8900/
cleos --url https://api.main.alohaeos.com:443 get currency stats eosio.token EOS
{
"EOS": {
"supply": "1003605574.9616 EOS",
"max_supply": "10000000000.0000 EOS",
"issuer": "eosio"
}
}
cleos wallet create --name treasure
Creating wallet: treasure
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5J2DTM7kpPaihUH35pLTJrvhjgZ11SY4FqxYbo6geWvEH4SNvMC"
cleos wallet create --name treasure
Creating wallet: treasure
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5J2DTM7kpPaihUH35pLTJrvhjgZ11SY4FqxYbo6geWvEH4SNvMC"
@ylv-io
ylv-io / gist:8e198b77088da46842e279f89e34a7bc
Created July 11, 2018 12:50
cleos-create-and-import-keys.sh
cleos create key #owner
Private key: 5HsrZsLeUoDvBCFT2JSvgg3KrfwE7BXAJkUBSwnTwX27Cgabumj
Public key: EOS8VMwRNWWHwov4vyzJiq9uTEyzcny8QKXv7CJxGQAwjSTncyv51
cleos create key #active
Private key: 5JtrJNbJPfzm8XPMddANGYT9yzaqo8gwTEpmSrgQNhtoPXL9Ynd
Public key: EOS8CCRKHAbhBim6LimdvhhzhEYiKNnLRhuMD1Zqx5Cut52moBRmH
cleos wallet import 5HsrZsLeUoDvBCFT2JSvgg3KrfwE7BXAJkUBSwnTwX27Cgabumj --name treasure #owner
imported private key for: EOS8VMwRNWWHwov4vyzJiq9uTEyzcny8QKXv7CJxGQAwjSTncyv51
@ylv-io
ylv-io / gist:0ae7809d7895bf66f9b89106817ba628
Created July 11, 2018 12:50
cleos-create-and-import-keys.sh
cleos create key #owner
Private key: 5HsrZsLeUoDvBCFT2JSvgg3KrfwE7BXAJkUBSwnTwX27Cgabumj
Public key: EOS8VMwRNWWHwov4vyzJiq9uTEyzcny8QKXv7CJxGQAwjSTncyv51
cleos create key #active
Private key: 5JtrJNbJPfzm8XPMddANGYT9yzaqo8gwTEpmSrgQNhtoPXL9Ynd
Public key: EOS8CCRKHAbhBim6LimdvhhzhEYiKNnLRhuMD1Zqx5Cut52moBRmH
cleos wallet import 5HsrZsLeUoDvBCFT2JSvgg3KrfwE7BXAJkUBSwnTwX27Cgabumj --name treasure #owner
imported private key for: EOS8VMwRNWWHwov4vyzJiq9uTEyzcny8QKXv7CJxGQAwjSTncyv51
cleos --url https://jungle.eosio.cr:443 get account ylvdeveloper
permissions:
owner 1: 1 EOS8VMwRNWWHwov4vyzJiq9uTEyzcny8QKXv7CJxGQAwjSTncyv51
active 1: 1 EOS8CCRKHAbhBim6LimdvhhzhEYiKNnLRhuMD1Zqx5Cut52moBRmH
memory:
quota: 161.4 KiB used: 3.365 KiB
net bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)