go get github.com/everFinance/arsyncer
arsyncer is the high performance arweave network transaction synchronisation component.
Based on goar's getBlockFromPeers and getTxFromPeers methods.
it is possible to achieve 100% pull to each block.
then parse the tx_list in the block.
and pull 100% of each tx(not return tx_data).
and all transactions are returned in on-chain order.
syncer := New(startHeight, filterParams, arNode, conNum, stableBlockDistance, subscribeType)
startHeight
block height at the start of the sync
filterParams
filter tx
arNode
arweave node url
conNum
runtime concurrency number, default is 10
stableBlockDistance
stable block height distance, default is 15
subscribeType
subscribe tx or block, or both.
syncer.Run()
for {
select{
case sTx := <-s.SubscribeTxCh():
// process sTx
...
}
case sBlock := <-s.SubscribeBlockCh():
// process sBlock
...
}
- Get all transactions and blocks example: ./example/all-tx-syncer.go
- Get the transactions for the specified sender: ./example/from-tx-syncer.go
- Get the transactions for the specified target: ./example/target-tx-syncer.go
- Get all smart contract transactions: ./example/swc-syncer.go
How to implement a high-performance arweave txs synchroniser?
https://medium.com/everfinance/arsyncer-arweave-transaction-synchroniser-3ebcf0e741ec