Skip to content

arweave txs syncer golang implementation

Notifications You must be signed in to change notification settings

dstor-team/arsyncer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(forked) arsyncer

Adding new filtering features to enable arsyncer usage in Arweave pubsub user notifications on Dstor.

Install

go get github.com/everFinance/arsyncer

Introduction

arsyncer is the high performance arweave network transaction synchronisation component.

Principle

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.

New

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.

Run

syncer.Run()

SubscribeTx

for {
     select{
	 case sTx := <-s.SubscribeTxCh():
	 // process sTx
	    ...
    }
	case sBlock := <-s.SubscribeBlockCh():
	 // process sBlock
	    ...
}

Example

  1. Get all transactions and blocks example: ./example/all-tx-syncer.go
  2. Get the transactions for the specified sender: ./example/from-tx-syncer.go
  3. Get the transactions for the specified target: ./example/target-tx-syncer.go
  4. Get all smart contract transactions: ./example/swc-syncer.go

Related

How to implement a high-performance arweave txs synchroniser?
https://medium.com/everfinance/arsyncer-arweave-transaction-synchroniser-3ebcf0e741ec

About

arweave txs syncer golang implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%