From d4d4b8c92fbb948514c10d5d7d4398d19fa15a87 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Tue, 19 Dec 2023 22:41:10 -0500 Subject: [PATCH] adde BlokchainEndpoint as a param --- mobile/config.go | 4 +++- mobile/example_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile/config.go b/mobile/config.go index a394d5d1..374636b6 100644 --- a/mobile/config.go +++ b/mobile/config.go @@ -58,6 +58,7 @@ type Config struct { // not possible. Defaults to enabled if unspecified. AllowTransientConnection bool PoolName string + BlockchainEndpoint string // TODO: we don't need to take BloxAddr when there is a discovery mechanism facilitated via fx.land. // For now we manually take BloxAddr as config. @@ -70,6 +71,7 @@ func NewConfig() *Config { ForceReachabilityPrivate: true, AllowTransientConnection: true, PoolName: "0", + BlockchainEndpoint: "api.node3.functionyard.fula.network", } } @@ -187,7 +189,7 @@ func (cfg *Config) init(mc *Client) error { blockchain.NewSimpleKeyStorer(""), blockchain.WithAuthorizer(mc.h.ID()), blockchain.WithAllowTransientConnection(cfg.AllowTransientConnection), - blockchain.WithBlockchainEndPoint("127.0.0.1:4000"), + blockchain.WithBlockchainEndPoint(cfg.BlockchainEndpoint), blockchain.WithRelays(cfg.StaticRelays), blockchain.WithTopicName(cfg.PoolName), blockchain.WithTimeout(30)) diff --git a/mobile/example_test.go b/mobile/example_test.go index e0d8bcb9..05d86665 100644 --- a/mobile/example_test.go +++ b/mobile/example_test.go @@ -340,6 +340,7 @@ func Example_poolExchangeDagBetweenClientBlox() { mcfg.BloxAddr = bloxAddrString + "/p2p/" + h1.ID().String() mcfg.PoolName = "1" mcfg.Exchange = bloxAddrString + mcfg.BlockchainEndpoint = "127.0.0.1:4004" log.Infow("bloxAdd string created", "addr", bloxAddrString+"/p2p/"+h1.ID().String()) c1, err := fulamobile.NewClient(mcfg)