First, ensure that you have libbson
and libmongocrypt
installed globally (requires wget
and cmake
):
# Installs libbson
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.14.0/mongo-c-driver-1.14.0.tar.gz
tar xzf mongo-c-driver-1.14.0.tar.gz
cd mongo-c-driver-1.14.0
mkdir cmake-build && cd cmake-build
cmake -DENABLE_MONGOC=OFF -DCMAKE_C_FLAGS="-fPIC" ../
make -j8 install
cd ../../
# Installs libmongocrypt
git clone git@github.com:10gen/libmongocrypt.git
cd libmongocrypt
mkdir cmake-build && cd cmake-build
cmake -DCMAKE_C_FLAGS="-fPIC" ../
make -j8 install
cd ../../
Now, you can run npm install
:
npm install
-
Ensure that you have
mongocryptd
running atlocalhost:27020
, and amongod
of version 4.2.0 running atlocalhost:27017
-
Save your AWS KMS credentials to a file named
env.sh
in the following format:#/usr/bin/bash export KMSKID="xxxxxxxxxxxxxxxxxxxx" export KMSKEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" export KMSARN="arn:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #
-
Run the following command
npm run demo