Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lk86/resolve rosetta conflicts #9932

Merged
merged 190 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
cbe3faa
Omit max-fee from con-preprocess if default
bkase Oct 25, 2021
8329c3a
Accounts graphql null if no account exist
bkase Oct 25, 2021
56c9e0d
Adds release notes for the construction fixes
bkase Oct 26, 2021
7c4f119
Rosetta construction supports memos
bkase Oct 27, 2021
32702a6
Updates rosetta README
bkase Oct 27, 2021
c1aecc5
Make many fields optional
bkase Oct 27, 2021
3c0b414
Clarifies needed modification of models
bkase Oct 27, 2021
a11bc1b
Fixes rosetta unit tests
bkase Oct 29, 2021
68360c5
Rosetta: /Account/balance performance
bkase Nov 2, 2021
1077225
Attempts to use ssh for dockerfile
bkase Nov 2, 2021
8c92d2e
Adds .git
bkase Nov 2, 2021
2af7732
Tries https protocol on git
bkase Nov 2, 2021
80aeeff
Change back to 0L instead of Account_not_found
bkase Nov 2, 2021
acf4a35
Rosetta: Adds invalid transaction errors
bkase Nov 3, 2021
f44bd31
Adds nonconsensus support
bkase Nov 3, 2021
fcd8032
More nonconsensus fixes
bkase Nov 3, 2021
ca188b5
Revert "Change back to 0L instead of Account_not_found"
bkase Nov 4, 2021
fc35706
Revert "Rosetta: /Account/balance performance"
bkase Nov 4, 2021
fbaba41
Preps for rosetta-v8 release
bkase Nov 4, 2021
9ca29cd
lk86/rosetta-bootstrap-forever Make download-missing-blocks run forev…
lk86 Nov 1, 2021
dfc3fbd
Rosetta: Reduce max DB conns 128->16
bkase Nov 3, 2021
f45768b
Rosetta: Bump max db concurrency 16->64
bkase Nov 4, 2021
a6474b6
Env for pool size MINA_ROSETTA_MAX_DB_POOL_SIZE
bkase Nov 4, 2021
5384bb0
Rosetta: Fast canonical lookups chain_status
bkase Nov 10, 2021
5c5b487
Adds comment about common_sql
bkase Nov 10, 2021
6af366f
Merge pull request #9797 from MinaProtocol/feature/rosetta-chain-stat…
bkase Nov 10, 2021
a0ab15b
Update chain status in archive db when blocks added
psteckler Nov 10, 2021
af96f5d
Add type annotation for chain_status in SQL
psteckler Nov 10, 2021
3982e63
Rosetta: Short circuit recursive near tip
bkase Nov 11, 2021
e2c8084
Revert "Rosetta: Short circuit recursive near tip"
bkase Nov 11, 2021
06cbf43
Rosetta: Make requested changes
bkase Nov 11, 2021
ee65955
Rosetta: Select chain-status where relevant
bkase Nov 11, 2021
df02c76
Rosetta: Fixes part of recursive condition
bkase Nov 11, 2021
516063d
Rosetta: Remove unecessary match%bind
bkase Nov 11, 2021
19b3e2f
Rosetta: Ensure duplicate error fires
bkase Nov 10, 2021
9bd756b
Adds back query-and-catch
bkase Nov 11, 2021
d26ab6e
Merge remote-tracking branch 'origin/rosetta-1.2.1-safe' into feature…
lk86 Nov 11, 2021
3af59c9
Updates Rosetta README for v9
bkase Nov 11, 2021
784cc54
Merge pull request #9802 from MinaProtocol/feature/rosetta-quick-recu…
bkase Nov 11, 2021
316bd46
Rosetta: Adds WITH in front of query-old %s
bkase Nov 12, 2021
a60910c
Rosetta: Fixes queries finally
bkase Nov 12, 2021
3e301c9
Chain status pending
psteckler Nov 12, 2021
3b54590
Update queries because no NULLs
psteckler Nov 12, 2021
5403052
Merge pull request #9811 from MinaProtocol/feature/rosetta-chain-stat…
psteckler Nov 12, 2021
6b2cdae
WIP
bkase Nov 16, 2021
dfba4be
Rosetta: Replaces WITH RECURSIVE with WITH
bkase Nov 17, 2021
29f5639
Merge remote-tracking branch 'origin/rosetta-1.2.1-safe' into rosetta…
bkase Nov 17, 2021
498ab1f
fix compile error
psteckler Nov 17, 2021
126a865
Add indexes to archive db schema for Rosetta account query
psteckler Nov 17, 2021
a5fac22
Merge pull request #9839 from MinaProtocol/feature/add-indexes-rosett…
bkase Nov 17, 2021
9d02a93
Rosetta: Removes distinct via usercommand query
bkase Nov 17, 2021
048f1ff
Merge pull request #9841 from MinaProtocol/feature/removes-distinct
bkase Nov 17, 2021
09b77b7
Add NOT NULL constraint when adding chain_status column
psteckler Nov 18, 2021
2725fcd
Uses get_graphql_uri in the routes
bkase Nov 19, 2021
58293b2
Merge pull request #9848 from MinaProtocol/fix/add-pending-not-null
psteckler Nov 19, 2021
ce2fa99
Rosetta: Duplicate transactions hash preimage
bkase Nov 19, 2021
f51ebe9
Rosetta: Removes debug logs
bkase Nov 19, 2021
bc1b487
Rosetta v10 release
bkase Nov 19, 2021
00ad072
Merge branch 'rosetta-v10' into rosetta-1.2.1-safe
bkase Nov 19, 2021
2be7714
Extend balances table for better Rosetta
psteckler Nov 20, 2021
f4a3edf
add comment
psteckler Nov 20, 2021
05e0088
Add foreign key constraints on block ids
psteckler Nov 20, 2021
cf5dd78
Add ON DELETE CASCADE for block_id, balance references
psteckler Nov 20, 2021
092c62b
Replayer, verify block data in balances table
psteckler Nov 21, 2021
ed643bf
fix SQL for inserting balances
psteckler Nov 21, 2021
b1f1061
Account balance query using extended balances table
psteckler Nov 23, 2021
6f63ddb
Merge pull request #9859 from MinaProtocol/feature/extended-balance-tbl
lk86 Nov 23, 2021
8d42979
Merge remote-tracking branch 'origin/rosetta-1.2.1-safe' into feature…
lk86 Nov 23, 2021
32349a5
feature/account-query-with-extended-balances-tbl Update default dbname
lk86 Nov 23, 2021
1800174
Remove relevant_block_balances
psteckler Nov 23, 2021
3b39d11
Merge pull request #9871 from MinaProtocol/feature/account-query-with…
psteckler Nov 29, 2021
e365376
Use chain status for block recency
psteckler Nov 30, 2021
e6e29d4
Count canonicals
psteckler Nov 30, 2021
2f1472e
Report chain status gaps in missing blocks auditor
psteckler Nov 30, 2021
168b7db
Fix log msg
psteckler Nov 30, 2021
e88186b
use equal deriver
psteckler Nov 30, 2021
d0aa4fb
Merge pull request #9880 from MinaProtocol/feature/chain-status-for-r…
psteckler Nov 30, 2021
0943ebb
Merge pull request #9881 from MinaProtocol/feature/chain-status-gaps
psteckler Nov 30, 2021
487346b
lk86/locking-config-and-read-committed Update default transaction iso…
lk86 Nov 30, 2021
6f478d2
lk86/locking-config-and-read-committed Update init-db to show which c…
lk86 Nov 30, 2021
f6b602b
Audit canonical chain statuses
psteckler Nov 30, 2021
27b18dc
Merge pull request #9884 from MinaProtocol/feature/audit-canonical-chain
psteckler Nov 30, 2021
462c0c0
lk86/locking-config-and-read-committed Update init-db script to be mo…
lk86 Dec 1, 2021
8ee8d23
lk86/locking-config-and-read-committed Update init-db to use the hard…
lk86 Dec 1, 2021
ba3bfb4
lk86/locking-config-and-read-committed Simplify create cluster config…
lk86 Dec 1, 2021
79560a5
lk86/locking-config-and-read-committed Create postgres config as root
lk86 Dec 1, 2021
b158064
lk86/locking-config-and-read-committed Increase max_pred_locks_per_re…
lk86 Dec 1, 2021
5bb9f99
lk86/locking-config-and-read-committed More permissive configuration …
lk86 Dec 2, 2021
971318c
lk86/locking-config-and-read-committed Limit locks per relation and t…
lk86 Dec 2, 2021
e2a8a83
lk86/locking-config-and-read-committed Re-introduce pg_hba.conf in th…
lk86 Dec 3, 2021
3f4ece5
Rosetta, rename queries
psteckler Dec 3, 2021
f0a5633
Merge pull request #9890 from MinaProtocol/feature/rosetta-rename-que…
psteckler Dec 6, 2021
39d750f
Rosetta, log Postgresql connection, locks data
psteckler Dec 7, 2021
8dec95f
Add logs for network, mempool
psteckler Dec 7, 2021
fcff182
add file
psteckler Dec 7, 2021
e2864c8
Merge pull request #9896 from MinaProtocol/feature/rosetta-log-pg-data
psteckler Dec 7, 2021
f1e1551
Publishes v11
bkase Dec 8, 2021
e3ec271
Merge remote-tracking branch 'origin/rosetta-1.2.1-safe' into lk86/lo…
lk86 Dec 8, 2021
c8a1fcb
lk86/locking-config-and-read-committed Add default values for various…
lk86 Dec 8, 2021
30a7a2f
Exit codes for missing blocks auditor
psteckler Dec 9, 2021
c815768
lk86/locking-config-and-read-committed Update download-missing-blocks
lk86 Dec 9, 2021
6079465
Merge pull request #9899 from MinaProtocol/feature/blocks-auditor-exi…
psteckler Dec 9, 2021
b0fbaee
lk86/locking-config-and-read-committed Functionalize more
lk86 Dec 9, 2021
b74886b
Fix pending blocks balance query
psteckler Dec 10, 2021
2551476
Use db for current block
psteckler Dec 10, 2021
33a9f67
revert debug code
psteckler Dec 10, 2021
e4921da
Use timestamp from db for latest block
psteckler Dec 10, 2021
7e98138
Merge pull request #9904 from MinaProtocol/fix/pending-blocks-balance
psteckler Dec 10, 2021
270a0ff
Merge remote-tracking branch 'origin/rosetta-1.2.1-safe' into lk86/lo…
lk86 Dec 10, 2021
5fcc7bd
Set chain status when adding intermediate blocks
psteckler Dec 10, 2021
7beba33
Merge pull request #9908 from MinaProtocol/fix/chain-status-intermedi…
psteckler Dec 10, 2021
8e93e35
lk86/support-ubuntu20 Update 5-prod-ubuntu for 20.04
lk86 Dec 13, 2021
c9c17e7
lk86/support-ubuntu20 Move the toolchain container out of the require…
lk86 Dec 13, 2021
0bcb181
lk86/support-ubuntu20 Use 5.11.3 rocksdb
lk86 Dec 13, 2021
7e42d1d
lk86/support-ubuntu20 Update to 5.18.4 rocksdb
lk86 Dec 13, 2021
f32c88e
lk86/support-ubuntu20 Set env explicitly to empty string
lk86 Dec 13, 2021
41392d5
lk86/support-ubuntu20 Update to libprocps8
lk86 Dec 13, 2021
82783e2
lk86/locking-config-and-read-committed Update rosetta configurations …
lk86 Dec 14, 2021
7814dbb
Merge remote-tracking branch 'origin/lk86/support-ubuntu20' into lk86…
lk86 Dec 14, 2021
4c76a13
Merge pull request #9911 from MinaProtocol/lk86/support-ubuntu20
lk86 Dec 15, 2021
f304d11
Merge pull request #9885 from MinaProtocol/lk86/locking-config-and-re…
lk86 Dec 15, 2021
b112c30
lk86/resolve-rosetta-conflicts Temporarily address conflicts
lk86 Dec 16, 2021
a0938b3
Release of rosetta-v12
bkase Dec 16, 2021
e35fa23
lk86/resolve-rosetta-conflicts Fix conflicts in download-missing-bloc…
lk86 Dec 16, 2021
39616a7
lk86/resolve-rosetta-conflicts Fix conflicts in rosetta README.md
lk86 Dec 16, 2021
41d46a4
lk86/resolve-rosetta-conflicts Fix init-db when the database already …
lk86 Dec 16, 2021
86286a1
Resolves some of the conflicts
bkase Dec 16, 2021
be7acf0
Conflict resolution, memo handled elsewhere
bkase Dec 16, 2021
e0ebe57
Fixes instructions for rosetta-v12 build
bkase Dec 16, 2021
212e5d9
lk86/resolve-rosetta-conflicts Explicitly depend on tzdata to avoid i…
lk86 Dec 16, 2021
fdcf15f
Merge remote-tracking branch 'origin/lk86/fix-conflicts-with-1.2.1' i…
lk86 Dec 16, 2021
ef29bef
lk86/resolve-rosetta-conflicts Try using the remaining conflicting fi…
lk86 Dec 16, 2021
c831d6e
rosetta-v12 Give bash more breathing room for the missing blocks audi…
lk86 Dec 16, 2021
bde0a28
rosetta-v12 Simplify the check for an existing DB to skip auth alltog…
lk86 Dec 16, 2021
de7b068
rosetta-v12 Update init-db to be more likely to pass when postgresql …
lk86 Dec 16, 2021
396e670
rosetta-v12 Drop the cluster first
lk86 Dec 17, 2021
ca03323
rosetta-v12 Create /data/postgresql as root
lk86 Dec 17, 2021
cf9516b
rosetta-v12 Let pg_createcluster create /data/postgresql
lk86 Dec 17, 2021
8529ecc
rosetta-v12 Run pg_createcluster as root with the same flags as in in…
lk86 Dec 17, 2021
ba56b3f
rosetta-v12 Update init-db arguments to be clearer and copy over the …
lk86 Dec 17, 2021
d4a6530
rosetta-v12 Fix mina_network prefix on all uses of PARENT_FILE
lk86 Dec 17, 2021
44d4cc8
rosetta-v12 Remove extraneous commands when re-initializing the database
lk86 Dec 17, 2021
ec24db2
Merge branch 'lk86/fix-conflicts-with-1.2.1' into lk86/resolve-rosett…
lk86 Dec 17, 2021
7cfc7e0
Merge in release/1.2.0 with some conflicts yet to be resolved
lk86 Dec 17, 2021
e36fa6e
Revert "lk86/resolve-rosetta-conflicts Try using the remaining confli…
lk86 Dec 17, 2021
b77cac4
Rosetta, return error if no account
psteckler Dec 21, 2021
c9443a3
Merge pull request #9954 from MinaProtocol/fix/rosetta-no-account-error
psteckler Dec 21, 2021
80420ae
Release of rosetta-v13
bkase Dec 22, 2021
0269eca
temp
psteckler Dec 16, 2021
5019a9f
temp
psteckler Dec 23, 2021
cf41ba6
Attempts to implement compressed coding
bkase Dec 29, 2021
d1e6612
Cleans up coding
bkase Dec 29, 2021
498af9e
Explains new compressed pk form
bkase Dec 29, 2021
7829ba9
Added note about existing field encodings
bkase Dec 29, 2021
f7d9df2
Rosetta, making block queries deterministic
psteckler Jan 4, 2022
2d7bb45
Explicit ASC
psteckler Jan 4, 2022
0137a2b
Limit max height of block queries
psteckler Jan 5, 2022
94cc19e
Merge pull request #9967 from MinaProtocol/feature/rosetta-determinis…
psteckler Jan 5, 2022
136a1ca
use max height delta for network status
psteckler Jan 5, 2022
654afa8
Requested changes
bkase Jan 5, 2022
edfba56
Merge pull request #9969 from MinaProtocol/feature/rosetta-limit-bloc…
psteckler Jan 5, 2022
9443052
Adds mode for accepting direct signatures
bkase Jan 5, 2022
a6b083a
Release of rosetta-v14
psteckler Jan 5, 2022
81ad9d4
Adds documentation for the new signature coding
bkase Jan 5, 2022
3d59082
Removes the old encoding, only uses the new one
bkase Jan 8, 2022
c10f871
Fixes typo in docs
bkase Jan 8, 2022
d4136ef
add_chain_status.sh, fix conflict
psteckler Jan 13, 2022
b681901
Merge remote-tracking branch 'origin/rosetta-v14' into rosetta-1.2.1-…
lk86 Jan 13, 2022
b6398fc
Fix conflict in processor.ml
psteckler Jan 13, 2022
ddc6a4f
Adds more ocaml-signer debugging + test-curls
bkase Jan 10, 2022
d58123b
Fixes spelling of tnx->txn
bkase Jan 13, 2022
3041a2d
Requested changes
bkase Jan 13, 2022
47cf1cc
Merge pull request #9965 from MinaProtocol/feature/rosetta-pk-compres…
bkase Jan 13, 2022
02dccb6
Makes /network/list and /network/options offline
bkase Jan 13, 2022
5828e97
Merge pull request #10019 from MinaProtocol/feature/rosetta-offline-n…
bkase Jan 13, 2022
8ad1c53
Releases rosetta-v15
bkase Jan 13, 2022
7378d54
Unsigned txn instead of pk in payload hex_bytes
bkase Jan 14, 2022
2dfb792
Makes bytes hex
bkase Jan 14, 2022
915376e
Decodes signature when unrendering transactions
bkase Jan 15, 2022
3795b1c
Ignores network request to prevent unused
bkase Jan 15, 2022
24860d6
Updates script
bkase Jan 18, 2022
1824a81
Uses env variable to determine net list
bkase Jan 18, 2022
e8cff12
Makes requested changes
bkase Jan 18, 2022
e589b7b
Merge pull request #10044 from MinaProtocol/fix/rosetta-payloads-unsi…
bkase Jan 18, 2022
33b1ea4
Adds rosetta-v16 release
bkase Jan 18, 2022
5e06b89
don't update chain status if no canonical block
psteckler Jan 19, 2022
10c688b
Merge branch 'compatible' into lk86/resolve-rosetta-conflicts
psteckler Jan 19, 2022
c3fd75a
lk86/resolve-rosetta-conflicts Update readme for v16 everywhere
lk86 Jan 19, 2022
cfbd052
no need to encode signature in client SDK
psteckler Jan 19, 2022
5366a78
Use updated string signer
psteckler Jan 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions dockerfiles/stages/1-build-deps-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#################################################################################################
# The "build-deps" stage
# - Installs all compilers/interpreters, tools, and OS packages on Ubuntu 20.04
#################################################################################################
FROM ubuntu:20.04 AS build-deps

