Skip to content

Instantly share code, notes, and snippets.

Avatar

Luke Schoen ltfschoen

  • Clawbird
View GitHub Profile
@olehmell
olehmell / subsocial-pallet.rs
Created Feb 27, 2020
Subsocial-pallet in ryst and types.json for registry types on UI
View subsocial-pallet.rs
#![cfg_attr(not(feature = "std"), no_std)]
/// For more guidance on FRAME pallets, see the example.
/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs
pub mod defaults;
pub mod messages;
pub mod functions;
use sp_std::prelude::*;
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created Nov 21, 2019
Conversion between String, str, Vec<u8>, Vec<char> in Rust
View string-conversion.rs
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@anonymoussprocket
anonymoussprocket / README.md
Last active Mar 16, 2021
Tezos User Workflows with ConseilJS
View README.md

Purpose

Single script to test common Tezos user workflows. Additionally this sample illustrates the use of ConseilJS for interactions with a Tezos blockchain node.

Environment

This tutorial requires nodejs 12.21+ & npm. It's highly recommended to install those via nvm.

Steps

View Edgeware Types
{
"TransactionInput": {
"parent_output": "Hash",
"signature": "Signature"
},
"TransactionOutput": {
"value": "u128",
"pubkey": "Hash",
"sale": "u32"
},
View parity.sh
parity --chain ethereum --ports-shift 0000 --no-warp --node-key supersecret0000
parity --chain classic --ports-shift 0100 --no-warp --node-key supersecret0100
parity --chain ropsten --ports-shift 0200 --no-warp --node-key supersecret0200
parity --chain kovan --ports-shift 0300 --no-warp --node-key supersecret0300
parity --chain ethereum --ports-shift 1000 --light --no-hardcoded-sync --node-key supersecret1000
parity --chain classic --ports-shift 1100 --light --no-hardcoded-sync --node-key supersecret1100
parity --chain ropsten --ports-shift 1200 --light --no-hardcoded-sync --node-key supersecret1200
parity --chain kovan --ports-shift 1300 --light --no-hardcoded-sync --node-key supersecret1300
@brandoncurtis
brandoncurtis / venus.md
Last active Jan 31, 2018
Setting up the Venus testnet on Ethermint (a Tendermint EVM chain, part of the Cosmos project)
View venus.md

All of this is prefaced on having Go installed: https://golang.org/doc/install Go is properly installed if echo $GOPATH returns something that makes sense.

Ethermint

First, install Ethermint. Normally I'd do this:

$ go get -u -d github.com/tendermint/ethermint
$ cd $GOPATH/src/github.com/tendermint/ethermint
@ibraheem4
ibraheem4 / postgres-brew.md
Last active Oct 6, 2022 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)
View postgres-brew.md

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@frozeman
frozeman / whisper-api-test.js
Created Jun 27, 2017
Whisper web3.js 1.0 api test
View whisper-api-test.js
var net = require('net');
var Web3 = require('./src/index.js'); var web3 = new Web3(new Web3.providers.IpcProvider('/Users/frozeman/Library/Ethereum/geth.ipc', net));
var shh = web3.shh;
var identities = [];
var subscription = null;
Promise.all([
shh.newSymKey().then((id) => {identities.push(id);}),
shh.newKeyPair().then((id) => {identities.push(id);})
View MetropolisTestingGuide.md

Edit 8/14/18: See https://ethereum-tests.readthedocs.io/en/latest/ for more updated information. Much of the links below are still valuable though.

Welcome

This guide is intended to provide resources for those wanting to help test Metropolis EIPs. The CPP team is currently in the middle of a migration from EthDocs to a documentation site that is more dedicated to CPP-Ethereum so the documentation on creating tests for Ethereum using testeth is scattered. Everything you will need to get started should be compiled below.

Suggested skill sets needed to create and run tests

  1. Ability to compile/build testeth and LLL compiler or run a docker file.
  2. Ability to [understand the LLL Ethereum language](https://gist.github.com/Souptacular/fd197b1fac7c6d2660b0bef27a33ed40#lll-and-evm-st
View mockchain.py
import collections
import random
import json
import hashlib
def hexhash(x):
return '0x' + hashlib.sha224(str(x)).hexdigest()[:6]