one byte = 8 bit
4 bit => hex 0000 2*2*2*2 = 16
so
one byte = 4bit + 4bit = hex + hex
1、node & npm
apk add nodejs npm nano curl
2、mkdir t put files to t or nano test.js
2.1、nano test.js
var supertest = require('supertest'); describe('GET http://go-ethe:8545/', function () { let request = supertest('http://go-ethe:8545') it('respond with json 1', function (done) { request.post('/') .send({"jsonrpc":"2.0","method":"miner_start","params":[1],"id":1}) .expect('Content-Type', /json/) .expect(200, done); }); let gethcmd = {"jsonrpc":"2.0","method":"eth_mining","params":[],"id":1} it('respond with json mining actively start ', function (done) { request.post('/') .send(gethcmd) .expect('Content-Type', /json/) .expect(200) .expect((res)=>{if (!(true == res.
……………………………………….
……………………………………….
……………………………………….
go-ethereum
https://github.com/ethereum/go-ethereum/wiki/Management-APIs#miner
geth –rpcapi “db,personal,eth,net,web3” --rpc –rpcaddr “0.0.0.0” –rpccorsdomain “*” –rpcvhosts=*
So you want miner, need put “db,personal,miner,eth,net,web3”
curl -X POST -H “Content-Type: application/json” –data ‘{“jsonrpc”:“2.0”,“method”:“miner_stop”,“params”:[],“id”:1}’ go-ethe:8545
{“jsonrpc”:“2.0”,“id”:1,“result”:null}
Fxxx Document………………………………………..
Import see this url document
web3
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_mining
https://github.com/ethereum/web3.js/
filter
json {
source => “message”
}
This mean is Try to use json format transfer log, then put some data to message filed. So some filed just be setting, and some data set to message.
.Use this to check mach and log
https://grokconstructor.appspot.com/do/match
https://blog.johnwu.cc/article/elk-logstash-grok-filter.html
https://github.com/logstash-plugins/logstash-patterns-core/blob/master/patterns/grok-patterns
This is geth log for example
A:
INFO [11-14|09:58:17.730] Generating DAG in progress epoch=1 percentage=99 elapsed=4m8.643s
INFO [11-15|01:41:33.455] Generating DAG in progress epoch=1 percentage=9 elapsed=27.
https://gist.github.com/javahippie/efee5417c69aaad3baf297dd2cd71fc6
version: '3.3' services: go-ethereum: build: context: go-ethe/ ports: - "8545:8545" - "30303:30303" networks: - elk networks: elk: driver: bridge FROM ubuntu:xenial RUN apt-get update \ && apt-get install -y wget \ && rm -rf /var/lib/apt/lists/* WORKDIR "/opt" ARG BINARY="geth-linux-amd64-1.8.17-8bbe7207.tar.gz" RUN wget "https://gethstore.blob.core.windows.net/builds/$BINARY" RUN tar -xzvf $BINARY --strip 1 RUN rm $BINARY ADD ./genesis.json ./genesis.json RUN ./geth init genesis.json CMD nohup ./geth --dev --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --mine #geth --syncmode "light" --cache=2048 EXPOSE 8545 EXPOSE 30303
Suggestion is use docker-machine for make docker machine is more easy. VirtualBox
windows Use HFS.exe for copy file to docker machine instance.
Directory < ethtest >
||=docker-compose.yml
||=< go-ether >
      ||=Dockerfile
      ||=start.sh
      ||=< genesis >
        ||=genesis.json
1、docker-compose.yml
import:
.keystore maybe no use, because run again docker-compose need to delete /go-ether/keystore
.entrypoint must have together Dockerfile ENTRYPOINT
` version: '3.3' services: go-ether: build: context: go-ether/ volumes: #- ./go-ether/keystore:/root/.ethereum/devchain/keystore:rw - ./go-ether/genesis/genesis.json:/root/genesis/genesis.json:ro - /etc/localtime:/etc/localtime:ro entrypoint: /root/start.
http://jyhshin.pixnet.net/blog/post/39349999-shell-script-%E8%87%AA%E5%8B%95%E5%AE%9A%E7%BE%A9%E7%9A%84%E8%AE%8A%E6%95%B8
$@ 包含所有輸入的參數,$@ 即代表 $1, $2,….直到所有參數結束。$@ 用將所有參數以空白為間隔,存在 $@ 中。也就是說 $@ 代表了 “$1” “$2” “$3”….。