# Ocaml Version
ARG OCAML_VERSION=4.11
ARG OCAML_REVISION=.2
ARG OCAML_VARIANT=
ARG OCAML_PACKAGE=
ARG OPAM_VERSION=2.0.7

# Golang version number used to detemine tarball name
ARG GO_VERSION=1.16.5

# Go Capnp Version (for capnpc dependency)
ARG GO_CAPNP_VERSION=v3.0.0-alpha.1

# Rust Version passed into rustup-init, can also be "stable", "nightly" or similar
ARG RUST_VERSION=1.52.1

# Rocksdb commit tag/branch to clone
ARG ROCKSDB_VERSION=v5.18.4

# OS package dependencies
# First add support for https and pkg-config for apt, then install everything else
# TODO: make sure this is the minimum compile-time deps
# Organized as two alphabetized lists, first libraries and then tools/other packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install --yes \
libboost-dev \
libboost-program-options-dev \
libbz2-dev \
libcap-dev \
libffi-dev \
libgflags-dev \
libgmp-dev \
libgmp3-dev \
libjemalloc-dev \
libpq-dev \
libprocps-dev \
libsodium-dev \
libssl-dev \
zlib1g-dev \
build-essential \
capnproto \
cmake \
curl \
file \
git \
m4 \
pkg-config \
rsync \
sudo \
unzip

