Skip to content

Instantly share code, notes, and snippets.

View alexvanin's full-sized avatar

Alex Vanin alexvanin

View GitHub Profile
@alexvanin
alexvanin / client.go
Last active March 25, 2022 09:26
gRPC run out of quota
package main
import (
"bufio"
"context"
"fmt"
"log"
"os"
object "github.com/nspcc-dev/neofs-api-go/v2/object/grpc"
@alexvanin
alexvanin / neofs-drop-start
Created December 17, 2019 12:07
Run neofs-drop service
$ make local_drop
WARNING: Found orphan containers (neofs-privnet) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating neofs-drop-ui ... done
Creating neofs-prometheus ... done
Creating neofs-grafana ... done
Creating neofs-ir-04 ... done
Creating neofs-ir-01 ... done
Creating neofs-ir-03 ... done
Creating neofs-ir-02 ... done
Creating neofs-storage-09 ... done
$ docker pull nspccdev/neofs-cli:0.1.17
0.1.17: Pulling from nspccdev/neofs-cli
9d48c3bd43c5: Already exists
2ddf12e54bbd: Pull complete
ee98a12eff45: Pull complete
de46c7ff4f1f: Pull complete
Digest: sha256:4329c32c476eca005f7e82530552a8b1d03380799f1566d35e2ae92c979c49f3
Status: Downloaded newer image for nspccdev/neofs-cli:0.1.17
docker.io/nspccdev/neofs-cli:0.1.17
$ docker run -it nspccdev/neofs-cli:0.1.17
$ git clone git@github.com:nspcc-dev/neofs-cli.git
Cloning into 'neofs-cli'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 23 (delta 2), reused 23 (delta 2), pack-reused 0
Receiving objects: 100% (23/23), 44.20 KiB | 486.00 KiB/s, done.
Resolving deltas: 100% (2/2), done.
$ cd neofs-cli/
neofs-cli$ make build
rpc-raw-generator$ cp ../neo-bench/scripts/raw.txs ./raw
rpc-raw-generator$ make up
Stop container
Error response from daemon: No such container: neo-raw-generator
Error: No such container: neo-raw-generator
enter inside container:
/var/test # rpc-generator --help
Usage of rpc-generator:
neo-bench/scripts$ ./getblock.py 6820
6820 1
6821 1 10
6822 1 10
6823 1 11
6824 1 10
6825 1 10
6826 1 10
6827 1 10
6828 1 11
neo-bench$ sed -i 's/PRIVNET_IMAGE.*/PRIVNET_IMAGE=neo-bench:0.0.1/' .env
neo-bench$ make env-up
Start privnet
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
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
neo-bench$ cd privnet
neo-bench/privnet$ ./change_neo-cli_node_version.sh neo-cli-privatenet-1 2.10.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