I am attempting to create a stellar-core and horizon node running under Travis-CI. (Existing solutions do not work for macOS, as Travis does not support Docker instances for test builds.) The purpose is to test an iOS SDK for communicating with Horizon nodes.
The error is as follows (formatted for readability):
INFO[0105] Starting request
host="localhost:8000" ip="[::1]:50783" method=POST
path="/transactions" pid=1408 req="Traviss-Mac-913.local/cd7EdAgdzz-000002"
ERRO[0108] import session failed: failed to load transactions:
select failed: sql: Scan error on column index 5: xdr:decode:
switch '1' is not valid for union pid=1408
The exact same unit tests run on my local MacBook, using a horizon instance running in a Docker container.
The following is the script which establishes the nodes in Travis:
#!/bin/bash
rm -rf /usr/local/var/postgres
initdb /usr/local/var/postgres -E utf8
pg_ctl -D /usr/local/var/postgres start
createuser -s postgres
psql -c 'create database core;' -U postgres
psql -c 'create database horizon;' -U postgres
pg_ctl -V
./stellar/bin/stellar-core --conf ./stellar-core.cfg --newdb --forcescp
./stellar/bin/stellar-core --conf ./stellar-core.cfg &
sleep 2
export DATABASE_URL=postgres://postgres@localhost/horizon?sslmode=disable
export STELLAR_CORE_DATABASE_URL=postgres://postgres@localhost/core?sslmode=disable
export STELLAR_CORE_URL=http://localhost:11626
export NETWORK_PASSPHRASE=private testnet
export INGEST=true
./horizon/horizon db init
./horizon/horizon serve &