# Create opam user (for later) and give sudo to make opam happy
RUN adduser --uid 65533 --disabled-password --gecos '' opam \
&& passwd -l opam \
&& chown -R opam:opam /home/opam \
&& echo 'opam ALL=(ALL:ALL) NOPASSWD:ALL' > /etc/sudoers.d/opam \
&& chmod 440 /etc/sudoers.d/opam \
&& chown root:root /etc/sudoers.d/opam \
&& chmod 777 /tmp

# Opam install of a given OPAM_VERSION from github release
RUN curl -sL \
"https://github.com/ocaml/opam/releases/download/${OPAM_VERSION}/opam-${OPAM_VERSION}-x86_64-linux" \
-o /usr/bin/opam \
&& chmod +x /usr/bin/opam

# Golang install of a given GO_VERSION (add -v for spam output of each file from the go dist)
RUN curl -s "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar -xz -C /usr/lib/

# Rust install via rustup-init to a given RUST_VERSION
USER opam
RUN curl --proto '=https' --tlsv1.2 -sSf -o /tmp/rustup-init \
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init \
&& chmod +x /tmp/rustup-init \
&& /tmp/rustup-init -y --default-toolchain "${RUST_VERSION}" --profile minimal \
&& rm /tmp/rustup-init
# For more about rustup-init see: https://github.com/rust-lang/rustup/blob/master/README.md
# As opposed to introducing another shell script here (that mostly just determines the platform)
# we just download the binary for the only platform we care about in this docker environment

