Skip to content

Commit

Permalink
chore: run nwaku as github action
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Apr 26, 2024
1 parent 78b1da7 commit 1813b2e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/docker-compose/nwaku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
nwaku:
image: "quay.io/wakuorg/nwaku-pr:2636-rln-v2"
command: ["--relay --store --nodekey=1122334455667788990011223344556677889900112233445566778899001122"]
ports:
- "60000"
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,9 @@ jobs:
run: |
docker compose -f .github/docker-compose/ganache.yml up -d
make test-onchain${{ matrix.tests == 'test-with-race' && '-with-race' || '' }}
- name: "Run storev3 tests"
run: |
docker compose -f .github/docker-compose/nwaku.yml up -d
nwaku_port=$(docker-compose port nwaku 60000)
echo "Mapped port for nwaku: $nwaku_port"
4 changes: 3 additions & 1 deletion waku/persistence/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,10 @@ func (d *DBStore) Put(env *protocol.Envelope) error {
storedAt = env.Index().ReceiverTime
}

hash := env.Hash()

start := time.Now()
_, err = stmt.Exec(env.Index().Digest, env.Hash(), storedAt, env.Message().GetTimestamp(), env.Message().ContentTopic, env.PubsubTopic(), env.Message().Payload, env.Message().GetVersion())
_, err = stmt.Exec(env.Index().Digest, hash[:], storedAt, env.Message().GetTimestamp(), env.Message().ContentTopic, env.PubsubTopic(), env.Message().Payload, env.Message().GetVersion())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion waku/v2/protocol/envelope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestEnvelope(t *testing.T) {

require.Equal(
t,
[]byte{0x91, 0x0, 0xe4, 0xa5, 0xcf, 0xf7, 0x19, 0x27, 0x49, 0x81, 0x66, 0xb3, 0xdf, 0xc7, 0xa6, 0x31, 0xf0, 0x87, 0xc7, 0x29, 0xb4, 0x28, 0x83, 0xb9, 0x5c, 0x31, 0x25, 0x33, 0x3, 0xc9, 0x7, 0x95},
pb.ToMessageHash([]byte{0x91, 0x0, 0xe4, 0xa5, 0xcf, 0xf7, 0x19, 0x27, 0x49, 0x81, 0x66, 0xb3, 0xdf, 0xc7, 0xa6, 0x31, 0xf0, 0x87, 0xc7, 0x29, 0xb4, 0x28, 0x83, 0xb9, 0x5c, 0x31, 0x25, 0x33, 0x3, 0xc9, 0x7, 0x95}),
hash,
)
}
2 changes: 1 addition & 1 deletion waku/v2/protocol/store/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestStoreClient(t *testing.T) {
err = wakuRelay.Start(context.Background())
require.NoError(t, err)

pm := peermanager.NewPeerManager(5, 5, utils.Logger())
pm := peermanager.NewPeerManager(5, 5, nil, utils.Logger())
pm.SetHost(host)
err = pm.SubscribeToRelayEvtBus(wakuRelay.Events())
require.NoError(t, err)
Expand Down

0 comments on commit 1813b2e

Please sign in to comment.