Skip to content

Instantly share code, notes, and snippets.

View corck's full-sized avatar

Christoph Klocker corck

View GitHub Profile
@corck
corck / get-wif.sh
Created July 11, 2018 07:39
Get WIF from Neo Test Wallet
# Start docker (Repo: https://github.com/slipo/neo-scan-docker)
docker-compose up
# Start Neo prompt
np-prompt -p -v
# Open Wallet
open wallet neo-privnet.wallet
# Export WIF
@corck
corck / neon-js-rpc-call
Created July 16, 2018 15:04
Neon RPC Call
let url = "http://neo-privnet:30333";
const client = Neon.create.rpcClient(url, '2.3.2');
let id = this.get('model').id;
console.log(id);
client.getRawTransaction(id)
.then((res) => {
console.log(res)
})
# Neo script to little-endian BigInteger
#!/usr/local/env python3
import binascii
script="011fc56b6a00527ac46a51527ac468164e656f2e53746f726167652e476574436f6e74657874616a52527ac46a00c30361646487646e0006616464696e67680f4e656f2e52756e74696d652e4c6f676a52c36a51c300c37c680f4e656f2e53746f726167652e476574616a53527ac46a53c36a51c351c3936a54527ac46a52c36a51c300c36a54c35272680f4e656f2e53746f726167652e507574616a54c36c7566616a00c30672656d6f7665876454006a52c36a51c300c37c680f4e656f2e53746f726167652e476574616a53527ac46a52c36a51c300c36a53c36a51c351c3945272680f4e656f2e53746f726167652e507574616a53c36a51c351c3946c7566616a00c30762616c616e6365876421006a52c36a51c300c37c680f4e656f2e53746f726167652e476574616c7566616a00c3076d69677261746587642401174d696772617465206f7065726174696f6e207374617274680f4e656f2e52756e74696d652e4c6f670207106a55527ac401056a56527ac4516a57527ac4136d6967726174656420636f6e747261637420336a58527ac403302e336a59527ac40b6c6f63616c68756d616e336a5a527ac40d6e657840656d61696c2e636f6d6a5b527ac40d74657374206d6967726174653
@corck
corck / verification.py
Created June 11, 2019 09:31
neo verfication example
from boa.interop.Neo.Runtime import GetTrigger,CheckWitness
from boa.interop.Neo.Storage import Get,Put,Delete,GetContext
from boa.interop.Neo.TriggerType import Application, Verification
def Main(operation, addr, value):
print("Running Sample v4")
trigger = GetTrigger()
# This determines that the SC is running in Verification mode
@corck
corck / invoke.js.es6
Created June 11, 2019 09:34
Neo dAPI example to invoke a method with verification
//= require babel/polyfill
const network = 'PrivateNet'
const scriptHash = '58e7c597e246a11177580fdda62e0881b8e7e3c0'
class Account {
constructor(address, name) {
this.address = address
this.name = name
}
@corck
corck / main.py
Created October 24, 2019 07:22
find connected NEO nodes from coz monitor RPC list
import requests
import ipaddress
def get_endpoints():
endpoints = []
response = requests.get("https://raw.githubusercontent.com/CityOfZion/neo-mon/master/docs/assets/mainnet.json")
response.raise_for_status()
if response.status_code == 200:
results = response.json()
for site in results['sites']:
@corck
corck / main.py
Created June 9, 2021 15:56
Chubbies Generation Code
'''
The MIT License
Copyright (c) 2021 Chubbies NFT
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the