USER root
ENV CXXFLAGS '-Wno-error=deprecated-copy -Wno-error=pessimizing-move -Wno-error=class-memaccess'
# This builds and installs just the rocksdb static lib for us, and cleans up after itself
RUN git clone https://github.com/facebook/rocksdb \
--depth 1 --shallow-submodules \
-b "${ROCKSDB_VERSION}" /rocksdb \
&& make -C /rocksdb static_lib PORTABLE=1 -j$(nproc) \
&& cp /rocksdb/librocksdb.a /usr/local/lib/librocksdb_coda.a \
&& rm -rf /rocksdb \
&& strip -S /usr/local/lib/librocksdb_coda.a
ENV CXXFLAGS ""

###########################################################################################
# Initialize opam in a minimal fashion
###########################################################################################

# Set up environment for running as opam user
WORKDIR /home/opam
USER opam
ENV HOME /home/opam

# Create the following user directory configs as the Opam user:
## Add go + rust to the path, unlimit the opam user,
## unlimit stack for future shells that might use spacetime,
## disable ipv6
## disable sandboxing to allow unprivledged builds
RUN mkdir --mode=700 ~/.gnupg \
&& echo 'export PATH="$PATH:/usr/lib/go/bin:$HOME/.cargo/bin"' >> ~/.bashrc \
&& echo 'ulimit -s unlimited' >> ~/.bashrc \
&& echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf

