Skip to content

Instantly share code, notes, and snippets.

View alexvanin's full-sized avatar

Alex Vanin alexvanin

View GitHub Profile
@alexvanin
alexvanin / cgi_l1.asm
Created October 26, 2015 17:27
CGI lab. work : lines and circles (Bresenham algo) in assembly code.
;-- Created by Alexey Vanin, 25.10.2015
;---------------------------------------------
;-- Assembly code for lab. work : CG course
;-- Drawing cube and filled-circle inside
;-- Used Bresenham line & circle algorythms
;-- Filling with inline method
.model small
.stack 1024
.data
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import random
import hashlib
from time import sleep
#For working with http server
from BaseHTTPServer import *
# cat /opt/node/neo-cli/protocol.json | grep "SecondsPerBlock"
"SecondsPerBlock": 4,
# cat /opt/node/neo-cli/Plugins/SimplePolicy/config.json | grep "MaxTransactionsPerBlock"
"MaxTransactionsPerBlock": 500,
neo-bench$ make up
Start environment
Creating network "neo-bench_inside" with the default driver
Creating network "neo-bench_host-exposed" with driver "bridge"
Creating neo-cli-privatenet-3 ... done
Creating neo-cli-privatenet-1 ... done
Creating neo-cli-privatenet-4 ... done
Creating neo-cli-privatenet-2 ... done
Creating neo-python ... done
root@4330b5a6b0ab:/neo-python/scripts# ./tx-gen.py -n 10
Privatenet useragent '/Neo:2.9.4/', nonce: 856199433
[I 190319 13:16:08 Settings:331] Created 'Chains' directory at /root/.neopython/Chains
[I 190319 13:16:09 LevelDBBlockchain:112] Created Blockchain DB at /root/.neopython/Chains/privnet
[I 190319 13:16:09 tx-gen:215] ...awaits 0/0
[I 190319 13:17:35 tx-gen:215] ...awaits 6246/6516
[I 190319 13:17:37 tx-gen:221] Syncronized. Height 6516 Now open wallet:
[I 190319 13:17:37 tx-gen:231] Wallet opened
[I 190319 13:17:42 tx-gen:131] Constructing NEO : 0-9
Sending 10.0 NEO from AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y to AJfUYsPJuaurA9f6RB2DVKhV6PmRp8DrdS
root@4330b5a6b0ab:/neo-python/scripts# cp /root/raw.txs ./
root@4330b5a6b0ab:/neo-python/scripts# exit 0
neo-bench$ make connect-cli
Connect to neo-python
* Consensus nodes are running in screen sessions, check 'screen -ls'
* Please report issues to https://github.com/CityOfZion/neo-local
root@f5f56e5056bc:/neo-python# # install your favourite text editor or use inline replace
root@f5f56e5056bc:/neo-python# apt install vim
root@f5f56e5056bc:/neo-python# sed -i 's/"SecondsPerBlock": .*/"SecondsPerBlock": 10,/' /opt/node/neo-cli/protocol.json
root@f5f56e5056bc:/neo-python# sed -i 's/"MaxTransactionsPerBlock": .*/"MaxTransactionsPerBlock": 10000,/' /opt/node/neo-cli/Plugins/SimplePolicy/config.json
root@f5f56e5056bc:/neo-python# exit 0
neo-bench$ cd privnet
neo-bench/privnet$ ./change_neo-cli_node_version.sh neo-cli-privatenet-1 2.10.0
neo-bench$ docker ps | grep neo-cli-privatenet-1
f5f56e5056bc cityofzion/neo-local-privatenet:2.9.4_6kBlocks "/bin/bash /opt/run.…" 22 minutes ago Up 22 minutes (healthy) 0.0.0.0:20333->20333/tcp, 20336/tcp, 0.0.0.0:30333->30333/tcp, 30336/tcp neo-cli-privatenet-1
neo-bench$ docker commit f5f56e5056bc neo-bench:0.0.1
sha256:bfd4cd87688e4cd0dfd9f1bbdc1f9c6ff140496f7be53f94964a32d852191595
neo-bench$ make down
Stop environment
Stopping neo-python ... done
Stopping neo-cli-privatenet-2 ... done