• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Shell
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ethereum utilities, dev tools, scripts, etc

eth-utils

ethereum utilities, dev tools, scripts, etc

Usage

Launch an instance

GETH=./geth bash /path/to/eth-utils/gethup.sh <rootdir> <dd> <run> <params>...

This will

  • if it does not exist yet, then create an account with password dd [NEVER USE THIS LIVE]
  • bring up a node with instance id dd (double digit)
  • using rootdir/dd as data directory (where blockchain etc. are stored)
  • listening on port 303dd, (like 30300, 30301, ...)
  • with the account unlocked
  • launching json-rpc server on port 81dd (like 8100, 8101, 8102, ...)
  • extra params are passed to geth
$ GETH=./geth bash ~/eth-utils/gethup.sh ~/tmp/eth/ 04 09 --mine console 
Welcome to the FRONTIER
> eth.getBalance(eth.coinbase)
'198400000000001'
>

Launch a cluster

Running a cluster of 8 instances under dir tmp/eth/ isolated on local eth network (id 3301), launch 05. Give external IP and pass extra param --mine.

GETH=./geth bash gethcluster.sh <root> <n> <network_id> <runid> <IP> [[params]...]

This will set up a local cluster of nodes

  • <n> is the number of clusters
  • <root> is the root directory for the cluster, the nodes are set up with datadir <root>/00, <root>/01, ...
  • new accounts are created for each node
  • they listening on port 303dd (like 30300, 30301, ...)
  • json-rpc server is launched on port 81dd (like 8100, 8101, ...)
  • by collecting the nodes' node-urls, they get connected to each other
  • if enode has no IP, <IP> is substituted
  • if <network_id> is not 0, they will not connect to a default client, resulting in a private isolated network
  • the nodes log into <root>/00.<runid>.log, <root>/01.<runid>.log, ...
  • <runid> is just an arbitrary tag or index you can use to log multiple subsequent launches of the same cluster, I recommend sequential double digit ids
  • the cluster can be killed with killall -QUIT geth (FIXME: should record PIDs)
  • the nodes can be restarted from the same state individually using the gethup.sh script
  • if you want to interact with the nodes, use a json-rpc client
  • you can supply additional params on the command line which will be passed to gethup.sh and eventually to geth for each node, for instance -vmodule=http=6 -mine -minerthreads=8 is a good one.
GETH=./geth bash gethcluster.sh ./leagues/3301/cicada 2 3301 05 77.160.58.3 -mine 
launching node 0/2 ---> tail -f ./leagues/3301/cicada/00.05.log
Welcome to the FRONTIER
launching node 1/2 ---> tail -f ./leagues/3301/cicada/01.05.log
Welcome to the FRONTIER

fill create:

./leagues/3301/cicada/
./leagues/3301/cicada/3301/
./leagues/3301/cicada/3301/00/
./leagues/3301/cicada/3301/00.05.log
./leagues/3301/cicada/3301/00.05.glog
./leagues/3301/cicada/3301/01/
./leagues/3301/cicada/3301/01.05.log
./leagues/3301/cicada/3301/01.05.glog
./leagues/3301/cicada/3301/

You can kill and restart individual nodes or the entire cluster safely, by using different runid you can separate logs for the individual runs in a neat way.

killall -QUIT geth

Using the -QUIT signal is very useful because it dumps the stacktrace into the glog file which you can attach to any bugreport or issue.

Monitor your local cluster:

Installing the eth-netstats monitor

git clone https://github.com/cubedro/eth-netstats
cd eth-netstats
npm install

####Configuring netstat for your cluster

bash /path/to/eth-utils/netstatconf.sh <number_of_clusters> <name_prefix> <ws_server> <ws_secret> 
  • will output resulting app.json to stdout
  • number_of_clusters is the number of nodes in the cluster.
  • name_prefix is a prefix for the node names as will appear in the listing.
  • ws_server is the eth-netstats server. Make sure you write the full URL, for example: http://localhost:3000.
  • ws_secret is the eth-netstats secret.

For example:

git clone https://github.com/ethersphere/eth-utils
cd eth-utils
bash ./netstatconfig.sh 8 cicada http://localhost:3301 kscc > ~/leagues/3301/cicada.json