# Ocaml install of a given OCAML_VERSION via opam switch
# additionally initializes opam with sandboxing disabled, as we did not install bubblewrap above.
RUN git clone \
https://github.com/ocaml/opam-repository.git \
--depth 1 \
/home/opam/opam-repository \
&& opam init --disable-sandboxing -k git -a ~/opam-repository --bare \
&& opam repository add --yes --all --set-default o1-labs https://github.com/o1-labs/opam-repository.git \
&& opam switch create "${OCAML_VERSION}${OCAML_REVISION}" "${OCAML_PACKAGE}${OCAML_VERSION}${OCAML_REVISION}${OCAML_VARIANT}" \
&& opam switch "${OCAML_VERSION}${OCAML_REVISION}"

# --- Build and install capnproto go compiler
# This package was particularly tricky to get to install correctly because of how the package's source code is structured.
# To work around this, we install it as a dependency for a local go module and build the binary from the GOPATH.
RUN mkdir go-tmp \
&& cd go-tmp \
&& /usr/lib/go/bin/go mod init local/build \
&& /usr/lib/go/bin/go get capnproto.org/go/capnp/v3@$GO_CAPNP_VERSION \
&& /usr/lib/go/bin/go build -o capnpc-go capnproto.org/go/capnp/v3/capnpc-go \
&& sudo mv capnpc-go /usr/local/bin \
&& cd - \
&& sudo rm -rf go-tmp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - Includes the entire mina codebase and submodules in "${MINA_DIR}" (must be writable by opam user)
# - Largely mirrors/replaces ./scripts/setup-opam.sh
#################################################################################################
FROM toolchain AS opam-deps
FROM build-deps AS opam-deps

