@@ -71,7 +71,7 @@ func New(configPath string) (*DAClient, error) {
71
71
return nil , fmt .Errorf ("cannot get config" , err )
72
72
}
73
73
74
- a .API , err = gsrpc .NewSubstrateAPI (a .config .APIURL )
74
+ a .API , err = gsrpc .NewSubstrateAPI (a .config .WsRpcURL )
75
75
if err != nil {
76
76
// log.Error("cannot get api:%w", zap.Error(err))
77
77
return nil , fmt .Errorf ("cannot get api" , err )
212
212
// Look for our submitted extrinsic in the block
213
213
if ext .Signature .Signature .AsEcdsa .Hex () == e .Signature .Signature .AsEcdsa .Hex () {
214
214
extIndex = idx
215
- resp , err := http .Post ("https://goldberg.avail.tools/api" , "application/json" ,
215
+ resp , err := http .Post (a . config . HttpApiURL , "application/json" ,
216
216
strings .NewReader (fmt .Sprintf ("{\" id\" :1,\" jsonrpc\" :\" 2.0\" ,\" method\" :\" kate_queryDataProofV2\" ,\" params\" :[%d, \" %#x\" ]}" , idx + 1 , blockHash ))) //nolint: noctx
217
217
if err != nil {
218
218
return nil , nil , fmt .Errorf ("cannot post query request" , err )
@@ -294,7 +294,7 @@ func (b BatchDAData) IsEmpty() bool {
294
294
295
295
func (a * DAClient ) GetAccountNextIndex () (types.UCompact , error ) {
296
296
// TODO: Add context to the request
297
- resp , err := http .Post ("https://goldberg.avail.tools/api" , "application/json" , strings .NewReader (fmt .Sprintf ("{\" id\" :1,\" jsonrpc\" :\" 2.0\" ,\" method\" :\" system_accountNextIndex\" ,\" params\" :[\" %v\" ]}" , a .KeyringPair .Address ))) //nolint: noctx
297
+ resp , err := http .Post (a . config . HttpApiURL , "application/json" , strings .NewReader (fmt .Sprintf ("{\" id\" :1,\" jsonrpc\" :\" 2.0\" ,\" method\" :\" system_accountNextIndex\" ,\" params\" :[\" %v\" ]}" , a .KeyringPair .Address ))) //nolint: noctx
298
298
if err != nil {
299
299
return types .NewUCompactFromUInt (0 ), fmt .Errorf ("cannot post account next index request" , err )
300
300
}
@@ -304,7 +304,6 @@ func (a *DAClient) GetAccountNextIndex() (types.UCompact, error) {
304
304
if err != nil {
305
305
return types .NewUCompactFromUInt (0 ), fmt .Errorf ("cannot read body" , err )
306
306
}
307
-
308
307
var accountNextIndex AccountNextIndexRPCResponse
309
308
err = json .Unmarshal (data , & accountNextIndex )
310
309
if err != nil {
@@ -362,7 +361,8 @@ func (a *DAClient) GetData(blockNumber uint64, extHash string) ([]byte, error) {
362
361
363
362
type Config struct {
364
363
Seed string `json:"seed"`
365
- APIURL string `json:"api_url"`
364
+ WsRpcURL string `json:"wsRpcUrl"`
365
+ HttpApiURL string `json:"httpApiUrl"`
366
366
AppID int `json:"app_id"`
367
367
DestinationDomain int `json:"destination_domain"`
368
368
DestinationAddress string `json:"destination_address"`
0 commit comments