-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from schnetzlerjoe/main
v0.2.2-pre1
- Loading branch information
Showing
20 changed files
with
857 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM golang:1.19-alpine AS build-env | ||
|
||
ARG MONIKER | ||
ENV MONIKER moniker | ||
|
||
ARG tag | ||
ENV TAG tag | ||
|
||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 lz4 | ||
RUN apk add --no-cache $PACKAGES | ||
|
||
COPY . /go/delivery/defund | ||
|
||
COPY ./devtools/entrypoint.sh / | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
WORKDIR /go/delivery/defund | ||
|
||
RUN git checkout $TAG | ||
|
||
RUN make install | ||
|
||
RUN defundd init $MONIKER | ||
|
||
EXPOSE 26656 26657 1317 9090 | ||
|
||
CMD ["/bin/bash", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
CONFIG_PATH="./$HOME/.defund/config/config.toml" | ||
|
||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 150/g' $CONFIG_PATH | ||
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 150/g' $CONFIG_PATH | ||
sed -i 's/max_packet_msg_payload_size =.*/max_packet_msg_payload_size = 10240/g' $CONFIG_PATH | ||
sed -i 's/send_rate =.*/send_rate = 20480000/g' $CONFIG_PATH | ||
sed -i 's/recv_rate =.*/recv_rate = 20480000/g' $CONFIG_PATH | ||
sed -i 's/timeout_prevote =.*/timeout_prevote = "100ms"/g' $CONFIG_PATH | ||
sed -i 's/timeout_precommit =.*/timeout_precommit = "100ms"/g' $CONFIG_PATH | ||
sed -i 's/timeout_commit =.*/timeout_commit = "100ms"/g' $CONFIG_PATH | ||
sed -i 's/skip_timeout_commit =.*/skip_timeout_commit = false/g' $CONFIG_PATH | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
sed -i '' 's/max_num_inbound_peers =.*/max_num_inbound_peers = 150/g' $CONFIG_PATH | ||
sed -i '' 's/max_num_outbound_peers =.*/max_num_outbound_peers = 150/g' $CONFIG_PATH | ||
sed -i '' 's/max_packet_msg_payload_size =.*/max_packet_msg_payload_size = 10240/g' $CONFIG_PATH | ||
sed -i '' 's/send_rate =.*/send_rate = 20480000/g' $CONFIG_PATH | ||
sed -i '' 's/recv_rate =.*/recv_rate = 20480000/g' $CONFIG_PATH | ||
sed -i '' 's/timeout_prevote =.*/timeout_prevote = "100ms"/g' $CONFIG_PATH | ||
sed -i '' 's/timeout_precommit =.*/timeout_precommit = "100ms"/g' $CONFIG_PATH | ||
sed -i '' 's/timeout_commit =.*/timeout_commit = "100ms"/g' $CONFIG_PATH | ||
sed -i '' 's/skip_timeout_commit =.*/skip_timeout_commit = false/g' $CONFIG_PATH | ||
else | ||
printf "Platform not supported, please ensure that the following values are set in your config.toml:\n" | ||
printf "### P2P Configuration Options ###\n" | ||
printf "\t max_num_inbound_peers = 150\n" | ||
printf "\t max_num_outbound_peers = 150\n" | ||
printf "\t max_packet_msg_payload_size = 10240\n" | ||
printf "\t send_rate = 20480000\n" | ||
printf "\t recv_rate = 20480000\n" | ||
printf "### Consensus Configuration Options ###\n" | ||
printf "\t timeout_prevote = \"100ms\"\n" | ||
printf "\t timeout_precommit = \"100ms\"\n" | ||
printf "\t timeout_commit = \"100ms\"\n" | ||
printf "\t skip_timeout_commit = false\n" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package broker_test | ||
|
||
import ( | ||
"testing" | ||
|
||
keepertest "github.com/defund-labs/defund/testutil/keeper" | ||
"github.com/defund-labs/defund/x/broker" | ||
"github.com/defund-labs/defund/x/broker/types" | ||
"github.com/stretchr/testify/require" | ||
dbm "github.com/tendermint/tm-db" | ||
) | ||
|
||
func TestGenesis(t *testing.T) { | ||
genesisState := types.DefaultGenesis() | ||
|
||
db := dbm.NewMemDB() | ||
k, ctx := keepertest.BrokerKeeper(db, t) | ||
broker.InitGenesis(ctx, *k, *genesisState) | ||
got := broker.ExportGenesis(ctx, *k) | ||
require.NotNil(t, got) | ||
|
||
require.Equal(t, got.Brokers[0].Id, "osmosis") | ||
require.Equal(t, got.Params.AtomIBCPath, types.DefaultAtomPath) | ||
require.Equal(t, got.Params.OsmoIBCPath, types.DefaultOsmoPath) | ||
// this line is used by starport scaffolding # genesis/test/assert | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
testkeeper "github.com/defund-labs/defund/testutil/keeper" | ||
"github.com/defund-labs/defund/x/broker/types" | ||
dbm "github.com/tendermint/tm-db" | ||
) | ||
|
||
func TestGetParams(t *testing.T) { | ||
db := dbm.NewMemDB() | ||
k, ctx := testkeeper.BrokerKeeper(db, t) | ||
params := types.DefaultParams() | ||
|
||
k.SetParams(ctx, params) | ||
|
||
require.EqualValues(t, params, k.GetParams(ctx)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.