# location of repo used for pins and external package commits
ARG MINA_DIR=mina
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The "toolchain" Stage
# - installs optional tools that are required in our CI/CD but are not required to build mina
#################################################################################################
FROM build-deps AS toolchain
FROM opam-deps AS toolchain

ARG DOCKER_VERSION=19.03.4
ARG TERRAFORM_VERSION=0.14.11
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/stages/4-deb-builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The "deb-builder" Stage
# - builds mina and any other binaries required to run `make deb`
#################################################################################################
FROM opam-deps AS deb-builder
FROM toolchain AS deb-builder

# Use --build-arg "DUNE_PROFILE=dev" to build a dev image or for CI
ARG DUNE_PROFILE=devnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# The "production" Stage
# - sets up the final container with built binaries and a running postgresql archive node setup
#################################################################################################
FROM ubuntu:18.04 AS production
FROM ubuntu:20.04 AS production

ARG MINA_DAEMON_PORT=10101
ARG MINA_CONFIG_DIR=/root/.mina-config
ARG MINA_CONFIG_DIR=/data/.mina-config
# Sample public key for use in dev profile / demo mode genesis block
ARG PK=B62qiZfzW27eavtPrnF6DeDSAKEjXuGFdkouC3T5STRa6rrYLiDUP2p

