sbt clean coverage it:test coverageReport
Once generated, an html report can be found at target/scala-2.12/scoverage-report/index.html
When a new version of the libcore is available, we need to update our bindings.
| Prerequisite | Remarks | | ============================================== | ========================================= | | docker | Only needed if you plan to build in local | | sbt | |
-
Check out lib core project
git clone --recurse-submodules --depth 1 --branch <branch_or_version_tag> https://github.com/LedgerHQ/lib-ledger-core
-
Copy
build-jar.sh
andbuild-jar-linux.sh
to the lib core project foldercp $WALLET_DAEMON_FOLDER/build-jar.sh $LIB_CORE_FOLDER cp $WALLET_DAEMON_FOLDER/build-jar-linux.sh $LIB_CORE_FOLDER
-
cd
to lib core foldercd $LIB_CORE_FOLDER
-
Two possible situations: either you want a fresh build from your local machine, or you want to grab the official lib core artifacts.
- For building on your machine, run the script
build-jar.sh
with command:mac
,linux
orall
. MacOS can build bothmac
andlinux
. Linux can only buildlinux
.# Build for mac only. You may want to do this when developing, # it's much faster than build for both mac and linux bash build-jar.sh mac # Build for linux. Linux build is using docker. bash build-jar.sh linux # Build for both mac and linux bash build-jar.sh all
- For getting the official release, pass an extra argument
dl
to the command invocation.# Get only the mac release artifacts. ./build-jar.sh mac dl # Get only the linux artifacts. ./build-jar.sh linux dl # Get both. ./build-jar.sh all dl
- For building on your machine, run the script
-
Then, you find the jar file in
$LIB_CORE_FOLDER/../build-jar/target/scala-<version>/build-jar-<version>.jar
. Replace theledger-lib-core.jar
in the lib folder with this file.mv $LIB_CORE_FOLDER/../build-jar/target/scala-<version>/build-jar-<version>.jar $WALLET_DAEMON_FOLDER/lib/ledger-lib-core.jar
-
Push the changes to upstream
-
Add a tag on the new commit with the version of the ledger-core-lib, or the commit hash if no version was tagged
-
Make sure to have a PostgreSQL server running,
-
For integration tests make sure to create required databases, you could use the
db.sh
for that:./dbs.sh <host> <port>
To drop databases simply run:
./dbs.sh <host> <port> drop
-
For tests with users' databases (i.e.
database.db
created), please use, in an analogous way,client_dbs.sh
script.
-
By default, Wallet Daemon is using Sqlite3 by default, to activate PostgreSQL set:
CORE_DATABASE_ENGINE=postgres
-
Setting the PostgreSQL connection mandatory infos by setting :
CORE_PG_HOST
,CORE_PG_PORT
,CORE_PG_USER
andCORE_PG_PWD
which are respectively the hostname, the port exposed by postgres the user and the password to use for establishing the connection. We are supporting SSL connections. -
It is possible to set the connection pool size per wallet pool (e.g. by client) thanks to:
PG_CONNECTION_POOL_SIZE_PER_WALLET_POOL
, which is equal to2
by default and also a prefix name for every databases created by the libcore by settingCORE_PG_DB_NAME_PREFIX
example :CORE_PG_DB_NAME_PREFIX=WD_
Please have a look on Docker compose configuration file for more details on configuration. This will create a PostgreSql instance with SSL enabled and the latest development image of wallet daemon ready to talk with.
docker-compose up