-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstaller.sh
60 lines (53 loc) · 2.6 KB
/
Installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------
# INSTALLATION
# ------------------------------------------------------------------
# Install OpenSSL (Optional)
cd ~
sudo yum install -y openssl
# Install and configure the QLDB Interactive Shell
wget https://github.com/awslabs/amazon-qldb-shell/releases/download/v2.0.1/qldb-v2.0.1-linux.tar.gz
tar -xvf ./qldb-v2.0.1-linux.tar.gz
cd qldb-v2.0.1-linux
# Create a configuration file that will make working with QLDB more convenient from Bash
mkdir ~/.config/qldbshell
cat <<EOT > ~/.config/qldbshell/config.ion
{
default_ledger: "SharedLedger",
ui: {
// format = [ion|table]
// ion: Prints the objects from the database as ION documents in text.
// table: Tabulates the data and prints out the data as rows.
format: "ion", // or ion default: ion
// Can be toggled to suppress some messaging when running in interactive mode
display_welcome: false, // the default; can be set to false
display_ctrl_signals: false,
// Determines whether or not metrics will be emitted after the results of a query are shown.
display_query_metrics: false,
// Set terminator_required to true indicates that pressing the enter key at the end of a line of
// input will not execute the command by itself.
// Alternately, if you end your statement with a semi-colon you will execute the statement.
terminator_required: false
}
}
EOT
# Create the SharedData Table in the QLDB default ledger
cd ~/qldb-v2.0.1-linux
cat <<EOT > createTable.sql
CREATE TABLE SharedData
EOT
./qldb < createTable.sql
# press `CTRL-D` to exit QLDB Interactive Shell