Expand All @@ -27,15 +27,18 @@ RUN apt-get -y update \
postgresql \
postgresql-contrib \
tzdata \
libjemalloc1 \
libprocps6 \
libffi6 \
libjemalloc2 \
libprocps8 \
libffi7 \
jq \
sudo

# Install rosetta-cli
RUN curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/master/scripts/install.sh | sh -s

# Generate en_US.UTF-8 to allow use of O(1) Labs DB dumps
RUN locale-gen en_US.UTF-8

RUN mkdir -p --mode=700 ${MINA_CONFIG_DIR}/wallets/store/ \
&& echo "$PK" > ${MINA_CONFIG_DIR}/wallets/store/$PK.pub \
&& echo '{"box_primitive":"xsalsa20poly1305","pw_primitive":"argon2i","nonce":"6pcvpWSLkMi393dT5VSLR6ft56AWKkCYRqJoYia","pwsalt":"ASoBkV3NsY7ZRuxztyPJdmJCiz3R","pwdiff":[134217728,6],"ciphertext":"Dmq1Qd8uNbZRT1NT7zVbn3eubpn9Myx9Je9ZQGTKDxUv4BoPNmZAGox18qVfbbEUSuhT4ZGDt"}' \
Expand All @@ -49,20 +52,18 @@ COPY --from=builder /home/opam/mina/src/app/rosetta/README.md /rosetta/
COPY --from=builder /home/opam/mina/genesis_ledgers /genesis_ledgers/

USER postgres

RUN POSTGRES_VERSION=$(psql -V | cut -d " " -f 3 | sed 's/.[[:digit:]]*$//g') \
&& echo "$POSTGRES_VERSION" "$(psql -V)" \
&& echo "data_directory = '/data/postgresql'" >> /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf \
&& echo "listen_addresses='*'" >> /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf \
&& echo "max_locks_per_transaction=1024" >> /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf \
&& echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf
&& echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf \
&& pg_dropcluster --stop ${POSTGRES_VERSION} main

USER root

WORKDIR /rosetta
# Run as root so it can create /data/postgresql
RUN POSTGRES_VERSION=$(psql -V | cut -d " " -f 3 | sed 's/.[[:digit:]]*$//g') \
&& pg_createcluster --start -d /data/postgresql --createclusterconf /rosetta/postgresql.conf ${POSTGRES_VERSION} main

# Generate en_US.UTF-8 to allow use of O(1) Labs DB dumps
RUN locale-gen en_US.UTF-8
WORKDIR /rosetta

EXPOSE 3087
EXPOSE $MINA_DAEMON_PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ RUN test "$deb_codename" = "stretch" \
# Install rosetta-cli
RUN curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/master/scripts/install.sh | sh -s

# Generate en_US.UTF-8 to allow use of O(1) Labs DB dumps
RUN locale-gen en_US.UTF-8

RUN mkdir -p --mode=700 ${MINA_CONFIG_DIR}/wallets/store/ \
&& echo "$PK" > ${MINA_CONFIG_DIR}/wallets/store/$PK.pub \
&& echo '{"box_primitive":"xsalsa20poly1305","pw_primitive":"argon2i","nonce":"6pcvpWSLkMi393dT5VSLR6ft56AWKkCYRqJoYia","pwsalt":"ASoBkV3NsY7ZRuxztyPJdmJCiz3R","pwdiff":[134217728,6],"ciphertext":"Dmq1Qd8uNbZRT1NT7zVbn3eubpn9Myx9Je9ZQGTKDxUv4BoPNmZAGox18qVfbbEUSuhT4ZGDt"}' \
Expand All @@ -63,20 +66,14 @@ COPY --from=builder /home/opam/mina/src/app/rosetta/README.md /rosetta/
COPY --from=builder /home/opam/mina/genesis_ledgers /genesis_ledgers/