####Installing eth-net-intelligence-api

git clone https://github.com/cubedro/eth-net-intelligence-api
cd eth-net-intelligence-api
npm install
sudo npm install -g pm2

Starting the eth-net-intelligence-api

to start the eth-net-intelligence-api client for your cluster

cd eth-net-intelligence-api
pm2 start ~/leagues/3301/cicada.json
[PM2] Process launched
[PM2] Process launched
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ App name β”‚ id β”‚ mode β”‚ pid   β”‚ status β”‚ restart β”‚ uptime β”‚ memory      β”‚ watching β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ cicada-0 β”‚ 1  β”‚ fork β”‚ 93855 β”‚ online β”‚ 0       β”‚ 0s     β”‚ 10.289 MB   β”‚ disabled β”‚
β”‚ cicada-1 β”‚ 2  β”‚ fork β”‚ 93858 β”‚ online β”‚ 0       β”‚ 0s     β”‚ 10.563 MB   β”‚ disabled β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 Use `pm2 show <id|name>` to get more details about an app

####Starting the monitor

Use your own eth-netstat server to monitor a league on a port corresponding to a league

cd eth-netstat
PORT=3301 WS_SECRET=kscc npm start &

and enjoy:

open http://localhost:3301

More Repositories

1

bee

Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; and self-sustaining network for permissionless publishing and access to your (application) data.
Go
1,454
star
2

swarm

Swarm: Censorship resistant storage and communication infrastructure for a truly sovereign digital society
Go
490
star
3

bee-dashboard

An app which helps users to setup their Bee node and do actions like cash out cheques
TypeScript
142
star
4

bee-clef

bee-clef is official ethereum clef binary wrapped and preconfigured for bee as a service
Shell
82
star
5

swarm-guide

Swarm Documentation
Python
76
star
6

bee-js

Javascript client library for connecting to Bee decentralised storage
TypeScript
60
star
7

swap-swear-and-swindle

Contracts for Swap, Swear and Swindle. Swap is a protocol for p2p accounting. This is the basis for Swarm’s incentivization model.
TypeScript
52
star
8

beekeeper

Swarm Beekeeper is an orchestrator that can manage a cluster of Bee nodes and call into their API. It allows various scenario’s to be performed on these nodes. The Swarm team uses Beekeeper internally for integration tests.
Go
51
star
9

swarm-cli

Manage your Bee node and interact with the Swarm network via the CLI
TypeScript
48
star
10

bzzaar-contracts

JavaScript
37
star
11

bee-docs

Documentation for the Swarm Bee Client. View at docs.ethswarm.org docs.ethswarm.org, contributions welcome!
JavaScript
36
star
12

helm

Ethersphere Helm Charts
Mustache
32
star
13

awesome-swarm

This is a list of free and open source projects related to Swarm and its growing ecosystem.
31
star
14

swarm-desktop

Electron Desktop app that helps you easily spin up and manage Swarm node
TypeScript
26
star
15

storage-incentives

Smart contracts for Swarm storage incentives
TypeScript
23
star
16

the-book-of-swarm

the book of swarm - base-layer infrastructure for self-sovereign digital society
TeX
16
star
17

bee-factory

Builds up a test environment with Bee clients and with a test blockchain.
TypeScript
16
star
18

grafana-dashboards

Various Grafana dashboards for Swarm
Jsonnet
14
star
19

swarm-extension

PoC for Swarm Browser Extension
TypeScript
14
star
20

ethereum-environments

ethereum environments provisioning and automated vm builds
Puppet
14
star
21

swarm-home

Source code for the Swarm homepage hosted at bzz:/theswarm.eth/
HTML
14
star
22

swarm-docs

TeX
11
star
23

gateway-ui

Swarm Gateway website
TypeScript
11
star
24

gateway-proxy

Proxy service for the Bee client
TypeScript
10
star
25

swarm-kubernetes

Swarm on Kubernetes
HCL
9
star
26

swarm-cluster

docker (+kubernetes) config for a swarm cluster
Shell
8
star
27

mantaray-js

