2020/08,江端さんの技術メモ

0. メモ

CREATE DATABASE ca_sim0; の逆で、DBの消去方法は DROP DATABASE ca_sim0;

  1. メイン

すでに地図DBは作ってきたが、今のうちに纏めておきます。ここでは東京の豊洲地区を例にして説明します。

なお、Dockerの利用を前提とし、それぞれの地区のDBはバラバラに管理するものとします。地区ごとに取り扱えるようにして、DBを切り替えて利用することを前提とする為です。

(Step1) (to-path)/toyosu というディレクトリを掘る

(Step2) そのディレクトリに、以下のdocker-compose.ymlを作ります。

version: '3.7'

services:
  db:
    image:  postgis-pgrouting:latest
    environment:
      POSTGRES_HOST_AUTH_METHOD: 'trust'
      POSTGRES_PASSWORD: 'postgres'
    expose:
      - 5432
    ports:
    - 15432:5432
    volumes:
      - db_data
      - ./shared:/shared
  db_data:
    image: busybox
    volumes:
      - /data/db

これに対して、

docker-compose up -d
Creating network "toyosu_default" with the default driver
Pulling db (postgis-pgrouting:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling db (postgis-pgrouting:latest)...
ERROR: pull access denied for postgis-pgrouting, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ubuntu@ip-172-26-13-137:~/toyosu$

てなものが出てきた時は、

image: postgis-pgrouting:latest

の代わりに、

image: pgrouting/pgrouting:v3.0.0-dev-postgresql_12

にしたら動いた(理由は不明だが、まあいいか)

DB(PostgreSQL)のアクセス用のポート番号は、15432としています。ローカルにPostgresがある場合にバッティングを避ける為です。

(Step3) そのディレクトリの中で、"docker-compose up -d"を実行する。

(Step4)"$ docker start -a toyosu_db_1"としてコンテナを起動する

(Step5)(winpty) "docker container exec -it toyosu_db_1 bash" でシェルに入る

(Step6) "psql -U postgres" で、DBのコンソールに入る

(Step7)psqlでデータベースを新規作成する(以下、データベース名をca_simとする)。

postgres=#CREATE DATABASE ca_sim

(Step8)次のコマンドを実行する

postgres=# \c ca_sim
postgres=# create extension postgis;
postgres=# create extension pgrouting;

(Step9) ここで、もう一つ、コンソール(2)をたちあげて、(to-path)/toyosuに入っておく

(Step10) https://www.openstreetmap.org/ から、豊洲地区を選んで地図DBをエクスポートする

ファイル名を"toyosu.osm"として、(to-path)/toyosuに保存する。

↓私が使っている、"toyosu.osm"

(Step11) コンソール2で、"toyosu.osm"を、コンテナに放り込む

>docker cp toyosu.osm toyosu_db_1:/db_data

(Step12)コンソール2で、"apt-get update"、"apt-get update" を実施した後、"apt-get install osm2pgrouting"を実施

(Step13)コンソール2で、"osm2pgrouting -f /db_data/toyosu.osm -c /usr/share/osm2pgrouting/mapconfig_for_cars.xml -d ca_sim -U postgres" を実施

これで、地図DBはできているハズだが、多分、一発で成功することはないので、いろいろ試してみて下さい。

(Step14) psqlでログインしているコンロールから、以下の操作をして表示ができれば、成功

postgres=# \c ca_sim
You are now connected to database "ca_sim" as user "postgres".
ca_sim=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+----------
public | configuration | table | postgres
public | pointsofinterest | table | postgres
public | spatial_ref_sys | table | postgres
public | ways | table | postgres
public | ways_vertices_pgr | table | postgres
(5 rows)

ca_sim=# select * from ways;

以下のような表示がでてくれば、(多分)成功

QGIS3で接続すると、こんな感じのものが表示されるはず

以上

2021/01,江端さんの技術メモ

この環境↓を前提として、

(まとめ)地図DBの作り方

Dockerの環境にて、ca_sim2ののダンプによるsqlファイル(map5.sql)の作成に先程成功しました。

[江端メモ]
root@6432e639f678:/db_data#
>pg_dump -U postgres ca_sim2 > map5.sql
>mv map5.sql /db_data (これ、カレントディレクトリで作業しているなら不要です)

C:\Users\ebata\toyosu>docker cp toyosu_db_1:/db_data/map5.sql map5.sql

(まあ、私の環境でなければ、分からないとは思います)

2021/01,江端さんの技術メモ

QGIS3でosmファイルを地図表示する方法

いつも、osmファイルをドラッグする場所を忘れるので、メモ

すると、こうなる。

以上

2021/01,江端さんの技術メモ

1.前書き
TILE38のクライアントプログラムのサンプルを見たくて、色々探していたら、「TILE38紹介」を紹介するという、非常に良いページを見つけました。
私がプログラムを良く忘れるので、このページのプログラムをそのままコピペさせて頂いて、私の備忘録とさせて頂きます(私の環境では、コメントアウト等がちょっと違ったようです)

2. 前提
Tile38のサーバを立ち上げておきます。Dockerを使って立ち上げておくと簡単です。dockerを使わない方法は、https://github.com/tidwall/tile38 に記載があります。

docker pull tile38/tile38
docker run -p 9851:9851 tile38/tile38

3. サンプルプログラム

(1つ目)

package main

import (
        //"encoding/json"
        "fmt"
        "log"

        //"reflect"

        "github.com/garyburd/redigo/redis"
)

func main() {
        // db connect
        c, err := redis.Dial("tcp", ":9851")
        if err != nil {
                log.Fatalf("Could not connect: %v\n", err)
        }
        defer c.Close()

        // SET location
        ret, err := c.Do("SET", "location", "me", "POINT", 35.6581, 139.6975)
        if err != nil {
                log.Fatalf("Could not SET: %v\n", err)
        }
        fmt.Printf("SET ret:%s\n", ret)

        // GET location
        ret, err = c.Do("GET", "location", "me")
        if err != nil {
                log.Fatalf("Could not GET: %v\n", err)
        }
        fmt.Printf("GET ret:%s\n", ret)
}

(2つめ)

package main

import (
	"encoding/json"
	"fmt"
	"log"

	"github.com/garyburd/redigo/redis"
)

type GeoJsonMember struct {
	Type           string          `json:"type"`
	CoordinatesRaw json.RawMessage `json:"coordinates,omitempty"`
	CoordinatesObj interface{}     `json:"-"`
}

type Point [2]float64

type LineString []Point

type Polygon []LineString

func (member *GeoJsonMember) String() string {
	return fmt.Sprintf("%s %v", member.Type, member.CoordinatesObj)
}

func (member *GeoJsonMember) setCoordinates() error {
	var coordinates interface{}
	switch member.Type {
	case "Point":
		coordinates = new(Point)
	case "LineString":
		coordinates = new(LineString)
	case "Polygon":
		coordinates = new(Polygon)
	default:
		return fmt.Errorf("Unknown type: %v", member.Type)
	}
	err := json.Unmarshal(member.CoordinatesRaw, &coordinates)
	if err != nil {
		return fmt.Errorf("json.Unmarshal error: %v", err)
	}
	member.CoordinatesObj = coordinates
	return nil
}

func unmarshalMultiResults(shapes []byte) ([]*GeoJsonMember, error) {
	var members []*GeoJsonMember
	err := json.Unmarshal(shapes, &members)
	if err != nil {
		return nil, fmt.Errorf("Unmarshal error: %v", err)
	}

	for i, member := range members {
		err := member.setCoordinates()
		if err != nil {
			return nil, fmt.Errorf("member[%v]:type:%v coordinates:%v err:%v\n", i, member.Type, member.CoordinatesRaw, err)
		}
	}
	return members, nil
}

func unmarshalSingleResult(shapes []byte) (*GeoJsonMember, error) {
	var member GeoJsonMember
	err := json.Unmarshal(shapes, &member)
	if err != nil {
		return nil, fmt.Errorf("Unmarshal error: %v", err)
	}

	err = member.setCoordinates()
	if err != nil {
		return nil, fmt.Errorf("type:%v coordinates:%v err:%v\n", member.Type, member.CoordinatesRaw, err)
	}
	return &member, nil
}

func main() {
	// db connect
	c, err := redis.Dial("tcp", ":9851")
	if err != nil {
		log.Fatalf("Could not connect: %v\n", err)
	}
	defer c.Close()

	// SET fleet
	for _, data := range [][]interface{}{
		{"fleet", "id1", "FIELD", "start", "123456", "FIELD", "end", "789012", "POINT", 35.6581, 139.6975},
		{"fleet", "id2", "OBJECT", `{"type":"Point","coordinates":[139.6975,35.6581]}`},
		{"fleet", "id3", "OBJECT", `{"type":"LineString","coordinates":[[139.6975,35.6581],[1,1],[2,2]]}`},
		{"fleet", "id4", "POINT", 35.6581, 139.6975},
	} {
		ret, err := c.Do("SET", data...)
		if err != nil {
			log.Fatalf("Could not SET: %v\n", err)
		}
		fmt.Printf("SET ret:%#s\n", ret)
	}

	// SCAN fleet
	results, err := redis.Values(c.Do("SCAN", "fleet"))
	if err != nil {
		log.Fatalf("Could not SCAN: %v\n", err)
	}

	var cursor int
	var members []interface{}
	_, err = redis.Scan(results, &cursor, &members)
	if err != nil {
		fmt.Printf("scan result error: %v", err)
		return
	}

	for len(members) > 0 {
		// pick up one record from results as []interface{}
		var object []interface{}
		members, err = redis.Scan(members, &object)
		if err != nil {
			fmt.Printf("scan record error: %v", err)
			return
		}
		// scan columns from one record -> [id,json],fields
		var id []byte
		var json []byte
		others, err := redis.Scan(object, &id, &json)
		if err != nil {
			fmt.Printf("scan columns error: %v", err)
			return
		}

		// unmarshal geojson string to struct
		gjm, err := unmarshalSingleResult(json)
		if err != nil {
			fmt.Printf("unmarshal json error: %v", err)
			return
		}
		fmt.Printf("id:%s  json:%s  others:%s\n", id, gjm, others)
	}
}

4. PruneMobileと組み合わせてみる
ランダムウォークさせている歩行者が、一定のエリアに入った時に、メッセージを送付する。

XXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXX

 

 

2021/01,江端さんの技術メモ

  1. 参考文献
    https://r9y9.github.io/blog/2014/03/22/cgo-tips/
    https://hawksnowlog.blogspot.com/2018/12/getting-started-with-cgo.html
  2. 取り敢えず、Goのプログラムの中からCの関数を使う方法
    // go run main.go
    
    package main
    
    /*
    #include <stdio.h>
    #include <stdlib.h>
    
    void myprint(char* s) {
    	printf("%s\n", s);
    }
    */
    import "C"
    
    import "unsafe"
    
    func main() {
    	cs := C.CString("Hello from stdio\n")
    	C.myprint(cs)
    	C.free(unsafe.Pointer(cs))
    }
    
    // output
    // Hello from stdio

    とか

    package main
    
    /*
    #include <math.h>
    double MyPow(double x, double y) {
      double ret = pow(x, y);
      return ret;
    }
    */
    import "C"
    import "fmt"
    
    func main() {
    	ret := C.MyPow(10, 2)
    	fmt.Println(ret)
    }
  3. 結構面倒くさい決まりごと
    (1)import "C" の前には空行を入れない

    // #include <stdio.h>
    // #include <errno.h>
    import "C"

    (2)C / C++ のコンパイラに渡すオプション(flag)を記述する

    // #cgo CFLAGS: -I/usr/local/lib
    import C

 

2020/05,江端さんの技術メモ

基本的には、https://tile38.com/topics/geofencing/ と同じことをやっただけ

(Step 1)サーバを立ち上げる
C:\Users\ebata>docker run -p 9851:9851 tile38/tile38

(Step 2)1つ目のターミナルを上げる
F:\しゅらばしゅう\tile38-master>docker run --net=host -it tile38/tile38 tile38-cli
127.0.0.1:9851> SETCHAN warehouse NEARBY fleet FENCE POINT 33.462 -112.268 6000
{"ok":true,"elapsed":"41.5µs"}
127.0.0.1:9851> SUBSCRIBE warehouse
{"ok":true,"command":"subscribe","channel":"warehouse","num":1,"elapsed":"4.4µs"}

(Step 3)2つ目のターミナルを上げる
$ winpty docker run --net=host -it tile38/tile38 tile38-cli

(Step 4)2つ目のターミナルから座標を入力する
127.0.0.1:9851> SET fleet bus POINT 33.460 -112.260
{"ok":true,"elapsed":"61.7µs"}

1つ目のターミナルに以下が表示される。
{
"command":"set", ← (A)
"group":"5ed3c9a30a24b900011ea4a8",
"detect":"enter", ←(B)
"hook":"warehouse",
"key":"fleet",
"time":"2020-05-31T15:13:39.296483124Z",
"id":"bus",
"object":{"type":"Point","coordinates":[-112.26,33.46]}
}
(A)
del:フェンスで囲まれているコレクションからオブジェクトが削除されたことをクライアントに通知します。
drop:コレクション全体が削除されたことをクライアントに通知します。
set:オブジェクトが追加または更新されたことをクライアントに通知します。
(B)
inside:オブジェクトが指定された領域の内側にあるときです。
outside:オブジェクトが指定されたエリアの外にあるときです。
enter:以前はフェンスの中にいなかったオブジェクトがエリアに入ったときです。
exit:以前フェンスの中にいたオブジェクトがエリアから出たときです。
cross:以前はフェンスの中になかったオブジェクトがエリアに入り、エリアを出たときです。

ところで、
$ SETCHAN warehouse NEARBY fleet FENCE DETECT inside,outside POINT 33.462 -112.268 6000
とか、指定することを可能。
また、例えば COMMANDS オプションを使用することで、どのコマンドを返すかをマスクすることも可能です。以下は、これは、setコマンドのenter検出のみを行うことを指定します。
$ SETCHAN warehouse NEARBY fleet FENCE DETECT enter COMMANDS set POINT 33.462 -112.268 6000

2020/12,江端さんの技術メモ

Tile38

Slack Channel Docker Ready

Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofence. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.

Tile38は、オープンソース(MITライセンス)で、インメモリのジオロケーションデータストア、空間インデックス、リアルタイムジオフェンスです。緯度/経度ポイント、バウンディングボックス、XYZタイル、Geohash、GeoJSONを含む様々なオブジェクトタイプをサポートしています。

This README is quick start document. You can find detailed documentation at https://tile38.com.

このREADMEはクイックスタートのドキュメントです。詳細なドキュメントはhttps://tile38.com.

Nearby Within Intersects Geofencing Roaming Geofences

Features

特徴

Components

  • tile38-server - The server → サーバ
  • tile38-cli - Command line interface tool → コマンドインターフェースツール
  • tile38-benchmark - Server benchmark tool → サーバベンチマークツール

Getting Started

はじめに

Getting Tile38

タイル38の取得

Perhaps the easiest way to get the latest Tile38 is to use one of the pre-built release binaries which are available for OSX, Linux, FreeBSD, and Windows. Instructions for using these binaries are on the GitHub releases page. → 最新のTile38を入手する最も簡単な方法は、OSX、Linux、FreeBSD、Windows用に提供されているビルド済みのリリースバイナリを使用することでしょう。これらのバイナリの使い方は、GitHub release pageにあります。

Docker

To run the latest stable version of Tile38:→Tile38の最新の安定版を実行する。

docker pull tile38/tile38
docker run -p 9851:9851 tile38/tile38

Visit the Tile38 hub page for more information. → 詳しくはTile38ハブページをご覧ください。

Homebrew (macOS)

Install Tile38 using Homebrew →Homebrew](https://brew.sh/)を使ってTile38をインストールします。

brew install tile38
tile38-server

Building Tile38

タイル38の構築

Tile38 can be compiled and used on Linux, OSX, Windows, FreeBSD, and probably others since the codebase is 100% Go. We support both 32 bit and 64 bit systems. Go must be installed on the build machine.

Tile38は、コードベースが100%Goなので、Linux、OSX、Windows、FreeBSD、そしておそらく他のOSでもコンパイルして使うことができます。32ビットと64ビットの両方をサポートしています。ビルドマシンにはGoがインストールされている必要があります。

To build everything simply:

すべてをシンプルに構築する為に

$ make

To test:

$ make test

Running

実行

For command line options invoke: コマンドラインオプションの場合は、次を呼び出します。

$ ./tile38-server -h

To run a single server:

$ ./tile38-server

# The tile38 shell connects to localhost:9851
$ ./tile38-cli
> help

Playing with Tile38

Basic operations: 基本操作:

$ ./tile38-cli

# add a couple of points named 'truck1' and 'truck2' to a collection named 'fleet'.
#「fleet」という名前のコレクションに「truck1」および「truck2」という名前のポイントをいくつか追加します。
> set fleet truck1 point 33.5123 -112.2693   # on the Loop 101 in Phoenix
> set fleet truck2 point 33.4626 -112.1695   # on the I-10 in Phoenix

# search the 'fleet' collection.
#「フリート」コレクションを検索します。
> scan fleet                                 # returns both trucks in 'fleet'
> nearby fleet point 33.462 -112.268 6000    # search 6 kilometers around a point. returns one truck.

# key value operations
# キー値操作
> get fleet truck1                           # returns 'truck1'
> del fleet truck2                           # deletes 'truck2'
> drop fleet                                 # removes all 

Tile38 has a ton of great commands. Tile38にはたくさんの[すばらしいコマンド](https://tile38.com/commands)があります。

Fields

フィールド

Fields are extra data that belongs to an object. A field is always a double precision floating point. There is no limit to the number of fields that an object can have.

フィールドは、オブジェクトに属する追加のデータです。 フィールドは常に倍精度浮動小数点です。 オブジェクトが持つことができるフィールドの数に制限はありません。

To set a field when setting an object: オブジェクトを設定するときにフィールドを設定するには:

> set fleet truck1 field speed 90 point 33.5123 -112.2693             
> set fleet truck1 field speed 90 field age 21 point 33.5123 -112.2693

To set a field when an object already exists: オブジェクトがすでに存在するときにフィールドを設定するには:

> fset fleet truck1 speed 90

Searching

検索

Tile38 has support to search for objects and points that are within or intersects other objects. All object types can be searched including Polygons, MultiPolygons, GeometryCollections, etc.

Tile38は、他のオブジェクト内または他のオブジェクトと交差するオブジェクトおよびポイントの検索をサポートしています。 Polygons、MultiPolygons、GeometryCollectionsなどを含むすべてのオブジェクトタイプを検索できます。

Search Within

Within

WITHIN searches a collection for objects that are fully contained inside a specified bounding area. WITHINは、指定された境界領域内に完全に含まれているオブジェクトをコレクションで検索します。

Search Intersects

Intersects

INTERSECTS searches a collection for objects that intersect a specified bounding area.

Search Nearby

Nearby

NEARBY searches a collection for objects that intersect a specified radius. INTERSECTSは、指定された境界領域と交差するオブジェクトをコレクションで検索します。

Search options

検索オプション

SPARSE - This option will distribute the results of a search evenly across the requested area.

** SPARSE **-このオプションは、検索結果を要求された領域全体に均等に分散します。

This is very helpful for example; when you have many (perhaps millions) of objects and do not want them all clustered together on a map. Sparse will limit the number of objects returned and provide them evenly distributed so that your map looks clean.

これは、非常に役立ちます。 多数(おそらく数百万)のオブジェクトがあり、それらすべてをマップ上にクラスター化したくない場合。 スパースは、返されるオブジェクトの数を制限し、マップがきれいに見えるようにそれらを均等に分散させます。

You can choose a value between 1 and 8. The value 1 will result in no more than 4 items. The value 8 will result in no more than 65536. 1=4, 2=16, 3=64, 4=256, 5=1024, 6=4098, 7=16384, 8=65536.

1から8までの値を選択できます。値1は、4つ以下のアイテムになります。 値8は、65536以下になります。* 1 = 4、2 = 16、3 = 64、4 = 256、5 = 1024、6 = 4098、7 = 16384、8 =65536。*

>

No SparsingSearch WithinSparse 1Search WithinSparse 2Search WithinSparse 3Search WithinSparse 4Search WithinSparse 5Search Within

Please note that the higher the sparse value, the slower the performance. Also, LIMIT and CURSOR are not available when using SPARSE.

スパース値が高いほど、パフォーマンスが低下することに注意してください。 また、SPARSEを使用している場合、LIMITとCURSORは使用できません。

WHERE - This option allows for filtering out results based on field values. For example
nearby fleet where speed 70 +inf point 33.462 -112.268 6000 will return only the objects in the 懼fleet懼 collection that are within the 6 km radius and have a field named speed that is greater than 70.

Multiple WHEREs are concatenated as and clauses. WHERE speed 70 +inf WHERE age -inf 24 would be interpreted as speed is over 70 and age is less than 24.

The default value for a field is always 0. Thus if you do a WHERE on the field speed and an object does not have that field set, the server will pretend that the object does and that the value is Zero.

WHERE - このオプションは、fieldの値に基づいて結果をフィルタリングすることができます。例えば
`nearby fleet where speed 70 +inf point 33.462 -112.268 6000````は、半径6km以内にあるオブジェクトのみを返します。<br><br>複数のWHEREは**and**句として連結されます。<br><br>フィールドのデフォルト値は常に0です。したがって、フィールドspeed` の WHERE を実行したときに、オブジェクトにそのフィールドが設定されていない場合、サーバーはオブジェクトが設定されていて、その値がゼロであるかのように振舞うことになります。

MATCH - MATCH is similar to WHERE except that it works on the object id instead of fields.
nearby fleet match truck* point 33.462 -112.268 6000 will return only the objects in the 懼fleet懼 collection that are within the 6 km radius and have an object id that starts with truck. There can be multiple MATCH options in a single search. The MATCH value is a simple glob pattern.

nearby fleet match truck* point 33.462 -112.268 6000は、半径6km以内にある懼fリート懼コレクションのオブジェクトのうち、かつtruckで始まるオブジェクトIDを持つものだけを返します。1つの検索で複数のMATCHオプションを指定することができます。MATCHの値は単純なglob patternです。

CURSOR - CURSOR is used to iterate though many objects from the search results. An iteration begins when the CURSOR is set to Zero or not included with the request, and completes when the cursor returned by the server is Zero.

CURSOR - CURSORは、検索結果から多くのオブジェクトを繰り返し処理するために使用されます。CURSORが0に設定されているか、リクエストに含まれていない場合には反復処理が開始され、サーバから返されたカーソルが0になった時点で終了します。

NOFIELDS - NOFIELDS tells the server that you do not want field values returned with the search results.

NOFIELDS - NOFIELDSは、検索結果で返されるフィールド値を望まないことをサーバーに伝えます。

LIMIT - LIMIT can be used to limit the number of objects returned for a single search request.

LIMIT - LIMITは、1つの検索リクエストに対して返されるオブジェクトの数を制限するために使用することができます。

Geofencing

ジオフェンシング

Geofence animation A geofence is a virtual boundary that can detect when an object enters or exits the area. This boundary can be a radius, bounding box, or a polygon. Tile38 can turn any standard search into a geofence monitor by adding the FENCE keyword to the search.

ジオフェンスは、物体がその領域に入ったり出たりしたときに検出できる仮想的な境界です。この境界は、半径、境界ボックス、または多角形にすることができます。Tile38は、検索にFENCEキーワードを追加することで、標準的な検索をジオフェンスモニタに変えることができます。

Tile38 also allows for Webhooks to be assigned to Geofences.

*Tile38では、ジオフェンスにWebhooksを割り当てることもできます。

 

A simple example:

簡単な例です。

> nearby fleet fence point 33.462 -112.268 6000

This command opens a geofence that monitors the 懼fleet懼 collection. The server will respond with:

このコマンドは 懼fリート懼 コレクションを監視するジオフェンスを開きます。サーバは以下のように応答します。

{"ok":true,"live":true}

And the connection will be kept open. If any object enters or exits the 6 km radius around 33.462,-112.268 the server will respond in realtime with a message such as:

また、接続はオープンに保たれます。33.462,-112.268` 付近の半径6kmの範囲に何か物体が出入りすると、サーバはリアルタイムで次のようなメッセージを返します。

{"command":"set","detect":"enter","id":"truck02","object":{"type":"Point","coordinates":[-112.2695,33.4626]}}

The server will notify the client if the command is del | set | drop.

サーバは commanddel | set | drop の場合にクライアントに通知する。

  • del notifies the client that an object has been deleted from the collection that is being fenced.
  • del` は、フェンシングされているコレクションからオブジェクトが削除されたことをクライアントに通知します。
  • drop notifies the client that the entire collection is dropped.
  • drop` はコレクション全体が削除されたことをクライアントに通知する。
  • set notifies the client that an object has been added or updated, and when it懼s position is detected by the fence.
  • set` はオブジェクトが追加または更新されたことをクライアントに通知し、フェンスによってその位置が検出されたときにそのことを通知します。

The detect may be one of the following values.

detect` は以下の値のいずれかである。

  • inside is when an object is inside the specified area.
  • inside` はオブジェクトが指定された領域の内側にあるときのことである。
  • outside is when an object is outside the specified area.
  • outside` は、オブジェクトが指定された領域の外にあるときのことである。
  • enter is when an object that was not previously in the fence has entered the area.
  • enter`は、それまで柵の中に**なかったオブジェクトがエリア内に入ってきたときのことである。
  • exit is when an object that was previously in the fence has exited the area.
  • exit`は、以前にフェンスの中にあった***オブジェクトがエリア外に出たときのことである。
  • cross is when an object that was not previously in the fence has entered and exited the area.
  • クロス`とは、それまで柵の中になかったオブジェクトがエリアに入ってきて**エリアから出てきたときのことである。

These can be used when establishing a geofence, to pre-filter responses. For instance, to limit responses to enter and exit detections:

これらは、ジオフェンスを確立する際に、応答を事前にフィルタリングするために使用することができます。例えば、enterexit の検出に対して応答を制限することができます。

> nearby fleet fence detect enter,exit point 33.462 -112.268 6000

Pub/sub channels

パブ/サブチャンネル

Tile38 supports delivering geofence notications over pub/sub channels.

Tile38は、パブ/サブチャンネル上のジオフェンス通知の配信をサポートしています。

To create a static geofence that sends notifications when a bus is within 200 meters of a point and sends to the busstop channel:

バスがポイントから200メートル以内にいるときに通知を送信し、busstopチャンネルに送信する静的ジオフェンスを作成します。

> setchan busstop nearby buses fence point 33.5123 -112.2693 200

Subscribe on the busstop channel:

バストップチャンネルを購読してください。

> subscribe busstop

Object types

オブジェクトの種類

All object types except for XYZ Tiles and QuadKeys can be stored in a collection. XYZ Tiles and QuadKeys are reserved for the SEARCH keyword only.

XYZ TilesとQuadKeyを除くすべてのオブジェクトタイプは、コレクションに格納することができます。XYZ TilesとQuadKeyは、SEARCHキーワードのみに予約されています。

Lat/lon point

ラット/ロングポイント

The most basic object type is a point that is composed of a latitude and a longitude. There is an optional z member that may be used for auxiliary data such as elevation or a timestamp.

最も基本的なオブジェクト型は緯度と経度からなる点である。オプションの z メンバがあり、標高やタイムスタンプなどの補助データに使用することができます。

set fleet truck1 point 33.5123 -112.2693     # plain lat/lon
set fleet truck1 point 33.5123 -112.2693 225 # lat/lon with z member

Bounding box

バウンディングボックス

A bounding box consists of two points. The first being the southwestern most point and the second is the northeastern most point.

バウンディングボックスは2つの点で構成されています。1つ目は最も南西の点で、2つ目は最も北東の点です。

set fleet truck1 bounds 30 -110 40 -100

Geohash

ジオハッシュ

A geohash is a string representation of a point. With the length of the string indicating the precision of the point.

geohash は、点を文字列で表現したものです。文字列の長さは点の精度を表します。

set fleet truck1 hash 9tbnthxzr # this would be equivalent to 'point 33.5123 -112.2693'

GeoJSON

GeoJSON is an industry standard format for representing a variety of object types including a point, multipoint, linestring, multilinestring, polygon, multipolygon, geometrycollection, feature, and featurecollection.

GeoJSON](https://tools.ietf.org/html/rfc7946)は、点、多点、線条、多線条、多角形、マルチポリゴン、ジオメトリコレクション、フィーチャ、フィーチャコレクションなど、様々なオブジェクトタイプを表現するための業界標準フォーマットです。

* All ignored members will not persist.

* すべての無視されたメンバーは持続しません。

Important to note that all coordinates are in Longitude, Latitude order.

すべての座標は経度、緯度の順になっていることに注意してください。

set city tempe object {"type":"Polygon","coordinates":[[[0,0],[10,10],[10,0],[0,0]]]}

XYZ Tile

XYZタイル

An XYZ tile is rectangle bounding area on earth that is represented by an X, Y coordinate and a Z (zoom) level.

XYZタイルとは、X,Y座標とZ(ズーム)レベルで表現された地球上の矩形領域のことです。

Check out maptiler.org for an interactive example.

インタラクティブな例は maptiler.org をご覧ください。

QuadKey

A QuadKey used the same coordinate system as an XYZ tile except that the string representation is a string characters composed of 0, 1, 2, or 3. For a detailed explanation checkout The Bing Maps Tile System.

QuadKey は XYZ タイルと同じ座標系を使用しますが、文字列表現は 0, 1, 2, 3 で構成される文字列です。詳しい説明は Bing Maps Tile System をご覧ください。

Network protocols

ネットワークプロトコル

It懼s recommended to use a client library or the Tile38 CLI, but there are times when only HTTP is available or when you need to test from a remote terminal. In those cases we provide an HTTP and telnet options.

クライアントライブラリ](#client-libraries)またはTile38 CLIを使用することをお勧めしますが、HTTPしか利用できない場合や、リモート端末からテストする必要がある場合があります。そのような場合には、HTTPとtelnetオプションを用意しています。

HTTP

One of the simplest ways to call a tile38 command is to use HTTP. From the command line you can use curl. For example:

tile38コマンドを呼び出す最も簡単な方法の1つは、HTTPを使用することです。コマンドラインからcurlを使用することができます。例えば、以下のようになります。

# call with request in the body
curl --data "set fleet truck3 point 33.4762 -112.10923" localhost:9851

# call with request in the url path
curl localhost:9851/set+fleet+truck3+point+33.4762+-112.10923

Websockets

ウェブソケット

Websockets can be used when you need to Geofence and keep the connection alive. It works just like the HTTP example above, with the exception that the connection stays alive and the data is sent from the server as text websocket messages.

Websocket は、ジオフェンスして接続を維持する必要がある場合に使用することができます。これは上記の HTTP の例と同じように動作しますが、接続が生きていることと、データがテキストの Websocket メッセージとしてサーバーから送信されることを除いては、動作しません。

Telnet

There is the option to use a plain telnet connection. The default output through telnet is RESP.

プレーンなtelnet接続を使用するオプションがあります。telnetによるデフォルトの出力はRESPです。

telnet localhost 9851
set fleet truck3 point 33.4762 -112.10923
+OK

The server will respond in JSON or RESP depending on which protocol is used when initiating the first command.

サーバは、最初のコマンドを開始するときに使用されるプロトコルに応じて、JSONまたはRESPで応答します。

  • HTTP and Websockets use JSON.
  • HTTPとWebsocketsはJSONを使用しています。
  • Telnet and RESP clients use RESP.
  • Telnet と RESP クライアントは RESP を使用します。

Client Libraries

クライアントライブラリ

Tile38 uses the Redis RESP protocol natively. Therefore most clients that support basic Redis commands will in turn support Tile38. Below are a few of the popular clients.

Tile38はRedis RESPプロトコルをネイティブに使用します。そのため、基本的なRedisコマンドをサポートしているほとんどのクライアントがTile38をサポートしています。以下に人気のあるクライアントをいくつか紹介します。

Contact

連絡先

Josh Baker [@tidwall](https://twitter.com/tidwall)

License

ライセンス

Tile38 source code is available under the MIT License.

Tile38のソースコードはMIT Licenseで公開されています。

2020/11,江端さんの技術メモ

「無理せんと、リバースプロキシ(nginx)使えば?」

で、nginxで、外向きにはhttps, 内側はhttpという nginx.confを作りました。

今回は、nginxがdockerのコンテナですでに稼動中のプログラムで、これを試してみました。

まず、docker-compose.ymlですが、まず、docker-compose.ymlと同じディレクトリに、algo.crtとalgo.keyを放り込んでおいて、portsとvolumesを以下のように変更します。

(前略)
nginx:
    image: nginx:1.15-alpine
    ports:
      - "80:80"    ←ここ      
      - "443:443"   ←ここ      
    links:
      - app:app
    volumes:
      - "./nginx.conf:/etc/nginx/conf.d/default.conf"
      - "./algo.crt:/etc/nginx/conf.d/algo.crt"  ←ここ  
      - "./algo.key:/etc/nginx/conf.d/algo.key"  ←ここ  

portsは、"443:80"と記載するのが正解じゃないかなーと思うのですが、上手く動かなかったので、理由は不明ですが上記のように記載しました。

最後の2行ですが、これはnginxのdockerのコンポーネントの中に強制的にリンクするものらしいのです。少なくとも、dockerのコンポーネントの中に、/etc/nginx/conf.d/ は存在しているようなので、もう適当に、そこにリンクを張ることにしました。(いや、"docker container exec -it nginx_1 sh "等で、コンテナに入って確認すれば良いですが、なんか上手く入れないことがありましてですね)

また、docker-compose.ymlと同じディレクトリに(最初から)入っている、nginx.confを以下のよう改造します。

server { 
 listen 80 default_server;  ←ここ   listen [::]:80 default_server;  ←ここ   return 301 https://$host$request_uri;  ←ここ   } server {  # listen 80 default_server; # listen [::]:80 default_server; listen 443; ←ここ server_name localhost; ←ここ ssl on; ←ここ ssl_certificate /etc/nginx/conf.d/algo.crt; ←ここ # https://wp.kobore.net/2020/09/post-1124/で作ったもの ssl_certificate_key /etc/nginx/conf.d/algo.key; ←ここ # 同上  client_max_body_size 1M; root /go/hitachi_ride_hailing_go/static; # これが良く分からんのだが (app_1の方のディレクトリみたいなんだよなぁ)  location / { index index.html index.htm; proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; if (!-f $request_filename) { proxy_pass http://app:8000; } } location /ws { proxy_pass http://app:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Frame-Options SAMEORIGIN; # リバースプロキシするサーバーから応答が無くとも、接続を切断しない上限の秒数 # http://zaiste.net/2014/12/nginx_websockets_proxy_for_nodejs/ proxy_read_timeout 86400; } }

なんだか分からんけど、太線(←ここ)の所を直したら、https://で通信できるようになったみたいです。

(多分、静的なhtmlファイルの表示だけなら問題はないでしょう)。

あ、忘れていましたが、

JSONのデータを直接受けるhtmlファイルを作成している途中の件

の問題も発生するようなので、面倒なら、"Cross Domain - CORS"を起動しておくと良いでしょう(終了したら取り外しておかないと、Twitterで通信障害「"問題が発生しました" “やりなおす"」が発生するので注意のこと)

ただ、私が現状、https化を試みているプログラムは、まだ問題が残っていて、全部は動いていません。

 

build.9a271f4.js:23 WebSocket connection to 'ws://localhost/ws' failed: Error during WebSocket handshake: Unexpected response code: 301
value @ build.9a271f4.js:23

の方は直接、ws:// → wss://に 書き換えたりとかやっていんだけど、上手く動かないみたいです。

=======

翌日、動いていました。

こういう原因が分からない起動も、厄介です。

2020/10,江端さんの技術メモ

のページをそのまま(ではない)実行

その他の参考メモ

「ブロックチェーン・プログラミング」を読む (bitcoinツールの導入)

Bitcoin Coreを触りながらBitcoinについて理解する - その1(構築~アドレス生成まで)

Bitcoin Bitcoin Core RPC command practice

Dockerをはじめからていねいに?インストールとcentos起動・停止?

C:\Users\ebata\bitcoin>docker-compose build
daemon_two uses an image, skipping
daemon_three uses an image, skipping
Building daemon_one

Traceback (most recent call last):
  File "compose\cli\main.py", line 67, in main
  File "compose\cli\main.py", line 126, in perform_command
  File "compose\cli\main.py", line 302, in build
  File "compose\project.py", line 468, in build
  File "compose\project.py", line 450, in build_service
  File "compose\service.py", line 1147, in build
compose.service.BuildError: (<Service: daemon_one>, {'message': 'Cannot locate specified Dockerfile: Dockerfile'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 78, in main
TypeError: can only concatenate str (not "dict") to str
[2852] Failed to execute script docker-compose

C:\Users\ebata\bitcoin>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は C8D7-CF4A です

 C:\Users\ebata\bitcoin のディレクトリ

2020/10/17  15:28    <DIR>          .
2020/10/17  15:28    <DIR>          ..
2020/10/17  15:28               581 docker-compose.yml
2020/10/17  15:26               436 Dockerfile.txt
               2 個のファイル               1,017 バイト
               2 個のディレクトリ  359,417,462,784 バイトの空き領域

version: "2"
services:
  daemon_one:
    build: "./"
    image: "bitcoind:regtest"
    container_name: 'bitcoin_1'
    hostname: 'bitcoin_1'
    environment:
      - LINE=50
      - COLUMNS=120
    tty: true
    stdin_open: true
    links:
      - daemon_two
      - daemon_three
  daemon_two:
    image: "bitcoind:regtest"
    container_name: 'bitcoin_2'
    hostname: 'bitcoin_2'
    tty: true
    stdin_open: true
  daemon_three:
    image: "bitcoind:regtest"
    container_name: 'bitcoin_3'
    hostname: 'bitcoin_3'
    tty: true
    stdin_open: true
FROM ubuntu:16.04
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y python-software-properties
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:luke-jr/bitcoincore
RUN apt-get update -y
RUN apt-get install -y bitcoind
RUN mkdir ~/.bitcoin
RUN echo "rpcuser=test\nrpcpassword=test\nregtest=1" > ~/.bitcoin/bitcoin.conf
RUN apt-get install iputils-ping net-tools vim -y
CMD ["/bin/bash"]


C:\Users\ebata\bitcoin>mv Dockerfile.txt Dockerfile 
C:\Users\ebata\bitcoin>ls Dockerfile docker-compose.yml 
C:\Users\ebata\bitcoin>docker-compose build daemon_two uses an image, skipping daemon_three uses an image, skipping Building daemon_one 
Step 1/11 : FROM ubuntu:16.04 16.04: Pulling from library/ubuntu 4f53fa4d2cf0: Pull complete 6af7c939e38e: Pull complete 903d0ffd64f6: Pull complete 04feeed388b7: Pull complete Digest: sha256:185fec2d6dbe9165f35e4a1136b4cf09363b328d4f850695393ca191aa1475fd Status: Downloaded newer image for ubuntu:16.04 ---> 096efd74bb89 
Step 2/11 : RUN apt-get update -y && apt-get upgrade -y ---> Running in 3d458b9249b5 
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB] 
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] 
Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1835 kB] 
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] 
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] 
Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB] 
Get:7 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [15.9 kB] 
Get:8 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB] 
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [951 kB] 
Get:10 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB] 
Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [9249 B] 
Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB] 
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [2350 kB] 
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [16.4 kB] 
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1496 kB] 
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [26.7 kB] 
Get:17 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [10.9 kB] 
Get:18 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [12.6 kB] 
Fetched 18.9 MB in 1min 1s (305 kB/s) Reading package lists... 
Reading package lists... 
Building dependency tree... 
Reading state information... 
Calculating upgrade... 
The following packages will be upgraded: libpam-modules libpam-modules-bin libpam-runtime libpam0g 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 375 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpam0g amd64 1.1.8-3.2ubuntu2.3 [55.7 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpam-modules-bin amd64 1.1.8-3.2ubuntu2.3 [36.9 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpam-modules amd64 1.1.8-3.2ubuntu2.3 [244 kB] Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpam-runtime all 1.1.8-3.2ubuntu2.3 [37.8 kB] debconf: delaying package configuration, since apt-utils is not installed Fetched 375 kB in 2s (160 kB/s) (Reading database ... 4780 files and directories currently installed.) Preparing to unpack .../libpam0g_1.1.8-3.2ubuntu2.3_amd64.deb ... Unpacking libpam0g:amd64 (1.1.8-3.2ubuntu2.3) over (1.1.8-3.2ubuntu2.1) ... Processing triggers for libc-bin (2.23-0ubuntu11.2) ... Setting up libpam0g:amd64 (1.1.8-3.2ubuntu2.3) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Processing triggers for libc-bin (2.23-0ubuntu11.2) ... (Reading database ... 4780 files and directories currently installed.) Preparing to unpack .../libpam-modules-bin_1.1.8-3.2ubuntu2.3_amd64.deb ... Unpacking libpam-modules-bin (1.1.8-3.2ubuntu2.3) over (1.1.8-3.2ubuntu2.1) ... Setting up libpam-modules-bin (1.1.8-3.2ubuntu2.3) ... (Reading database ... 4780 files and directories currently installed.) Preparing to unpack .../libpam-modules_1.1.8-3.2ubuntu2.3_amd64.deb ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Unpacking libpam-modules:amd64 (1.1.8-3.2ubuntu2.3) over (1.1.8-3.2ubuntu2.1) ... Setting up libpam-modules:amd64 (1.1.8-3.2ubuntu2.3) ... (Reading database ... 4780 files and directories currently installed.) Preparing to unpack .../libpam-runtime_1.1.8-3.2ubuntu2.3_all.deb ... Unpacking libpam-runtime (1.1.8-3.2ubuntu2.3) over (1.1.8-3.2ubuntu2.1) ... Setting up libpam-runtime (1.1.8-3.2ubuntu2.3) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Removing intermediate container 3d458b9249b5 ---> f00188bd821c Step 3/11 : RUN apt-get install -y python-software-properties ---> Running in b4f5db0d4277 Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed: ca-certificates cron dbus dh-python distro-info-data file gir1.2-glib-2.0 iso-codes krb5-locales libapt-inst2.0 libasn1-8-heimdal libcap-ng0 libcurl3-gnutls libdbus-1-3 libdbus-glib-1-2 libexpat1 libffi6 libgirepository-1.0-1 libglib2.0-0 libglib2.0-data libgmp10 libgnutls30 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx509-5-heimdal libicu55 libidn11 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libmagic1 libmpdec2 libnettle6 libp11-kit0 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libpython3-stdlib libpython3.5-minimal libpython3.5-stdlib libroken18-heimdal librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0 libssl1.0.0 libtasn1-6 libwind0-heimdal libxml2 lsb-release mime-support openssl powermgmt-base python python-apt python-apt-common python-minimal python-pycurl python2.7 python2.7-minimal python3 python3-apt python3-dbus python3-gi python3-minimal python3.5 python3.5-minimal sgml-base shared-mime-info ucf unattended-upgrades xdg-user-dirs xml-core xz-utils Suggested packages: anacron logrotate checksecurity exim4 | postfix | mail-transport-agent dbus-user-session | dbus-x11 libdpkg-perl isoquery gnutls-bin krb5-doc krb5-user libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal lsb python-doc python-tk python-apt-dbg python-apt-doc libcurl4-gnutls-dev python-pycurl-dbg python-pycurl-doc python2.7-doc binutils binfmt-support python3-doc python3-tk python3-venv python3-apt-dbg python-dbus-doc python3-dbus-dbg python3.5-venv python3.5-doc sgml-base-doc bsd-mailx default-mta | mail-transport-agent needrestart debhelper The following NEW packages will be installed: ca-certificates cron dbus dh-python distro-info-data file gir1.2-glib-2.0 iso-codes krb5-locales libapt-inst2.0 libasn1-8-heimdal libcap-ng0 libcurl3-gnutls libdbus-1-3 libdbus-glib-1-2 libexpat1 libffi6 libgirepository-1.0-1 libglib2.0-0 libglib2.0-data libgmp10 libgnutls30 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx509-5-heimdal libicu55 libidn11 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libmagic1 libmpdec2 libnettle6 libp11-kit0 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libpython3-stdlib libpython3.5-minimal libpython3.5-stdlib libroken18-heimdal librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0 libssl1.0.0 libtasn1-6 libwind0-heimdal libxml2 lsb-release mime-support openssl powermgmt-base python python-apt python-apt-common python-minimal python-pycurl python-software-properties python2.7 python2.7-minimal python3 python3-apt python3-dbus python3-gi python3-minimal python3.5 python3.5-minimal sgml-base shared-mime-info ucf unattended-upgrades xdg-user-dirs xml-core xz-utils 0 upgraded, 83 newly installed, 0 to remove and 0 not upgraded. Need to get 27.9 MB of archives. After this operation, 128 MB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 cron amd64 3.0pl1-128ubuntu2 [68.4 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libssl1.0.0 amd64 1.0.2g-1ubuntu4.17 [1082 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython3.5-minimal amd64 3.5.2-2ubuntu0~16.04.12 [524 kB] Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libexpat1 amd64 2.1.0-7ubuntu0.16.04.5 [71.5 kB] Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3.5-minimal amd64 3.5.2-2ubuntu0~16.04.12 [1598 kB] Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 python3-minimal amd64 3.5.1-3 [23.3 kB] Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 mime-support all 3.59ubuntu1 [31.0 kB] Get:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 libmpdec2 amd64 2.4.2-1 [82.6 kB] Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsqlite3-0 amd64 3.11.0-1ubuntu1.5 [398 kB] Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython3.5-stdlib amd64 3.5.2-2ubuntu0~16.04.12 [2131 kB] Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3.5 amd64 3.5.2-2ubuntu0~16.04.12 [165 kB] Get:12 http://archive.ubuntu.com/ubuntu xenial/main amd64 libpython3-stdlib amd64 3.5.1-3 [6818 B] Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 dh-python all 2.20151103ubuntu1.2 [73.9 kB] Get:14 http://archive.ubuntu.com/ubuntu xenial/main amd64 python3 amd64 3.5.1-3 [8710 B] Get:15 http://archive.ubuntu.com/ubuntu xenial/main amd64 libffi6 amd64 3.2.1-4 [17.8 kB] Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-0 amd64 2.48.2-0ubuntu4.6 [1120 kB] Get:17 http://archive.ubuntu.com/ubuntu xenial/main amd64 sgml-base all 1.26+nmu4ubuntu1 [12.5 kB] Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.13 [337 kB] Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7-minimal amd64 2.7.12-1ubuntu0~16.04.13 [1259 kB] Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-minimal amd64 2.7.12-1~16.04 [28.1 kB] Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-stdlib amd64 2.7.12-1ubuntu0~16.04.13 [1886 kB] Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7 amd64 2.7.12-1ubuntu0~16.04.13 [224 kB] Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython-stdlib amd64 2.7.12-1~16.04 [7768 B] Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python amd64 2.7.12-1~16.04 [137 kB] Get:25 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 distro-info-data all 0.28ubuntu0.14 [4674 B] Get:26 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libmagic1 amd64 1:5.25-2ubuntu1.4 [216 kB] Get:27 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 file amd64 1:5.25-2ubuntu1.4 [21.2 kB] Get:28 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapt-inst2.0 amd64 1.2.32ubuntu0.1 [54.5 kB] Get:29 http://archive.ubuntu.com/ubuntu xenial/main amd64 libgmp10 amd64 2:6.1.0+dfsg-2 [240 kB] Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libnettle6 amd64 3.2-1ubuntu0.16.04.1 [93.5 kB] Get:31 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libhogweed4 amd64 3.2-1ubuntu0.16.04.1 [136 kB] Get:32 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libidn11 amd64 1.32-3ubuntu1.2 [46.5 kB] Get:33 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libp11-kit0 amd64 0.23.2-5~ubuntu16.04.1 [105 kB] Get:34 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libtasn1-6 amd64 4.7-3ubuntu0.16.04.3 [43.5 kB] Get:35 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgnutls30 amd64 3.4.10-4ubuntu1.8 [548 kB] Get:36 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 lsb-release all 9.20160110ubuntu0.2 [11.8 kB] Get:37 http://archive.ubuntu.com/ubuntu xenial/main amd64 ucf all 3.0036 [52.9 kB] Get:38 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 openssl amd64 1.0.2g-1ubuntu4.17 [492 kB] Get:39 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ca-certificates all 20190110~16.04.1 [146 kB] Get:40 http://archive.ubuntu.com/ubuntu xenial/main amd64 libcap-ng0 amd64 0.7.7-1 [10.9 kB] Get:41 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libdbus-1-3 amd64 1.10.6-1ubuntu3.6 [161 kB] Get:42 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 dbus amd64 1.10.6-1ubuntu3.6 [141 kB] Get:43 http://archive.ubuntu.com/ubuntu xenial/main amd64 libgirepository-1.0-1 amd64 1.46.0-3ubuntu1 [88.3 kB] Get:44 http://archive.ubuntu.com/ubuntu xenial/main amd64 gir1.2-glib-2.0 amd64 1.46.0-3ubuntu1 [127 kB] Get:45 http://archive.ubuntu.com/ubuntu xenial/main amd64 iso-codes all 3.65-1 [2268 kB] Get:46 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 krb5-locales all 1.13.2+dfsg-5ubuntu2.1 [13.6 kB] Get:47 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libroken18-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [41.4 kB] Get:48 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libasn1-8-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [174 kB] Get:49 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libkrb5support0 amd64 1.13.2+dfsg-5ubuntu2.1 [31.2 kB] Get:50 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libk5crypto3 amd64 1.13.2+dfsg-5ubuntu2.1 [81.3 kB] Get:51 http://archive.ubuntu.com/ubuntu xenial/main amd64 libkeyutils1 amd64 1.5.9-8ubuntu1 [9904 B] Get:52 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libkrb5-3 amd64 1.13.2+dfsg-5ubuntu2.1 [273 kB] Get:53 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgssapi-krb5-2 amd64 1.13.2+dfsg-5ubuntu2.1 [120 kB] Get:54 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libhcrypto4-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [85.0 kB] Get:55 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libheimbase1-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [29.3 kB] Get:56 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libwind0-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [47.8 kB] Get:57 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libhx509-5-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [107 kB] Get:58 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libkrb5-26-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [202 kB] Get:59 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libheimntlm0-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [15.1 kB] Get:60 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgssapi3-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [96.1 kB] Get:61 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsasl2-modules-db amd64 2.1.26.dfsg1-14ubuntu0.2 [14.5 kB] Get:62 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsasl2-2 amd64 2.1.26.dfsg1-14ubuntu0.2 [48.7 kB] Get:63 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libldap-2.4-2 amd64 2.4.42+dfsg-2ubuntu3.9 [159 kB] Get:64 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d-1ubuntu0.1 [54.4 kB] Get:65 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcurl3-gnutls amd64 7.47.0-1ubuntu2.16 [184 kB] Get:66 http://archive.ubuntu.com/ubuntu xenial/main amd64 libdbus-glib-1-2 amd64 0.106-1 [67.1 kB] Get:67 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-data all 2.48.2-0ubuntu4.6 [131 kB] Get:68 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libicu55 amd64 55.1-7ubuntu0.5 [7650 kB] Get:69 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsasl2-modules amd64 2.1.26.dfsg1-14ubuntu0.2 [47.7 kB] Get:70 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxml2 amd64 2.9.3+dfsg1-1ubuntu0.7 [698 kB] Get:71 http://archive.ubuntu.com/ubuntu xenial/main amd64 powermgmt-base all 1.31+nmu1 [7178 B] Get:72 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-apt-common all 1.1.0~beta1ubuntu0.16.04.9 [16.8 kB] Get:73 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3-apt amd64 1.1.0~beta1ubuntu0.16.04.9 [145 kB] Get:74 http://archive.ubuntu.com/ubuntu xenial/main amd64 python3-dbus amd64 1.2.0-3 [83.1 kB] Get:75 http://archive.ubuntu.com/ubuntu xenial/main amd64 python3-gi amd64 3.20.0-0ubuntu1 [153 kB] Get:76 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 shared-mime-info amd64 1.5-2ubuntu0.2 [405 kB] Get:77 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xdg-user-dirs amd64 0.15-2ubuntu6.16.04.1 [61.8 kB] Get:78 http://archive.ubuntu.com/ubuntu xenial/main amd64 xml-core all 0.13+nmu2 [23.3 kB] Get:79 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-apt amd64 1.1.0~beta1ubuntu0.16.04.9 [147 kB] Get:80 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-pycurl amd64 7.43.0-1ubuntu1 [43.3 kB] Get:81 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-software-properties all 0.96.20.10 [20.6 kB] Get:82 http://archive.ubuntu.com/ubuntu xenial/main amd64 xz-utils amd64 5.1.1alpha+20120614-2ubuntu2 [78.8 kB] Get:83 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 unattended-upgrades all 1.1ubuntu1.18.04.7~16.04.6 [42.1 kB] debconf: delaying package configuration, since apt-utils is not installed Fetched 27.9 MB in 1min 50s (252 kB/s) Selecting previously unselected package cron. (Reading database ... 4780 files and directories currently installed.) Preparing to unpack .../cron_3.0pl1-128ubuntu2_amd64.deb ... Unpacking cron (3.0pl1-128ubuntu2) ... Selecting previously unselected package libssl1.0.0:amd64. Preparing to unpack .../libssl1.0.0_1.0.2g-1ubuntu4.17_amd64.deb ... Unpacking libssl1.0.0:amd64 (1.0.2g-1ubuntu4.17) ... Selecting previously unselected package libpython3.5-minimal:amd64. Preparing to unpack .../libpython3.5-minimal_3.5.2-2ubuntu0~16.04.12_amd64.deb ... Unpacking libpython3.5-minimal:amd64 (3.5.2-2ubuntu0~16.04.12) ... Selecting previously unselected package libexpat1:amd64. Preparing to unpack .../libexpat1_2.1.0-7ubuntu0.16.04.5_amd64.deb ... Unpacking libexpat1:amd64 (2.1.0-7ubuntu0.16.04.5) ... Selecting previously unselected package python3.5-minimal. Preparing to unpack .../python3.5-minimal_3.5.2-2ubuntu0~16.04.12_amd64.deb ... Unpacking python3.5-minimal (3.5.2-2ubuntu0~16.04.12) ... Selecting previously unselected package python3-minimal. Preparing to unpack .../python3-minimal_3.5.1-3_amd64.deb ... Unpacking python3-minimal (3.5.1-3) ... Selecting previously unselected package mime-support. Preparing to unpack .../mime-support_3.59ubuntu1_all.deb ... Unpacking mime-support (3.59ubuntu1) ... Selecting previously unselected package libmpdec2:amd64. Preparing to unpack .../libmpdec2_2.4.2-1_amd64.deb ... Unpacking libmpdec2:amd64 (2.4.2-1) ... Selecting previously unselected package libsqlite3-0:amd64. Preparing to unpack .../libsqlite3-0_3.11.0-1ubuntu1.5_amd64.deb ... Unpacking libsqlite3-0:amd64 (3.11.0-1ubuntu1.5) ... Selecting previously unselected package libpython3.5-stdlib:amd64. Preparing to unpack .../libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.12_amd64.deb ... Unpacking libpython3.5-stdlib:amd64 (3.5.2-2ubuntu0~16.04.12) ... Selecting previously unselected package python3.5. Preparing to unpack .../python3.5_3.5.2-2ubuntu0~16.04.12_amd64.deb ... Unpacking python3.5 (3.5.2-2ubuntu0~16.04.12) ... Selecting previously unselected package libpython3-stdlib:amd64. Preparing to unpack .../libpython3-stdlib_3.5.1-3_amd64.deb ... Unpacking libpython3-stdlib:amd64 (3.5.1-3) ... Selecting previously unselected package dh-python. Preparing to unpack .../dh-python_2.20151103ubuntu1.2_all.deb ... Unpacking dh-python (2.20151103ubuntu1.2) ... Processing triggers for systemd (229-4ubuntu21.29) ... Processing triggers for libc-bin (2.23-0ubuntu11.2) ... Setting up libssl1.0.0:amd64 (1.0.2g-1ubuntu4.17) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Setting up libpython3.5-minimal:amd64 (3.5.2-2ubuntu0~16.04.12) ... Setting up libexpat1:amd64 (2.1.0-7ubuntu0.16.04.5) ... Setting up python3.5-minimal (3.5.2-2ubuntu0~16.04.12) ... Setting up python3-minimal (3.5.1-3) ... Processing triggers for libc-bin (2.23-0ubuntu11.2) ... Selecting previously unselected package python3. (Reading database ... 5794 files and directories currently installed.) Preparing to unpack .../python3_3.5.1-3_amd64.deb ... Unpacking python3 (3.5.1-3) ... Selecting previously unselected package libffi6:amd64. Preparing to unpack .../libffi6_3.2.1-4_amd64.deb ... Unpacking libffi6:amd64 (3.2.1-4) ... Selecting previously unselected package libglib2.0-0:amd64. Preparing to unpack .../libglib2.0-0_2.48.2-0ubuntu4.6_amd64.deb ... Unpacking libglib2.0-0:amd64 (2.48.2-0ubuntu4.6) ... Selecting previously unselected package sgml-base. Preparing to unpack .../sgml-base_1.26+nmu4ubuntu1_all.deb ... Unpacking sgml-base (1.26+nmu4ubuntu1) ... Selecting previously unselected package libpython2.7-minimal:amd64. Preparing to unpack .../libpython2.7-minimal_2.7.12-1ubuntu0~16.04.13_amd64.deb ... Unpacking libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.13) ... Selecting previously unselected package python2.7-minimal. Preparing to unpack .../python2.7-minimal_2.7.12-1ubuntu0~16.04.13_amd64.deb ... Unpacking python2.7-minimal (2.7.12-1ubuntu0~16.04.13) ... Selecting previously unselected package python-minimal. Preparing to unpack .../python-minimal_2.7.12-1~16.04_amd64.deb ... Unpacking python-minimal (2.7.12-1~16.04) ... Selecting previously unselected package libpython2.7-stdlib:amd64. Preparing to unpack .../libpython2.7-stdlib_2.7.12-1ubuntu0~16.04.13_amd64.deb ... Unpacking libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.13) ... Selecting previously unselected package python2.7. Preparing to unpack .../python2.7_2.7.12-1ubuntu0~16.04.13_amd64.deb ... Unpacking python2.7 (2.7.12-1ubuntu0~16.04.13) ... Selecting previously unselected package libpython-stdlib:amd64. Preparing to unpack .../libpython-stdlib_2.7.12-1~16.04_amd64.deb ... Unpacking libpython-stdlib:amd64 (2.7.12-1~16.04) ... Processing triggers for libc-bin (2.23-0ubuntu11.2) ... Setting up libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.13) ... Setting up python2.7-minimal (2.7.12-1ubuntu0~16.04.13) ... Linking and byte-compiling packages for runtime python2.7... Setting up python-minimal (2.7.12-1~16.04) ... Selecting previously unselected package python. (Reading database ... 6616 files and directories currently installed.) Preparing to unpack .../python_2.7.12-1~16.04_amd64.deb ... Unpacking python (2.7.12-1~16.04) ... Selecting previously unselected package distro-info-data. Preparing to unpack .../distro-info-data_0.28ubuntu0.14_all.deb ... Unpacking distro-info-data (0.28ubuntu0.14) ... Selecting previously unselected package libmagic1:amd64. Preparing to unpack .../libmagic1_1%3a5.25-2ubuntu1.4_amd64.deb ... Unpacking libmagic1:amd64 (1:5.25-2ubuntu1.4) ... Selecting previously unselected package file. Preparing to unpack .../file_1%3a5.25-2ubuntu1.4_amd64.deb ... Unpacking file (1:5.25-2ubuntu1.4) ... Selecting previously unselected package libapt-inst2.0:amd64. Preparing to unpack .../libapt-inst2.0_1.2.32ubuntu0.1_amd64.deb ... Unpacking libapt-inst2.0:amd64 (1.2.32ubuntu0.1) ... Selecting previously unselected package libgmp10:amd64. Preparing to unpack .../libgmp10_2%3a6.1.0+dfsg-2_amd64.deb ... Unpacking libgmp10:amd64 (2:6.1.0+dfsg-2) ... Selecting previously unselected package libnettle6:amd64. Preparing to unpack .../libnettle6_3.2-1ubuntu0.16.04.1_amd64.deb ... Unpacking libnettle6:amd64 (3.2-1ubuntu0.16.04.1) ... Selecting previously unselected package libhogweed4:amd64. Preparing to unpack .../libhogweed4_3.2-1ubuntu0.16.04.1_amd64.deb ... Unpacking libhogweed4:amd64 (3.2-1ubuntu0.16.04.1) ... Selecting previously unselected package libidn11:amd64. Preparing to unpack .../libidn11_1.32-3ubuntu1.2_amd64.deb ... Unpacking libidn11:amd64 (1.32-3ubuntu1.2) ... Selecting previously unselected package libp11-kit0:amd64. Preparing to unpack .../libp11-kit0_0.23.2-5~ubuntu16.04.1_amd64.deb ... Unpacking libp11-kit0:amd64 (0.23.2-5~ubuntu16.04.1) ... Selecting previously unselected package libtasn1-6:amd64. Preparing to unpack .../libtasn1-6_4.7-3ubuntu0.16.04.3_amd64.deb ... Unpacking libtasn1-6:amd64 (4.7-3ubuntu0.16.04.3) ... Selecting previously unselected package libgnutls30:amd64. Preparing to unpack .../libgnutls30_3.4.10-4ubuntu1.8_amd64.deb ... Unpacking libgnutls30:amd64 (3.4.10-4ubuntu1.8) ... Selecting previously unselected package lsb-release. Preparing to unpack .../lsb-release_9.20160110ubuntu0.2_all.deb ... Unpacking lsb-release (9.20160110ubuntu0.2) ... Selecting previously unselected package ucf. Preparing to unpack .../archives/ucf_3.0036_all.deb ... Moving old data out of the way Unpacking ucf (3.0036) ... Selecting previously unselected package openssl. Preparing to unpack .../openssl_1.0.2g-1ubuntu4.17_amd64.deb ... Unpacking openssl (1.0.2g-1ubuntu4.17) ... Selecting previously unselected package ca-certificates. Preparing to unpack .../ca-certificates_20190110~16.04.1_all.deb ... Unpacking ca-certificates (20190110~16.04.1) ... Selecting previously unselected package libcap-ng0:amd64. Preparing to unpack .../libcap-ng0_0.7.7-1_amd64.deb ... Unpacking libcap-ng0:amd64 (0.7.7-1) ... Selecting previously unselected package libdbus-1-3:amd64. Preparing to unpack .../libdbus-1-3_1.10.6-1ubuntu3.6_amd64.deb ... Unpacking libdbus-1-3:amd64 (1.10.6-1ubuntu3.6) ... Selecting previously unselected package dbus. Preparing to unpack .../dbus_1.10.6-1ubuntu3.6_amd64.deb ... Unpacking dbus (1.10.6-1ubuntu3.6) ... Selecting previously unselected package libgirepository-1.0-1:amd64. Preparing to unpack .../libgirepository-1.0-1_1.46.0-3ubuntu1_amd64.deb ... Unpacking libgirepository-1.0-1:amd64 (1.46.0-3ubuntu1) ... Selecting previously unselected package gir1.2-glib-2.0:amd64. Preparing to unpack .../gir1.2-glib-2.0_1.46.0-3ubuntu1_amd64.deb ... Unpacking gir1.2-glib-2.0:amd64 (1.46.0-3ubuntu1) ... Selecting previously unselected package iso-codes. Preparing to unpack .../iso-codes_3.65-1_all.deb ... Unpacking iso-codes (3.65-1) ... Selecting previously unselected package krb5-locales. Preparing to unpack .../krb5-locales_1.13.2+dfsg-5ubuntu2.1_all.deb ... Unpacking krb5-locales (1.13.2+dfsg-5ubuntu2.1) ... Selecting previously unselected package libroken18-heimdal:amd64. Preparing to unpack .../libroken18-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libroken18-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libasn1-8-heimdal:amd64. Preparing to unpack .../libasn1-8-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libasn1-8-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libkrb5support0:amd64. Preparing to unpack .../libkrb5support0_1.13.2+dfsg-5ubuntu2.1_amd64.deb ... Unpacking libkrb5support0:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Selecting previously unselected package libk5crypto3:amd64. Preparing to unpack .../libk5crypto3_1.13.2+dfsg-5ubuntu2.1_amd64.deb ... Unpacking libk5crypto3:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Selecting previously unselected package libkeyutils1:amd64. Preparing to unpack .../libkeyutils1_1.5.9-8ubuntu1_amd64.deb ... Unpacking libkeyutils1:amd64 (1.5.9-8ubuntu1) ... Selecting previously unselected package libkrb5-3:amd64. Preparing to unpack .../libkrb5-3_1.13.2+dfsg-5ubuntu2.1_amd64.deb ... Unpacking libkrb5-3:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Selecting previously unselected package libgssapi-krb5-2:amd64. Preparing to unpack .../libgssapi-krb5-2_1.13.2+dfsg-5ubuntu2.1_amd64.deb ... Unpacking libgssapi-krb5-2:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Selecting previously unselected package libhcrypto4-heimdal:amd64. Preparing to unpack .../libhcrypto4-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libhcrypto4-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libheimbase1-heimdal:amd64. Preparing to unpack .../libheimbase1-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libheimbase1-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libwind0-heimdal:amd64. Preparing to unpack .../libwind0-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libwind0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libhx509-5-heimdal:amd64. Preparing to unpack .../libhx509-5-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libhx509-5-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libkrb5-26-heimdal:amd64. Preparing to unpack .../libkrb5-26-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libkrb5-26-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libheimntlm0-heimdal:amd64. Preparing to unpack .../libheimntlm0-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libheimntlm0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libgssapi3-heimdal:amd64. Preparing to unpack .../libgssapi3-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ... Unpacking libgssapi3-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Selecting previously unselected package libsasl2-modules-db:amd64. Preparing to unpack .../libsasl2-modules-db_2.1.26.dfsg1-14ubuntu0.2_amd64.deb ... Unpacking libsasl2-modules-db:amd64 (2.1.26.dfsg1-14ubuntu0.2) ... Selecting previously unselected package libsasl2-2:amd64. Preparing to unpack .../libsasl2-2_2.1.26.dfsg1-14ubuntu0.2_amd64.deb ... Unpacking libsasl2-2:amd64 (2.1.26.dfsg1-14ubuntu0.2) ... Selecting previously unselected package libldap-2.4-2:amd64. Preparing to unpack .../libldap-2.4-2_2.4.42+dfsg-2ubuntu3.9_amd64.deb ... Unpacking libldap-2.4-2:amd64 (2.4.42+dfsg-2ubuntu3.9) ... Selecting previously unselected package librtmp1:amd64. Preparing to unpack .../librtmp1_2.4+20151223.gitfa8646d-1ubuntu0.1_amd64.deb ... Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d-1ubuntu0.1) ... Selecting previously unselected package libcurl3-gnutls:amd64. Preparing to unpack .../libcurl3-gnutls_7.47.0-1ubuntu2.16_amd64.deb ... Unpacking libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.16) ... Selecting previously unselected package libdbus-glib-1-2:amd64. Preparing to unpack .../libdbus-glib-1-2_0.106-1_amd64.deb ... Unpacking libdbus-glib-1-2:amd64 (0.106-1) ... Selecting previously unselected package libglib2.0-data. Preparing to unpack .../libglib2.0-data_2.48.2-0ubuntu4.6_all.deb ... Unpacking libglib2.0-data (2.48.2-0ubuntu4.6) ... Selecting previously unselected package libicu55:amd64. Preparing to unpack .../libicu55_55.1-7ubuntu0.5_amd64.deb ... Unpacking libicu55:amd64 (55.1-7ubuntu0.5) ... Selecting previously unselected package libsasl2-modules:amd64. Preparing to unpack .../libsasl2-modules_2.1.26.dfsg1-14ubuntu0.2_amd64.deb ... Unpacking libsasl2-modules:amd64 (2.1.26.dfsg1-14ubuntu0.2) ... Selecting previously unselected package libxml2:amd64. Preparing to unpack .../libxml2_2.9.3+dfsg1-1ubuntu0.7_amd64.deb ... Unpacking libxml2:amd64 (2.9.3+dfsg1-1ubuntu0.7) ... Selecting previously unselected package powermgmt-base. Preparing to unpack .../powermgmt-base_1.31+nmu1_all.deb ... Unpacking powermgmt-base (1.31+nmu1) ... Selecting previously unselected package python-apt-common. Preparing to unpack .../python-apt-common_1.1.0~beta1ubuntu0.16.04.9_all.deb ... Unpacking python-apt-common (1.1.0~beta1ubuntu0.16.04.9) ... Selecting previously unselected package python3-apt. Preparing to unpack .../python3-apt_1.1.0~beta1ubuntu0.16.04.9_amd64.deb ... Unpacking python3-apt (1.1.0~beta1ubuntu0.16.04.9) ... Selecting previously unselected package python3-dbus. Preparing to unpack .../python3-dbus_1.2.0-3_amd64.deb ... Unpacking python3-dbus (1.2.0-3) ... Selecting previously unselected package python3-gi. Preparing to unpack .../python3-gi_3.20.0-0ubuntu1_amd64.deb ... Unpacking python3-gi (3.20.0-0ubuntu1) ... Selecting previously unselected package shared-mime-info. Preparing to unpack .../shared-mime-info_1.5-2ubuntu0.2_amd64.deb ... Unpacking shared-mime-info (1.5-2ubuntu0.2) ... Selecting previously unselected package xdg-user-dirs. Preparing to unpack .../xdg-user-dirs_0.15-2ubuntu6.16.04.1_amd64.deb ... Unpacking xdg-user-dirs (0.15-2ubuntu6.16.04.1) ... Selecting previously unselected package xml-core. Preparing to unpack .../xml-core_0.13+nmu2_all.deb ... Unpacking xml-core (0.13+nmu2) ... Selecting previously unselected package python-apt. Preparing to unpack .../python-apt_1.1.0~beta1ubuntu0.16.04.9_amd64.deb ... Unpacking python-apt (1.1.0~beta1ubuntu0.16.04.9) ... Selecting previously unselected package python-pycurl. Preparing to unpack .../python-pycurl_7.43.0-1ubuntu1_amd64.deb ... Unpacking python-pycurl (7.43.0-1ubuntu1) ... Selecting previously unselected package python-software-properties. Preparing to unpack .../python-software-properties_0.96.20.10_all.deb ... Unpacking python-software-properties (0.96.20.10) ... Selecting previously unselected package xz-utils. Preparing to unpack .../xz-utils_5.1.1alpha+20120614-2ubuntu2_amd64.deb ... Unpacking xz-utils (5.1.1alpha+20120614-2ubuntu2) ... Selecting previously unselected package unattended-upgrades. Preparing to unpack .../unattended-upgrades_1.1ubuntu1.18.04.7~16.04.6_all.deb ... Unpacking unattended-upgrades (1.1ubuntu1.18.04.7~16.04.6) ... Processing triggers for libc-bin (2.23-0ubuntu11.2) ... Processing triggers for systemd (229-4ubuntu21.29) ... Setting up cron (3.0pl1-128ubuntu2) ... Adding group `crontab' (GID 106) ... Done. update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults update-rc.d: warning: stop runlevel arguments (1) do not match cron Default-Stop values (none) invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of start. Setting up mime-support (3.59ubuntu1) ... Setting up libmpdec2:amd64 (2.4.2-1) ... Setting up libsqlite3-0:amd64 (3.11.0-1ubuntu1.5) ... Setting up libpython3.5-stdlib:amd64 (3.5.2-2ubuntu0~16.04.12) ... Setting up python3.5 (3.5.2-2ubuntu0~16.04.12) ... Setting up libpython3-stdlib:amd64 (3.5.1-3) ... Setting up libffi6:amd64 (3.2.1-4) ... Setting up libglib2.0-0:amd64 (2.48.2-0ubuntu4.6) ... No schema files found: doing nothing. Setting up sgml-base (1.26+nmu4ubuntu1) ... Setting up libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.13) ... Setting up python2.7 (2.7.12-1ubuntu0~16.04.13) ... Setting up libpython-stdlib:amd64 (2.7.12-1~16.04) ... Setting up python (2.7.12-1~16.04) ... Setting up distro-info-data (0.28ubuntu0.14) ... Setting up libmagic1:amd64 (1:5.25-2ubuntu1.4) ... Setting up file (1:5.25-2ubuntu1.4) ... Setting up libapt-inst2.0:amd64 (1.2.32ubuntu0.1) ... Setting up libgmp10:amd64 (2:6.1.0+dfsg-2) ... Setting up libnettle6:amd64 (3.2-1ubuntu0.16.04.1) ... Setting up libhogweed4:amd64 (3.2-1ubuntu0.16.04.1) ... Setting up libidn11:amd64 (1.32-3ubuntu1.2) ... Setting up libp11-kit0:amd64 (0.23.2-5~ubuntu16.04.1) ... Setting up libtasn1-6:amd64 (4.7-3ubuntu0.16.04.3) ... Setting up libgnutls30:amd64 (3.4.10-4ubuntu1.8) ... Setting up ucf (3.0036) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Setting up openssl (1.0.2g-1ubuntu4.17) ... Setting up ca-certificates (20190110~16.04.1) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Setting up libcap-ng0:amd64 (0.7.7-1) ... Setting up libdbus-1-3:amd64 (1.10.6-1ubuntu3.6) ... Setting up dbus (1.10.6-1ubuntu3.6) ... Setting up libgirepository-1.0-1:amd64 (1.46.0-3ubuntu1) ... Setting up gir1.2-glib-2.0:amd64 (1.46.0-3ubuntu1) ... Setting up iso-codes (3.65-1) ... Setting up krb5-locales (1.13.2+dfsg-5ubuntu2.1) ... Setting up libroken18-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libasn1-8-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libkrb5support0:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Setting up libk5crypto3:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Setting up libkeyutils1:amd64 (1.5.9-8ubuntu1) ... Setting up libkrb5-3:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Setting up libgssapi-krb5-2:amd64 (1.13.2+dfsg-5ubuntu2.1) ... Setting up libhcrypto4-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libheimbase1-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libwind0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libhx509-5-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libkrb5-26-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libheimntlm0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libgssapi3-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ... Setting up libsasl2-modules-db:amd64 (2.1.26.dfsg1-14ubuntu0.2) ... Setting up libsasl2-2:amd64 (2.1.26.dfsg1-14ubuntu0.2) ... Setting up libldap-2.4-2:amd64 (2.4.42+dfsg-2ubuntu3.9) ... Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d-1ubuntu0.1) ... Setting up libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.16) ... Setting up libdbus-glib-1-2:amd64 (0.106-1) ... Setting up libglib2.0-data (2.48.2-0ubuntu4.6) ... Setting up libicu55:amd64 (55.1-7ubuntu0.5) ... Setting up libsasl2-modules:amd64 (2.1.26.dfsg1-14ubuntu0.2) ... Setting up libxml2:amd64 (2.9.3+dfsg1-1ubuntu0.7) ... Setting up powermgmt-base (1.31+nmu1) ... Setting up python-apt-common (1.1.0~beta1ubuntu0.16.04.9) ... Setting up shared-mime-info (1.5-2ubuntu0.2) ... Setting up xdg-user-dirs (0.15-2ubuntu6.16.04.1) ... Setting up xml-core (0.13+nmu2) ... Setting up python-apt (1.1.0~beta1ubuntu0.16.04.9) ... Setting up python-pycurl (7.43.0-1ubuntu1) ... Setting up xz-utils (5.1.1alpha+20120614-2ubuntu2) ... update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode Setting up dh-python (2.20151103ubuntu1.2) ... Setting up python3 (3.5.1-3) ... running python rtupdate hooks for python3.5... running python post-rtupdate hooks for python3.5... Setting up lsb-release (9.20160110ubuntu0.2) ... Setting up python3-apt (1.1.0~beta1ubuntu0.16.04.9) ... Setting up python3-dbus (1.2.0-3) ... Setting up python3-gi (3.20.0-0ubuntu1) ... Setting up python-software-properties (0.96.20.10) ... Setting up unattended-upgrades (1.1ubuntu1.18.04.7~16.04.6) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version Processing triggers for systemd (229-4ubuntu21.29) ... Processing triggers for libc-bin (2.23-0ubuntu11.2) ... Processing triggers for ca-certificates (20190110~16.04.1) ... Updating certificates in /etc/ssl/certs... 127 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Processing triggers for sgml-base (1.26+nmu4ubuntu1) ... Removing intermediate container b4f5db0d4277 ---> be37f3d13c47 Step 4/11 : RUN apt-get install -y software-properties-common ---> Running in 5dd065b5642f Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed: python3-pycurl python3-software-properties Suggested packages: libcurl4-gnutls-dev python-pycurl-doc python3-pycurl-dbg The following NEW packages will be installed: python3-pycurl python3-software-properties software-properties-common 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 72.0 kB of archives. After this operation, 483 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 python3-pycurl amd64 7.43.0-1ubuntu1 [42.3 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3-software-properties all 0.96.20.10 [20.2 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 software-properties-common all 0.96.20.10 [9504 B] debconf: delaying package configuration, since apt-utils is not installed Fetched 72.0 kB in 1s (51.3 kB/s) Selecting previously unselected package python3-pycurl. (Reading database ... 8408 files and directories currently installed.) Preparing to unpack .../python3-pycurl_7.43.0-1ubuntu1_amd64.deb ... Unpacking python3-pycurl (7.43.0-1ubuntu1) ... Selecting previously unselected package python3-software-properties. Preparing to unpack .../python3-software-properties_0.96.20.10_all.deb ... Unpacking python3-software-properties (0.96.20.10) ... Selecting previously unselected package software-properties-common. Preparing to unpack .../software-properties-common_0.96.20.10_all.deb ... Unpacking software-properties-common (0.96.20.10) ... Processing triggers for dbus (1.10.6-1ubuntu3.6) ... Setting up python3-pycurl (7.43.0-1ubuntu1) ... Setting up python3-software-properties (0.96.20.10) ... Setting up software-properties-common (0.96.20.10) ... Processing triggers for dbus (1.10.6-1ubuntu3.6) ... Removing intermediate container 5dd065b5642f ---> 02ea2f860a4d Step 5/11 : RUN add-apt-repository ppa:bitcoin/bitcoin ---> Running in e0f89744d2f0 NOT MAINTAINED. The OS-library linking packages here had a series of issues. PLEASE DOWNLOAD DIRECTLY FROM bitcoincore.org (and verify the signatures of said files). IF YOU WANT AUTO-UPDATES, please see the officially-maintained snap package - https://github.com/bitcoin-core/packaging/tree/master/snap More info: https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin gpg: keyring `/tmp/tmphrg15vnm/secring.gpg' created gpg: keyring `/tmp/tmphrg15vnm/pubring.gpg' created gpg: requesting key 8842CE5E from hkp server keyserver.ubuntu.com gpg: /tmp/tmphrg15vnm/trustdb.gpg: trustdb created gpg: key 8842CE5E: public key "Launchpad PPA for Bitcoin" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK Removing intermediate container e0f89744d2f0 ---> b81c0b64d050 Step 6/11 : RUN apt-get update -y ---> Running in f5e3ffb92318 Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial InRelease [17.5 kB] Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease Get:5 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial/main amd64 Packages [2169 B] Hit:6 http://security.ubuntu.com/ubuntu xenial-security InRelease Fetched 19.7 kB in 5s (3527 B/s) Reading package lists... Removing intermediate container f5e3ffb92318 ---> f9d21b3c9e07 Step 7/11 : RUN apt-get install -y bitcoind ---> Running in afb933e1ded8 Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package bitcoind ERROR: Service 'daemon_one' failed to build : The command '/bin/sh -c apt-get install -y bitcoind' returned a non-zero code: 100 C:\Users\ebata\bitcoin> 

RUN add-apt-repository ppa:bitcoin/bitcoin を ppa:luke-jr/bitcoincore に変更してみたら、Dockerfileが通った

 

 

ターミナルを開いて、コンテナに入ります。
docker exec -it bitcoin_1 /bin/bash
 root@bitcoin_1:/# bitcoind -daemon Bitcoin Core starting root@bitcoin_1:/# bitcoin-cli generate 100 error code: -32601 error message: Method not found

あれ?

bitcoin-cli getinfoで確認出来るって書いてたけど、もう無くなったAPIになっちゃてたみたい

This command doesn't exist anymore since Bitcoin Core 0.19. Use generatetoaddress instead. てなことが記載されている。

ここを読んでみると、

Generate 11 blocks to myaddress
> bitcoin-cli generatetoaddress 11 "myaddress"
If you are running the bitcoin core wallet, you can get a new address to send the newly generated bitcoin to with:
> bitcoin-cli getnewaddress

てな記載がある。

とにかくブロックを作らんことには、金(ビットコイン)が稼げないが、上記の"myaddress"が何ならよう分からん。

ここ の記事にある、bitcoin-cli generatetoaddress 101 `bitcoin-cli getnewaddress`

をやってもいいものなのか?

ちなみに、bitcoin-cli getnewaddress を実行すると、

root@bitcoin_1:/# bitcoin-cli getnewaddress
bcrt1qymag0kvldyw4saejksnssv92ss3awrkp5vz6ef

てな内容が出てくる(アドレス、モロばれだけど、実際の環境では使わないからいいかな)

で、やってみた。

root@bitcoin_1:/# bitcoin-cli generatetoaddress 101 `bitcoin-cli getnewaddress`
[
"4177f527560e47a246ab9c00e88c4255b3b7acc7772ac8f691e2444977005a7e",
"2a5d403754cea5be3dcbead230b24887209c0832b4adbc39deb5c94b9fe02b08",
"56ace4b11685e895b14476863b649996cf0a2be7d99ba90487baebc6f1469f1a",
"4a52e7133141ec90278cfa960db52865b0ae26383d4d54faba1a3011054f82f0",
"5231d7dfcc5a7de895294b4caaae234949179d1978fb08f7c4bea2d460092616",
"165e2c7989a2e7392f573769a7abfda4f0ea31a7cbf6ade5189fc82d605aafe9",
"2c581e76e8bf6441a1a9b9f4f79bb8ec2eb51fcfdc866c2e555bab9a4c6ca286",
"7fed803ad55e2aa646ee49acb903cd82092b73f4486e592493b9733ed2747c2d",
"2f74ea1621a8016f0c726e84710f2b6a8960872e6a384c7a718d31b989f4ccbc",
"0db3f0879ad15be05ae2d345bd68d944c1014b95019e9797c99239346a860ca7",
"62f22bf9f9a37398fb0d05ec02b3dd07484cb82f24a6a0e6e3044f8d0f609138",
"228d3b9a56f3c3553cd828b9dfa0a7d26ad212625d303fe37026432685e9ca8c",
"2bc79a882222d359833d6d502823d18d822cf73389b82f2f91a470e8aa959202",
"1a218e6d2d25f9f4b11a487c596c8550da93dcc9be8588de25b2d6fbfc28d401",
"66bc748557187e1a899e0d1fda8b763344c504124e9e30583facd42d6a711778",
"3ec3631019a691f4da89c29563bef83e82b4da50b552bc17605353c626f991d8",
"03006db53a078364eda8462ad6f33dfe2fb7cb7dc4cbb80f2306887cd02eca07",
"3a3ba0070d431abdce94a894bd88cb436af44cf8841c66e2fd6bbac95d70f06d",
"0b57e21ad6c9f25a95b32cc7e2ccfe5a290d522060dd259312790037de31d64b",
"604ae4c582c4c3fdc8ca8f3ee2bf43ebf6f80b8f4f565d9133e49b4e83cd3d4b",
"31429fef4d34dad0d0dd6ab5da9ba02e363b5b36f63399b9ccd5fd04294a4b32",
"19723216344b0b02e696700d7a96bb343dc7c31b318f87bdc5b5d012794a6ed9",
"4d998f07124795428c6b99749efcfd93df0bbaf6c266d7935c312ad74a86ce0a",
"2448217b611b82631ef8cd3aaf3f5b54237f39092dd4e24dd62b6420cb2224d7",
"41c938ece2f9dcacd7261f90a400646a90d026d545fe9d05cf0fd5d2ff599240",
"50fc0af9714ebbaedb692132895405ce3272e928de96472a1fb9bf9d41e21bcf",
"77348b3afa398920d3e9c4c4c73f9bdae2c9ba2325f91f8229f2d5329abc6067",
"064f502414991675fd0eafdbc013fa437108bf641cdcae6f90d4ceacc4780c8d",
"66291c94d0ba5da56f80ae3c6e0cbf9b8094845239125a0f8211c6c76fee0e66",
"66900f87b1b4a32bff9c46100800ae5e6c42cc407515d5c2d09eca46877c71cf",
"1f6f13ec5cca4a8f00fd7436c1d25d8f9841f2fa51e91857291b6ee5274aa962",
"0423406749eb449c0c94b8d3766555038c6dadda04c4ff0d4e73427df1017b03",
"033a07ca40f30768424cfc10b88d13c0a9750eb898dbdebc5e28d4dcbeab2577",
"4fd38f4eeb9a0201bf08b47765e6179b43aa1a0d6f18677d6af3e4593d4b6ae2",
"41158030deaf4caf1ce37b919e788d168bcdd0ec2f5a28842368e21bfc30c645",
"1af821dd38d22c0d855522635c9089bf0d5ff962d87026e8367458af3b30ac09",
"5ef03f6423957f46adee2fcc957d287418885650057fb1d90a278f7ecbbc4bf0",
"03ec5fef2f98eb7ed818e87d2d95225918523b71625479cba7c78a6280f68660",
"4a4bd1f23ebd6ae5ca9fab7ae2c775c964d061178b355e576e736faaae85d8c7",
"58d3d30078bae0a899d6b7a816283643e09994f7548f5ba53191f0465094042a",
"57e822309588a318f4a7294bf525ec99fb7fd34f9b7a77761de0b58a25b8fc18",
"2994a3bea7669ce10a317686b878be2e84784446e3ad6c455de1f763f903fa44",
"70c80bc118ae9c238ec4a16a068555391efb9cf8b8bf19b14a83f8e6347ac75a",
"3109660d42242062667335463a473d285260e93ec725d442611e71eaf6eb4647",
"6463e5937deea0ec5c7a0e333b78726831440f7da499d27278803483f1b7b159",
"0750647a6e537758065b7ab13955bbe771841c950eceaf84c3b8494f3ef120b2",
"7f73b6998c3f11b3960da9c20828e74085410e37c69efd64779d0672310088b4",
"167f911d6192f5387009dfcc684fd5c882b5bd3be38ee01a918ef5ce89fb36bc",
"12e8937f16ede3cae67f73cefe764bc79aeecf61113d20fc3156d422c338c30c",
"41c9f793360a87528a7b3de4e51f33e6a466c57c11f7760676edb33ebc6a9f7e",
"33a3e607e53b402d68ac2bfd4e829c4c4f741869da4468dbe03a0a2d98f291c4",
"33cac25e7ec93ee93e8f2a95276a808100dcc941242326cb176278415c345ed8",
"6a979424fa152e5996762965189804cd2946c208e1ed68697d3ec8fcdeb2002b",
"411a9f258bf9b7fa455de052c1e80c254d3cf59f545b433c129b3592188e5d09",
"057c705b1556d45eb98e6cc586c9118e2baffeb542ec6943d8a237392c8d4316",
"7ea3a47ae7fa7c57ac80f223964290f132d887e7f6f66c49fda67180da1f4ec5",
"0947a3a9ac627fa3b04c6828c0af9e62ec5bfd506d52c1d5e049b2e677341597",
"4b2b755ba0446662de1a28357bf841007d2e0701f77667170ebe3afc081cf2f8",
"6be55f71c3f4e71467ae0a74b67c298c0caa0c889efbabcc67762f92aaff03c8",
"283a7855e14de3919395ec717b692c3cd990b278d2d5c90699acc85eaa49757a",
"14ac5a3afaca4492060d3dbea2474e918127acb59d4bf2e514e6f384eb0fa53c",
"05c397cd9cdda0f359fd4e915067bf11b195e5d3dc1a5aea34bd64ebdd26f1d5",
"280933eba56163feaf275c0bc2e3b81048539d34788ec22090313518e8aca1b9",
"29c3a23724fc07ced98367affb0f7def6cbb2cfe4fe3289c91bfcbb1d9062884",
"1a8f2665107c50442d01ec3c3b9dead73a7237f3414d7fa438415e78509cb53e",
"436a7fac474736aed85dc7d4e312b9fdfffc6a53b7e19422f478268cb20eb424",
"1f39a851008729db5d7c0aba7888d8ccba06ac847bc4542095e03f574b70eb4e",
"15cfd6f53704ca6e4de027cab4a25149e6a04b8ce03fba4289cb5b9cdb6f9a59",
"650de6dd79484716987c42410a465d5dfa54b2a99fc7d603723df5607e4e20dd",
"1cfeedc95e1acd9cffcb26b0483884134f40d5a283d937b7b43c16b614892931",
"4ea1e49e8a3b717fee3deaf7ba3ee14274d32f9c4a98d02bbb18da2f0cdafde7",
"6d0b95389dcb352a78eab47f9ceabdcd4f9bd3ea589f737bc313bcf24a8b0486",
"4f763813798b72049943d6614a516d37d407e3eaba6779e41bf1ac538350bdab",
"0de431dcee2bbd808a54d1acab883ed5496dc8ccc1d363540ff3ce440f304c43",
"4a199b4331a5fc6a27b8d3a2876e97554aa7113fc0eb667c0c147abeea9b9e1d",
"75f6ba9f84c88b9878ed7b3df63b6c1586be6fce2b5b9f4cd5595343b831651d",
"4f65083dd5077f084e0e4a588ea59207a4a712eec902e31d33c2d4965a80c1a1",
"2987e28e6b7b2383ac206726c4a9ca07a4e4f705fb12adcdfe10cfdcff565d3a",
"3fc9fdd7270744fff4285498c8a7f8619fb8ec89f827a462045ce8c3a8583b02",
"068ab89a648e1e9da4636a63a1a1ff5edea123a4f21667281f58ee7b3f43fccd",
"4df5562e0874f9a4253107f798f5d177640ab44d161b5c0d4fcdfe935e7cc009",
"59e86db93218d2aa4b07105dcd6edd07d2dd85152662a261af1f47d2aac042cc",
"0b15af3d8d1b08b3bde093e85078dffa754a5924c79085c4be1c91a713fe8062",
"00bb8022cea7cf517c41b95db0250e3389f02c2f034dd0e21cf441b35f256db4",
"25c7bad69581eb1c673693c9b5ecea34fd3981292badb90c41fa6fcff925dbac",
"4830bf3b369b0ba3975ab08b3fff07b9546c8fda6e2b7e55f305b8381f18fd6e",
"39855405738ed795c9f23cf933ac66e0b04ebabe50f28e102cd659166f9c7ff0",
"276797adb3a45042cb357525c7bb2053af26f97b158078d87f4965174a61456e",
"3ae64d52d4e9e80c072685e88cfb576c992e49a9f3808c1cee29279bff8fc90d",
"608ae941f8351e5e8bdc936d84009a0d93b79f82afaa69512cb41d4b6b13b2b6",
"20ed7ebbf55105697c6754440f1ffb68f796046b5e9bf9a5bf13fe12b762b915",
"318988c1b686efe428b3d4d9f711f26654a506007a30013d1946f01d3b21a1dd",
"00920ebf768761a74b9c6a89f3a16bbf5fc1cbea6f4c8af17eb3d7bdc1db45be",
"2f547f083680726977aa47a64303fd2fcf88c63e9ab6c0d983aab4e55dfa4011",
"2bfc89a56cec028ef08612e5a700b475baf73eb1d7404e3d4e18d22d0fb84871",
"67ee0490dde106367d715f5dedc13fa9a365b6551edeba1187f2fac260c91840",
"2ab1cff953dc2fecb4647bead68bdf8f27670e55989234ac77be1387437ad04e",
"699a01f27c9f4071ef5fa1db01ecee0b1cea4d717e936f5a689d90b82b40797c",
"50851ed32add0fa33db1b4f665ca8132f2109966811aff6a3b8f7f1d103d6165",
"25cc07422e00d859504bf4f7e072e9550d176860b5217c823cea5e93aef788c4",
"7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37"
]
root@bitcoin_1:/#

うん、なんかブロックできたみたいだ。

root@bitcoin_1:/# bitcoin-cli getblockcount
500

うん、できている。では金額を確認してみよう。

root@bitcoin_1:/# bitcoin-cli getbalance
50.00000000

おお! 凄い。今1BTCが120万円くらいだから、6000万円を作ってしまったぞ! 

では、ここで口座(アカウント)を作ってみよう。

bitcoin-cli getnewaddress testuser1
bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6

でもって、残高を調べるけど・・・

root@bitcoin_1:/# bitcoin-cli getnewaddress testuser1
bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6
root@bitcoin_1:/# bitcoin-cli getbalance testuser1
error code: -32
error message:
dummy first argument must be excluded or set to "*".
root@bitcoin_1:/# bitcoin-cli getbalance *
error: Error parsing JSON:boot
root@bitcoin_1:/# bitcoin-cli getbalance bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6
error code: -32
error message:
dummy first argument must be excluded or set to "*".
root@bitcoin_1:/# bitcoin-cli -regtest getbalance bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6
error code: -32
error message:
dummy first argument must be excluded or set to "*".
root@bitcoin_1:/# bitcoin-cli getbalance bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6
error code: -32
error message:
dummy first argument must be excluded or set to "*".
root@bitcoin_1:/# bitcoin-cli getbalance "*"
12462.50000000
root@bitcoin_1:/# bitcoin-cli getbalance "testuser1"
error code: -32
error message:
dummy first argument must be excluded or set to "*".
root@bitcoin_1:/# bitcoin-cli getbalance "bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6"
error code: -32
error message:
dummy first argument must be excluded or set to "*".
root@bitcoin_1:/#

あれー? 上手く表示されないなぁ。

この当たりを探ってみる。

root@bitcoin_1:/# bitcoin-cli listaddressgroupings
[
  [
    [
      "bcrt1q37qd0chv7he5epgeaycm236zke2kx37esh2we0",
      12462.50000000,
      ""
    ]
  ]
] 二人目のユーザ(アドレス:bcrt1qhzknya5w4qcyxnq0lkcwumu9py2c624ujv79f6)がいない
C:\Users\ebata\bitcoin>docker exec -it bitcoin_1 /bin/bash
root@bitcoin_1:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@bitcoin_1:/#
root@bitcoin_1:/#
root@bitcoin_1:/#
root@bitcoin_1:/#
root@bitcoin_1:/#
root@bitcoin_1:/#
root@bitcoin_1:/# bitcoin-cli getbalance
50.00000000
root@bitcoin_1:/# bitcoin-cli getbalance "*"
50.00000000
root@bitcoin_1:/# bitcoin-cli getblockchaininfo
{
  "chain": "regtest",
  "blocks": 101,
  "headers": 101,
  "bestblockhash": "7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37",
  "difficulty": 4.656542373906925e-10,
  "mediantime": 1602937028,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "chainwork": "00000000000000000000000000000000000000000000000000000000000000cc",
  "size_on_disk": 30476,
  "pruned": false,
  "softforks": {
    "bip34": {
      "type": "buried",
      "active": false,
      "height": 500
    },
    "bip66": {
      "type": "buried",
      "active": false,
      "height": 1251
    },
    "bip65": {
      "type": "buried",
      "active": false,
      "height": 1351
    },
    "csv": {
      "type": "buried",
      "active": false,
      "height": 432
    },
    "segwit": {
      "type": "buried",
      "active": true,
      "height": 0
    },
    "testdummy": {
      "type": "bip9",
      "bip9": {
        "status": "defined",
        "start_time": 0,
        "timeout": 9223372036854775807,
        "since": 0
      },
      "active": false
    }
  },
  "warnings": ""
}
root@bitcoin_1:/# bitcoin-cli getconnectioncount
0
root@bitcoin_1:/# bitcoin-cli getpeerinfo
[
]
root@bitcoin_1:/# bitcoin-cli getnewaddress
bcrt1qa5wzz2pw85f670fsaqpg26thtddeh5dw6u33he

root@bitcoin_1:/# bitcoin-cli listtransactions
[
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 10,
    "generated": true,
    "blockhash": "318988c1b686efe428b3d4d9f711f26654a506007a30013d1946f01d3b21a1dd",
    "blockheight": 92,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "ad130241f06c44b88135b1847f8775ebccb73e849caa60bfe9e5db9a7588149b",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 9,
    "generated": true,
    "blockhash": "00920ebf768761a74b9c6a89f3a16bbf5fc1cbea6f4c8af17eb3d7bdc1db45be",
    "blockheight": 93,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "4c2c637433cd55d7809ba3ae842abf91dc3f2795bfad11cd056ac84b13d48b3d",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 8,
    "generated": true,
    "blockhash": "2f547f083680726977aa47a64303fd2fcf88c63e9ab6c0d983aab4e55dfa4011",
    "blockheight": 94,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "25e3578b8da9bc72acef85203d74bc1068bbd5b0f9e0611c07d9876a0cf85e56",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 7,
    "generated": true,
    "blockhash": "2bfc89a56cec028ef08612e5a700b475baf73eb1d7404e3d4e18d22d0fb84871",
    "blockheight": 95,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "c8c75936d15030b0090dd10b2ed8d650d1fa7657c4fcc379aa9c9642eb626b04",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 6,
    "generated": true,
    "blockhash": "67ee0490dde106367d715f5dedc13fa9a365b6551edeba1187f2fac260c91840",
    "blockheight": 96,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "c5f3031c90d5df19667019666d2cb994aaf8202d76b980f0f2a8f3c143ad353a",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 5,
    "generated": true,
    "blockhash": "2ab1cff953dc2fecb4647bead68bdf8f27670e55989234ac77be1387437ad04e",
    "blockheight": 97,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "53fa062b9e0be60e9263e048e941759f09d820b02b1a9352d3ce64bf157c3545",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 4,
    "generated": true,
    "blockhash": "699a01f27c9f4071ef5fa1db01ecee0b1cea4d717e936f5a689d90b82b40797c",
    "blockheight": 98,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "ee516eabe679ae6e54af57180deff4d91ce51c277c74e1b08618a5da56704242",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 3,
    "generated": true,
    "blockhash": "50851ed32add0fa33db1b4f665ca8132f2109966811aff6a3b8f7f1d103d6165",
    "blockheight": 99,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "896f89d0db10a0a1b00bc0bda0e774fa8e46c20d539739b8f59df1adbb358b8f",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 2,
    "generated": true,
    "blockhash": "25cc07422e00d859504bf4f7e072e9550d176860b5217c823cea5e93aef788c4",
    "blockheight": 100,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "47986d3580f9b9e1168f4e16cd78decf982ff7b1f75417025d69689eeb3bd9fd",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 1,
    "generated": true,
    "blockhash": "7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37",
    "blockheight": 101,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "f759b7afcf00a9d037e37193a3d74f8e91250ceef46a8d260fc66c304aa6dc86",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  }
]

root@bitcoin_1:/# bitcoin-cli getpeerinfo
[
]
root@bitcoin_1:/# bitcoin-cli listtransactions
[
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 10,
    "generated": true,
    "blockhash": "318988c1b686efe428b3d4d9f711f26654a506007a30013d1946f01d3b21a1dd",
    "blockheight": 92,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "ad130241f06c44b88135b1847f8775ebccb73e849caa60bfe9e5db9a7588149b",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 9,
    "generated": true,
    "blockhash": "00920ebf768761a74b9c6a89f3a16bbf5fc1cbea6f4c8af17eb3d7bdc1db45be",
    "blockheight": 93,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "4c2c637433cd55d7809ba3ae842abf91dc3f2795bfad11cd056ac84b13d48b3d",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 8,
    "generated": true,
    "blockhash": "2f547f083680726977aa47a64303fd2fcf88c63e9ab6c0d983aab4e55dfa4011",
    "blockheight": 94,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "25e3578b8da9bc72acef85203d74bc1068bbd5b0f9e0611c07d9876a0cf85e56",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 7,
    "generated": true,
    "blockhash": "2bfc89a56cec028ef08612e5a700b475baf73eb1d7404e3d4e18d22d0fb84871",
    "blockheight": 95,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "c8c75936d15030b0090dd10b2ed8d650d1fa7657c4fcc379aa9c9642eb626b04",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 6,
    "generated": true,
    "blockhash": "67ee0490dde106367d715f5dedc13fa9a365b6551edeba1187f2fac260c91840",
    "blockheight": 96,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "c5f3031c90d5df19667019666d2cb994aaf8202d76b980f0f2a8f3c143ad353a",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 5,
    "generated": true,
    "blockhash": "2ab1cff953dc2fecb4647bead68bdf8f27670e55989234ac77be1387437ad04e",
    "blockheight": 97,
    "blockindex": 0,
    "blocktime": 1602937028,
    "txid": "53fa062b9e0be60e9263e048e941759f09d820b02b1a9352d3ce64bf157c3545",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 4,
    "generated": true,
    "blockhash": "699a01f27c9f4071ef5fa1db01ecee0b1cea4d717e936f5a689d90b82b40797c",
    "blockheight": 98,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "ee516eabe679ae6e54af57180deff4d91ce51c277c74e1b08618a5da56704242",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 3,
    "generated": true,
    "blockhash": "50851ed32add0fa33db1b4f665ca8132f2109966811aff6a3b8f7f1d103d6165",
    "blockheight": 99,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "896f89d0db10a0a1b00bc0bda0e774fa8e46c20d539739b8f59df1adbb358b8f",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 2,
    "generated": true,
    "blockhash": "25cc07422e00d859504bf4f7e072e9550d176860b5217c823cea5e93aef788c4",
    "blockheight": 100,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "47986d3580f9b9e1168f4e16cd78decf982ff7b1f75417025d69689eeb3bd9fd",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  },
  {
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 1,
    "generated": true,
    "blockhash": "7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37",
    "blockheight": 101,
    "blockindex": 0,
    "blocktime": 1602937029,
    "txid": "f759b7afcf00a9d037e37193a3d74f8e91250ceef46a8d260fc66c304aa6dc86",
    "walletconflicts": [
    ],
    "time": 1602937011,
    "timereceived": 1602937011,
    "bip125-replaceable": "no"
  }
]
root@bitcoin_1:/# bitcoin-cli getnewaddress
bcrt1qfleh8qu94p6ec98pkvdqutumt89slr8pfp67x6

root@bitcoin_1:/# bitcoin-cli getnewaddress tomoichi
bcrt1qlqvsucx8kgaz7nqytke7x5af0ggp8xhk30ynxe
root@bitcoin_1:/# bitcoin-cli getbalance
50.00000000
root@bitcoin_1:/# bitcoin-cli listunspent
[
  {
    "txid": "82a2f72c85876bc460d55002edbb5ef6ad160485da1ea56ee53294d2f30a7136",
    "vout": 0,
    "address": "bcrt1qm7a39u23klsnmp332nz7kez2nhndced6ht23y8",
    "label": "",
    "scriptPubKey": "0014dfbb12f151b7e13d863154c5eb644a9de6dc65ba",
    "amount": 50.00000000,
    "confirmations": 101,
    "spendable": true,
    "solvable": true,
    "desc": "wpkh([51903fd0/0'/0'/1']0324020359d38db9f89d1e75fe3a3406b5e66d806214141e0c0ba76b685d08ff4b)#y8d0fgk6",
    "safe": true
  }
]

root@bitcoin_1:/# bitcoind -version
Bitcoin Core version v0.20.1.0-g7ff64311bee570874c4f0dfa18f518552188df08
Copyright (C) 2009-2020 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>

root@bitcoin_1:/# bitcoin-cli -getinfo
{
  "version": 200100,
  "blocks": 101,
  "headers": 101,
  "verificationprogress": 1,
  "timeoffset": 0,
  "connections": 0,
  "proxy": "",
  "difficulty": 4.656542373906925e-10,
  "chain": "regtest",
  "balance": 50.00000000,
  "keypoolsize": 999,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "warnings": ""
}
root@bitcoin_1:/# bitcoin-cli getblockchaininfo
{
  "chain": "regtest",
  "blocks": 101,
  "headers": 101,
  "bestblockhash": "7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37",
  "difficulty": 4.656542373906925e-10,
  "mediantime": 1602937028,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "chainwork": "00000000000000000000000000000000000000000000000000000000000000cc",
  "size_on_disk": 30476,
  "pruned": false,
  "softforks": {
    "bip34": {
      "type": "buried",
      "active": false,
      "height": 500
    },
    "bip66": {
      "type": "buried",
      "active": false,
      "height": 1251
    },
    "bip65": {
      "type": "buried",
      "active": false,
      "height": 1351
    },
    "csv": {
      "type": "buried",
      "active": false,
      "height": 432
    },
    "segwit": {
      "type": "buried",
      "active": true,
      "height": 0
    },
    "testdummy": {
      "type": "bip9",
      "bip9": {
        "status": "defined",
        "start_time": 0,
        "timeout": 9223372036854775807,
        "since": 0
      },
      "active": false
    }
  },
  "warnings": ""
}

root@bitcoin_1:/# bitcoin-cli getblockhash 100
25cc07422e00d859504bf4f7e072e9550d176860b5217c823cea5e93aef788c4
root@bitcoin_1:/# bitcoin-cli getblock 25cc07422e00d859504bf4f7e072e9550d176860b5217c823cea5e93aef788c4
{
  "hash": "25cc07422e00d859504bf4f7e072e9550d176860b5217c823cea5e93aef788c4",
  "confirmations": 2,
  "strippedsize": 214,
  "size": 250,
  "weight": 892,
  "height": 100,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "47986d3580f9b9e1168f4e16cd78decf982ff7b1f75417025d69689eeb3bd9fd",
  "tx": [
    "47986d3580f9b9e1168f4e16cd78decf982ff7b1f75417025d69689eeb3bd9fd"
  ],
  "time": 1602937029,
  "mediantime": 1602937028,
  "nonce": 3,
  "bits": "207fffff",
  "difficulty": 4.656542373906925e-10,
  "chainwork": "00000000000000000000000000000000000000000000000000000000000000ca",
  "nTx": 1,
  "previousblockhash": "50851ed32add0fa33db1b4f665ca8132f2109966811aff6a3b8f7f1d103d6165",
  "nextblockhash": "7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37"
}
root@bitcoin_1:/# bitcoin-cli getblockcount
101
root@bitcoin_1:/# bitcoin-cli getbestblockhash
7114500ec4d179a09d609bde6cdf5d7c8f84920eca9d4f1efe102a3869591b37

root@bitcoin_1:/# bitcoin-cli getaddressesbylabel tomoichi
{
  "bcrt1qlqvsucx8kgaz7nqytke7x5af0ggp8xhk30ynxe": {
    "purpose": "receive"
  }
}

root@bitcoin_1:/# bitcoin-cli listlabels
[
  "",
  "tomoichi"
]
root@bitcoin_1:/#

2020/11,江端さんの技術メモ

2年前のコードをAWS Lightsailに乗せられないか、docker compose up -d  を試してみたところ、変なところでエラーが出てきた。

go build cmd/server/main.go

と打ち込んでみたら

というところで、引掛っていることが分かった。

原因をググってみた「メモリ不足」。

最低でも1G用意しろ、って書いてあった。

Amazon Lightsailの一番安いやつは、512MBだった。

まあ、今時、ノートPCだって、4G搭載しているからなー、これはないかなー 。

しかし、搭載を断念するのも残念だしなー、安全を考えると2GBは欲しいしなー ・・・でも、10ドル/月かぁ。

ちょっと考えよう。

Lightsail のインスタンスのスケールアップ

(後日談) 1MBのメモリを持つ、5$/月 の インスタンスにスケールアップして、docker compose up -d を通しました。

# いや、実装に成功していたラズパイのメモリが1GBだったので、多分大丈夫だろうと踏みました。

―― が、コンテナが起動していないので、ここからが勝負です。