Implementation for PIVX fork

Hi all, we are working to implement our PIVX Fork with the Rosetta API.

The git we are using is https://github.com/ScArFaCe2020/rosetta-eunopay for dev works.

The problem we face at this stage the Rosetta isn’t able to talk with the coin deamon. It keeps giving RPC connection timeout:
Error: request failed: /network/status {Code:3 Message:Eunod error Description: Retriable:false Details:map[context:Post “http://localhost:46461”: dial tcp 127.0.0.1:46461: connect: connection refused: error posting to rpc-api: error posting to JSON-RPC]}: unable to initialize asserter

Hope there is someone here to help us fix this. Thanks in advance.

Hello @scarface2020. Welcome to Rosetta community

I am unable to view your repo here. Is it a private one?

Looking at this message, is your rosetta implementation running on port 46461? This is an online endpoint and implementation would have to call your node. Is everything running on node side?

Hello,

New Github is: GitHub - ScArFaCe2020/rosetta-euno: EUNO Rosetta API Implementation
This is the log in container:

2022-02-12T10:20:29.524Z        DEBUG   memory  utils/utils.go:62       stats   {"heap (MB)": 3.1757583618164062, "max heap (MB)": 3.1757583618164062, "stack (MB)": 0.5625, "system (MB)": 71.07910919189453, "garbage collections": 2}
2022-02-12T10:20:29.530Z        DEBUG   eunod   bitcoin/node.go:56      version v2.0.2.0-a8b29514a (release build) (2021-06-15 23:53:30 +0300)
2022-02-12T10:20:29.530Z        DEBUG   eunod   bitcoin/node.go:56      : parameter interaction: -bind or -whitebind set -> setting -listen=1
2022-02-12T10:20:29.530Z        DEBUG   eunod   bitcoin/node.go:56      : parameter interaction: wallet functionality not enabled -> setting -staking=0
2022-02-12T10:20:29.530Z        DEBUG   eunod   bitcoin/node.go:56      RdRand as an additional entropy source
2022-02-12T10:20:29.542Z        DEBUG   eunod   bitcoin/node.go:56      BerkeleyDB version Berkeley DB 5.3.28: (September  9, 2013)
2022-02-12T10:20:29.542Z        DEBUG   eunod   bitcoin/node.go:56      data directory /root/.eunopay
2022-02-12T10:20:29.542Z        DEBUG   eunod   bitcoin/node.go:56      data directory /data/eunod
2022-02-12T10:20:29.542Z        DEBUG   eunod   bitcoin/node.go:56      config file /app/bitcoin-mainnet.conf
2022-02-12T10:20:29.542Z        DEBUG   eunod   bitcoin/node.go:56      at most 125 connections (100000 file descriptors available)
2022-02-12T10:20:29.560Z        DEBUG   eunod   bitcoin/node.go:56      32 MiB out of 32 requested for signature cache, able to store 1048576 elements
2022-02-12T10:20:29.560Z        DEBUG   eunod   bitcoin/node.go:56      12 threads for script verification
2022-02-12T10:20:29.561Z        DEBUG   eunod   bitcoin/node.go:56      thread start
2022-02-12T10:20:29.561Z        DEBUG   eunod   bitcoin/node.go:56      creating work queue of depth 1000
2022-02-12T10:20:29.561Z        DEBUG   eunod   bitcoin/node.go:56      starting 16 worker threads
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      to 0.0.0.0:46462
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      configuration:
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      Using 12.5MiB for block index database
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      Using 29.9MiB for chain state database
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      Using 57.6MiB for in-memory UTXO set
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      message: Loading block index...
2022-02-12T10:20:29.562Z        DEBUG   eunod   bitcoin/node.go:56      LevelDB in /data/eunod/zerocoin
badger 2022/02/12 10:20:29 INFO: All 0 tables opened in 0s
2022-02-12T10:20:29.675Z        DEBUG   memory  utils/utils.go:62       stats   {"heap (MB)": 334.7131881713867, "max heap (MB)": 334.7131881713867, "stack (MB)": 0.6875, "system (MB)": 467.9717788696289, "garbage collections": 3}
2022-02-12T10:20:29.738Z        DEBUG   eunod   bitcoin/node.go:56      LevelDB successfully
2022/02/12 10:20:29 loaded zstd dictionary for transaction
2022-02-12T10:20:29.738Z        DEBUG   eunod   bitcoin/node.go:56      LevelDB in /data/eunod/sporks
2022-02-12T10:20:29.739Z        INFO    main    src/main.go:179 server listening        {"port": 8080}
2022-02-12T10:20:29.868Z        INFO    indexer indexer/indexer.go:264  waiting for eunod...
2022-02-12T10:20:29.868Z        WARN    eunod stderr    bitcoin/node.go:42      closing logger  {"error": "EOF"}
github.com/ScArFaCe2020/rosetta-euno/bitcoin.logPipe
        /app/src/bitcoin/node.go:42
github.com/ScArFaCe2020/rosetta-euno/bitcoin.StartBitcoind.func2
        /app/src/bitcoin/node.go:88
golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57
2022-02-12T10:20:29.868Z        WARN    eunod   bitcoin/node.go:42      closing logger  {"error": "EOF"}
github.com/ScArFaCe2020/rosetta-euno/bitcoin.logPipe
        /app/src/bitcoin/node.go:42
github.com/ScArFaCe2020/rosetta-euno/bitcoin.StartBitcoind.func1
        /app/src/bitcoin/node.go:84
golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57
2022-02-12T10:20:29.868Z        WARN    pruner  indexer/indexer.go:316  exiting pruner
github.com/ScArFaCe2020/rosetta-euno/indexer.(*Indexer).Prune
        /app/src/indexer/indexer.go:316
main.startOnlineDependencies.func3
        /app/src/main.go:108
golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57
2022-02-12T10:20:29.868Z        WARN    eunod   bitcoin/node.go:98      sending interrupt to eunod
github.com/ScArFaCe2020/rosetta-euno/bitcoin.StartBitcoind.func3
        /app/src/bitcoin/node.go:98
golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57
2022-02-12T10:20:29.897Z        INFO    indexer/indexer.go:137  database closed successfully
2022-02-12T10:20:29.898Z        FATAL   main    src/main.go:205 rosetta-euno sync failed        {"error": "signal: segmentation fault (core dumped)"}
main.main
        /app/src/main.go:205
runtime.main
        /usr/local/go/src/runtime/proc.go:225

Problem its daemon keep crashing…
I have test the daemon without docker with same conf. it works fine then.
Can you let me know if i’m doing something wrong?

Hello @shrimalmadhur ,

I have fixed the crashed problem GitHub - ScArFaCe2020/rosetta-euno: Bitcoin Rosetta API Implementation
now when i’m trying to curl it give:

curl -d ‘{ “network_identifier”: { “blockchain”: “Euno”, “network”: “Mainnet”}, “metadata”: {} }’ -X POST http://localhost:8080/network/status
{“code”:2,“message”:“Bitcoind is not ready”,“retriable”:true}

I have import chainparams but still not working

Hi @scarface2020 can you verify if the underlying blockchain node you are trying to run is up?

Hello, @shrimalmadhur

Yes that is up and curl request to RPC works fine…

root@rosetta:~/rosetta-bitcoin# curl --user rosetta --data-binary ‘{“jsonrpc”: “2.0”, “id”:“getinfo”, “method”: “getinfo”, “params”: }’ -H ‘content-type: text/plain;’ http://127.0.0.1:46461/
Enter host password for user ‘rosetta’:
{“result”:{“version”:2000200,“protocolversion”:71701,“services”:“NETWORK/BLOOM/”,“walletversion”:169900,“balance”:0.00000000,“zerocoinbalance”:0.00000000,“staking status”:“Staking Not Active”,“blocks”:49500,“timeoffset”:0,“connections”:8,“proxy”:"",“difficulty”:1213059.008850573,“testnet”:false,“moneysupply”:6032422498.57880660,“zEUNOsupply”:{“1”:0.00000000,“5”:0.00000000,“10”:0.00000000,“50”:0.00000000,“100”:0.00000000,“500”:0.00000000,“1000”:0.00000000,“5000”:0.00000000,“total”:0.00000000},“keypoololdest”:1645909021,“keypoolsize”:100,“paytxfee”:0.00000000,“relayfee”:0.00010000,“errors”:""},“error”:null,“id”:“getinfo”}

Hello, @shrimalmadhur

I can see that rosetta does have connection with the wallet, because getpeerinfo works: rosetta-euno/network_service.go at master · ScArFaCe2020/rosetta-euno · GitHub

Error happened here: rosetta-euno/network_service.go at master · ScArFaCe2020/rosetta-euno · GitHub

maybe some problem with saving the block data by indexer?

Hello @shrimalmadhur,

I have got Rosetta working now, thank you for your support.

1 Like