Mantaray data structure in JS
TypeScript
7
star
28

ethproxy

Ethproxy is a websocket reverse proxy for ethereum JsonRPC calls.
Go
6
star
29

helm-charts

Helm charts to deploy Swarm and Geth
Smarty
6
star
30

etherjot

TypeScript
6
star
31

user-stories

Repository for maintaining user stories
5
star
32

SWIPs

The Swarm Improvement Proposal repository
5
star
33

eks-local-disk-provisioner

AWS EKS local disk provisioner
Shell
5
star
34

examples-js

Example code how to interact with Swarm
TypeScript
5
star
35

etherproxy

Etherproxy is a JSON-RPC reverse proxy tool designed for caching requests.
JavaScript
5
star
36

rise-of-bee-airdrop

Rise of Bee Airdrop
TypeScript
4
star
37

swarm-oracles

obsolete - This repository holds the smart-contracts for on-chain oracles, used for updating global variables in the Swarm network
JavaScript
4
star
38

swarm-actions

TypeScript
4
star
39

nonce-reset

Go
4
star
40

repo-maintainer

Description of Repo Maintainer
3
star
41

sw3paper

LaTeX code for the Swap-Swear-Swindle Orange paper
TeX
3
star
42

eth-on-bzz

Ethereum blockchain data on Swarm.
Go
3
star
43

gitbook-plugin-sections

cherry pick section of an included doc on gitbook page
JavaScript
3
star
44

etherjot-web

TypeScript
3
star
45

beelocal

Shell
2
star
46

swarm-visual-guidelines

2
star
47

docker-setup-contracts

Shell
2
star
48

onboarding-faucet

TypeScript
2
star
49

bee-js-docs

JavaScript
2
star
50

swarm-orange-summit

swarm summit 2017 website
HTML
2
star
51

devconV

Holds all content for the Swarm breakout programme at the Ethereum Devcon in Osaka
2
star
52

manifest

Go implementation for bee manifests.
Go
2
star
53

docker-clef

docker for clef
Shell
2
star
54

frontpage.github.io

The front page of Swarm.
TypeScript
2
star
55

nft-example

A very simple project which can be used to deploy and mint an NFT which stores it's metadata and image decentralised in the Swarm.
Solidity
2
star
56

scoop

Scoop repo for Ethersphere
2
star
57

bee-argo

This repo is used for automatic cluster deployments by ArgoCD
2
star
58

homebrew-tap

Homebrew tap for Ethersphere
Ruby
1
star
59

bee-load-test

Spin up 100 node isolated cluster
Shell
1
star
60

swap-deployment

Deployment helm charts and scripts for swap-enabled Swarm clusters
Shell
1
star
61

swarm-bot

JavaScript
1
star
62

resolver

Go
1
star
63

repo-sync-action

Synchronize files from master repo to another repo
1
star
64

helm-charts-artifacts

Packaged Helm charts for running Swarm
HTML
1
star
65

node-implementer-spec

Documentation on how to create a custom Swarm node implementation
Go
1
star
66

bee-runner

A GitHub App built with Probot
JavaScript
1
star
67

swent-docs

Swarm Enterprise documentation
HTML
1
star
68

ethswarm-blog-hugo

CSS
1
star
69

tokenexporter

Go
1
star
70

bee-diagrams

1
star
71

ethercomb

TypeScript
1
star
72

bee-local

definitions for the Bee local cluster development used by the Swarm Team
Shell
1
star
73

ethexporter

Go
1
star
74

node-funder

tool to fund bee nodes
Go
1
star
75

swarm-tools

Swarm tools - a collection of tools that are helpful during development of Swarm
Go
1
star
76

kibana-exports

1
star
77

bee-staging

Definitions for the bee staging releases used by the Swarm team.
Shell
1
star
78

swarm-donation

TypeScript
1
star
79

ethswarm-nextjs

JavaScript
1
star
80

beelon-musk-nft-example

1
star
81

bee-scripts

Scripts by the Bee team to help debug and monitor testnet and mainnet nodes.
Go
1
star
82

ethercast

TypeScript
1
star
83

libetherjot

TypeScript
1
star