diff --git a/infra/.env b/infra/.env index 7d32d6e5..f9afb521 100644 --- a/infra/.env +++ b/infra/.env @@ -74,6 +74,13 @@ export FILECOIN_ADDRESS=f1ej2tountzqwnu6uswhqdzvw6yy5xvcig6rxl2qa export TERRA_PK=a96e62ed3955e65be32703f12d87b6b5cf26039ecfa948dc5107a495418e5330 export TERRA_ADDRESS=terra10s4mg25tu6termrk8egltfyme4q7sg3hl8s38u +# +# ThunderCore +# + +export THUNDERCORE_MNEMONIC="clutch captain shoe salt awake harvest setup primary inmate ugly among become" +export THUNDERCORE_ADDRESS=0xa0df350d2637096571F7A701CBc1C5fdE30dF76A + # # Zcash # diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 402fe7ec..dc1b0c29 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -151,6 +151,19 @@ services: ports: - "0.0.0.0:8899-8900:8899-8900" + # + # ThunderCore + # + thundercore: + build: + context: ./thundercore + ports: + - "0.0.0.0:8565:8565" + entrypoint: + - "./root/run.sh" + - "${THUNDERCORE_MNEMONIC}" + - "${THUNDERCORE_ADDRESS}" + ## ## Moonbeam ## diff --git a/infra/thundercore/Dockerfile b/infra/thundercore/Dockerfile new file mode 100644 index 00000000..0622fc61 --- /dev/null +++ b/infra/thundercore/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:xenial + +RUN apt-get update --fix-missing +RUN apt-get install --yes curl + +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - +RUN apt-get install --yes nodejs git +RUN useradd -ms /bin/bash node + +# workaround for npm not running prepare script when running as root +USER node +RUN npm config set prefix /home/node +RUN npm install -g thundercore/ganache-cli#tt +USER root +RUN ln -s /home/node/bin/ganache-cli /usr/bin/ganache-cli + +COPY run.sh /root/run.sh +RUN chmod +x /root/run.sh + +EXPOSE 8565 + +ENTRYPOINT ["./root/run.sh"] diff --git a/infra/thundercore/run.sh b/infra/thundercore/run.sh new file mode 100644 index 00000000..5e7a9eec --- /dev/null +++ b/infra/thundercore/run.sh @@ -0,0 +1,12 @@ +#!/bin/bash +MNEMONIC=$1 +ADDRESS=$2 + +ganache-cli \ + -h 0.0.0.0 \ + -a 105 \ + -k pala \ + -i 420 \ + -m "$MNEMONIC" \ + -p 8565 \ + -u $ADDRESS diff --git a/multichain.go b/multichain.go index ef2eee7e..817c3cdb 100644 --- a/multichain.go +++ b/multichain.go @@ -112,6 +112,7 @@ const ( LUNA = Asset("LUNA") // Luna MATIC = Asset("MATIC") // Matic PoS (Polygon) SOL = Asset("SOL") // Solana + TT = Asset("TT") // ThunderCore ZEC = Asset("ZEC") // Zcash // These assets are defined separately because they are mock assets. These @@ -152,6 +153,8 @@ func (asset Asset) OriginChain() Chain { return Polygon case SOL: return Solana + case TT: + return ThunderCore case ZEC: return Zcash @@ -175,7 +178,7 @@ func (asset Asset) ChainType() ChainType { switch asset { case BCH, BTC, DGB, DOGE, ZEC: return ChainTypeUTXOBased - case AVAX, BNB, ETH, FIL, GLMR, LUNA, MATIC: + case AVAX, BNB, ETH, FIL, GLMR, LUNA, MATIC, TT: return ChainTypeAccountBased // These assets are handled separately because they are mock assets. These @@ -227,6 +230,7 @@ const ( Polygon = Chain("Polygon") Solana = Chain("Solana") Terra = Chain("Terra") + ThunderCore = Chain("ThunderCore") Zcash = Chain("Zcash") // These chains are defined separately because they are mock chains. These @@ -261,7 +265,7 @@ func (chain Chain) ChainType() ChainType { switch chain { case Bitcoin, BitcoinCash, DigiByte, Dogecoin, Zcash: return ChainTypeUTXOBased - case Avalanche, BinanceSmartChain, Ethereum, Fantom, Filecoin, Moonbeam, Polygon, Solana, Terra: + case Avalanche, BinanceSmartChain, Ethereum, Fantom, Filecoin, Moonbeam, Polygon, Solana, Terra, ThunderCore: return ChainTypeAccountBased // These chains are handled separately because they are mock chains. These @@ -319,6 +323,8 @@ func (chain Chain) NativeAsset() Asset { return SOL case Terra: return LUNA + case ThunderCore: + return TT case Zcash: return ZEC diff --git a/multichain_test.go b/multichain_test.go index ad08000f..6a152c91 100644 --- a/multichain_test.go +++ b/multichain_test.go @@ -118,6 +118,10 @@ var _ = Describe("Multichain", func() { multichain.Terra, multichain.LUNA, }, + { + multichain.ThunderCore, + multichain.TT, + }, } utxoChains := []struct { chain multichain.Chain