USER postgres

RUN POSTGRES_VERSION=$(psql -V | cut -d " " -f 3 | sed 's/.[[:digit:]]*$//g') \
&& echo "$POSTGRES_VERSION" "$(psql -V)" \
&& echo "data_directory = '/data/postgresql'" >> /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf \
&& echo "listen_addresses='*'" >> /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf \
&& echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf

USER root

WORKDIR /rosetta

# Generate en_US.UTF-8 to allow use of O(1) Labs DB dumps
RUN locale-gen en_US.UTF-8

EXPOSE 3087
EXPOSE $MINA_DAEMON_PORT

Expand Down
30 changes: 6 additions & 24 deletions frontend/client_sdk/test/Test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,45 +84,27 @@ deepStrictEqual(
"Invalid signed delegation was verified"
);

const signedRosettaTnxMock = `
{
"signature": "389ac7d4077f3d485c1494782870979faa222cd906b25b2687333a92f41e40b925adb08705eddf2a7098e5ac9938498e8a0ce7c70b25ea392f4846b854086d43",
"payment": {
"to": "B62qnzbXmRNo9q32n4SNu2mpB8e7FYYLH8NmaX6oFCBYjjQ8SbD7uzV",
"from": "B62qnzbXmRNo9q32n4SNu2mpB8e7FYYLH8NmaX6oFCBYjjQ8SbD7uzV",
"fee": "10000000",
"token": "1",
"nonce": "0",
"memo": null,
"amount": "1000000000",
"valid_until": "4294967295"
},
"stake_delegation": null,
"create_token": null,
"create_token_account": null,
"mint_tokens": null
}
`;
const signedRosettaTxnMock = "{\"signature\":\"C1B98ADACCEC9BB0BC7646C43A128BF83FC31B44CFC4F28BA7874489AFA7312B251D96FE23D9195C65B77430CA0D326626009C28FDBE1AA47990C4235238A436\",\"payment\":{\"to\":\"B62qoDWfBZUxKpaoQCoFqr12wkaY84FrhxXNXzgBkMUi2Tz4K8kBDiv\",\"from\":\"B62qkUHaJUHERZuCHQhXCQ8xsGBqyYSgjQsKnKN5HhSJecakuJ4pYyk\",\"fee\":\"2000000000\",\"token\":\"1\",\"nonce\":\"2\",\"memo\":\"hello\",\"amount\":\"3000000000\",\"valid_until\":\"10000000\"},\"stake_delegation\":null,\"create_token\":null,\"create_token_account\":null,\"mint_tokens\":null}";

const signedGraphQLCommand =
MinaSDK.signedRosettaTransactionToSignedCommand(signedRosettaTnxMock);
const signedRosettaTnxMockJson = JSON.parse(signedRosettaTnxMock);
MinaSDK.signedRosettaTransactionToSignedCommand(signedRosettaTxnMock);
const signedRosettaTxnMockJson = JSON.parse(signedRosettaTxnMock);
const signedGraphQLCommandJson = JSON.parse(signedGraphQLCommand);

deepStrictEqual(
signedRosettaTnxMockJson.payment.to,
signedRosettaTxnMockJson.payment.to,
signedGraphQLCommandJson.data.payload.body[1].receiver_pk,
"Rosetta to GraphQL transaction conversion has mismatched receiver public key"
);

deepStrictEqual(
signedRosettaTnxMockJson.payment.from,
signedRosettaTxnMockJson.payment.from,
signedGraphQLCommandJson.data.payload.body[1].source_pk,
"Rosetta to GraphQL transaction conversion has mismatched source public key"
);

deepStrictEqual(
signedRosettaTnxMockJson.payment.amount,
signedRosettaTxnMockJson.payment.amount,
signedGraphQLCommandJson.data.payload.body[1].amount,
"Rosetta to GraphQL transaction conversion has mismatched amount"
);
Loading