Skip to content

Instantly share code, notes, and snippets.

@qfrank
qfrank / gist:501e3bb8e92c7d27054ed7d4f804a275
Created October 16, 2023 09:48
test if encrypting works
func TestOpen(t *testing.T) {
filePath := "/Users/xxx/Documents/tmp/0x49447b3c313e9bca0aeec82fb97a6b69f158d45797641919960e03ac60c83577-v4.db"
encrypted, err := IsEncrypted(filePath)
require.NoError(t, err)
require.True(t, encrypted)
db, err := InitializeDB(filePath, "0x20756cad9b728c8225fd8cedb6badaf8731e174506950219ea657cd54f35f46c",dbsetup.ReducedKDFIterationsNumber)
require.NoError(t, err)
rows, err := db.Query("SELECT COUNT(1) FROM keypairs_accounts")
require.NoError(t, err)
@qfrank
qfrank / gist:f5064d9aa8b940d519dd850c2f15399d
Created October 20, 2023 08:07
Test DB(sqlite) for Notification ID
package protocol
import (
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/sqlite"
"github.com/stretchr/testify/require"
"testing"
)
func TestNotificationID(t *testing.T) {
@qfrank
qfrank / how-to-setup-local-waku-node.md
Last active November 30, 2023 08:45
How to setup local waku node with status-mobile

Why we need local waku node?

Sometimes to reproduce the bug rather than message delivery issue, we need three simulators: one for userA and the remaining two for userB, with the latter two simulators being paired. When userA sends a contact request to userB, due to message delivery issues, reproducing the bug can be challenging or inconsistent. However, with a local Waku node, these message delivery issues are resolved, leading to faster and more reliable bug replication.

Another purpose could be: just want to know more about waku :)

How to setup local waku node with status-mobile?

Preparation

  • any preparations needed for building status-go should be done before setup local waku node
  • domain
@qfrank
qfrank / logout timed out
Created February 27, 2025 07:04
panic: test timed out after 5m0s
goroutine 18340 [semacquire, 4 minutes]:
sync.runtime_Semacquire(0xc0019a09a0?)
/nix/store/00mg4vlhzmm7gi9bd5v5ydjlgrywpc3n-go-1.22.3/share/go/src/runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0xc0015ce600?)
/nix/store/00mg4vlhzmm7gi9bd5v5ydjlgrywpc3n-go-1.22.3/share/go/src/sync/waitgroup.go:116 +0x48
github.com/status-im/status-go/wakuv2.(*Waku).Stop(0xc001438b48)
/home/jenkins/workspace/status-go_prs_tests_PR-6371/wakuv2/waku.go:1443 +0x105
github.com/ethereum/go-ethereum/node.(*Node).stopServices(0xc0014e47e0, {0xc00121a200, 0x18, 0x0?})
/home/jenkins/workspace/status-go_prs_tests_PR-6371/vendor/github.com/ethereum/go-ethereum/node/node.go:298 +0xbf
github.com/ethereum/go-ethereum/node.(*Node).Close(0xc0014e47e0)