6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

nem #2Advent Calendar 2020

Day 9

building catapult-server with conan

Last updated at Posted at 2020-12-08

パッケージマネージャconanを利用したcatapult-serverのビルド手順です。

ビルド前の準備を行っておけば、公式のマニュアルどおりにビルドができます。
https://github.com/nemtech/catapult-server/blob/main/docs/BUILD-conan.md

手動でも以下の手順でビルドはできますが、conanで実施したほうが簡単なので良いと思います。
building catapult-server from source
(公式でもconanでのビルドが推奨されています)

なお、今回の手順は2020年12月5日時点でのものですので、ご注意ください。

所要時間は約100分です。

特記事項

  • conanの設定を追記(2021/02/20)
  • ビルド時には結構メモリを食う。メモリ1GBだと無理、8GBで試した。
  • ディスクも食う。16GBだと無理。32GBで試した。
  • 2018年5月くらいに比べてビルドはずいぶん簡単になっている

環境(Amazon EC2)

  • Ubuntu Server 20.04 LTS (HVM), SSD Volume Type
    • t2.xlarge
    • vCPU 4
    • メモリ 16GB
    • ストレージ(SSD) 32GB

手順(インスタンス作成後)

以下手順です。

Step0 準備

sudo apt update
sudo apt -y upgrade
sudo apt -y install gcc g++ cmake libssl-dev ninja-build pkg-config
curl -kL https://bootstrap.pypa.io/get-pip.py | sudo python3
sudo PATH=/usr/local/bin:$PATH pip install conan

Step1 Install and build conan dependencies

conan profile new default --detect
conan profile update settings.compiler.libcxx=libstdc++11 default
conan remote add nemtech https://api.bintray.com/conan/nemtech/symbol-server-dependencies

git clone https://github.com/nemtech/catapult-server.git
cd catapult-server

mkdir _build && cd _build
conan install .. --build missing

Step 2 Build catapult-server

cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -G Ninja ..
ninja publish
ninja -j4

Step 3 確認

ls ./bin
bench.catapult.crypto.hashers                        tests.catapult.local.recovery
bench.catapult.crypto.verify                         tests.catapult.local.server
catapult.broker                                      tests.catapult.model
catapult.recovery                                    tests.catapult.mongo
catapult.server                                      tests.catapult.mongo.plugins.accountlink
catapult.tools.address                               tests.catapult.mongo.plugins.aggregate
catapult.tools.benchmark                             tests.catapult.mongo.plugins.lockhash
catapult.tools.health                                tests.catapult.mongo.plugins.locksecret
catapult.tools.linker                                tests.catapult.mongo.plugins.metadata
catapult.tools.nemgen                                tests.catapult.mongo.plugins.mosaic
catapult.tools.network                               tests.catapult.mongo.plugins.multisig
catapult.tools.ssl                                   tests.catapult.mongo.plugins.namespace
catapult.tools.statusgen                             tests.catapult.mongo.plugins.restrictionaccount
catapult.tools.testvectors                           tests.catapult.mongo.plugins.restrictionmosaic
catapult.tools.votingkey                             tests.catapult.mongo.plugins.transfer
tests.catapult.addressextraction                     tests.catapult.net
tests.catapult.api                                   tests.catapult.networkheight
tests.catapult.cache                                 tests.catapult.nodediscovery
tests.catapult.cache_core                            tests.catapult.observers
tests.catapult.cache_db                              tests.catapult.packetserver
tests.catapult.cache_tx                              tests.catapult.partialtransaction
tests.catapult.chain                                 tests.catapult.pluginhandlers
tests.catapult.config                                tests.catapult.plugins
tests.catapult.consumers                             tests.catapult.plugins.accountlink
tests.catapult.crypto                                tests.catapult.plugins.aggregate
tests.catapult.crypto_voting                         tests.catapult.plugins.coresystem
tests.catapult.deltaset                              tests.catapult.plugins.hashcache
tests.catapult.diagnostics                           tests.catapult.plugins.lockhash
tests.catapult.disruptor                             tests.catapult.plugins.locksecret
tests.catapult.extensions                            tests.catapult.plugins.metadata
tests.catapult.filespooling                          tests.catapult.plugins.mosaic
tests.catapult.finalization                          tests.catapult.plugins.multisig
tests.catapult.handlers                              tests.catapult.plugins.namespace
tests.catapult.harvesting                            tests.catapult.plugins.restrictionaccount
tests.catapult.hashcache                             tests.catapult.plugins.restrictionmosaic
tests.catapult.int.mongo                             tests.catapult.plugins.signature
tests.catapult.int.mongo.plugins.lockhash            tests.catapult.plugins.transfer
tests.catapult.int.mongo.plugins.locksecret          tests.catapult.sdk
tests.catapult.int.mongo.plugins.metadata            tests.catapult.state
tests.catapult.int.mongo.plugins.mosaic              tests.catapult.subscribers
tests.catapult.int.mongo.plugins.multisig            tests.catapult.sync
tests.catapult.int.mongo.plugins.namespace           tests.catapult.syncsource
tests.catapult.int.mongo.plugins.restrictionaccount  tests.catapult.thread
tests.catapult.int.mongo.plugins.restrictionmosaic   tests.catapult.timesync
tests.catapult.int.node                              tests.catapult.transactionsink
tests.catapult.int.node.stress                       tests.catapult.tree
tests.catapult.int.stress                            tests.catapult.unbondedpruning
tests.catapult.io                                    tests.catapult.utils
tests.catapult.ionet                                 tests.catapult.validators
tests.catapult.keylink                               tests.catapult.zeromq
tests.catapult.local.broker

以上。

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?