Skip to content

zgrlin/go-block-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-based Ethereum New Block REST API

Go-based Ethereum new Block alert REST Interface

This REST API support Gin framework.

Handler Method Support:

  • Post Block
  • Get Block
  • Alerting (PING)

Field:

  • Height (Block number)
  • Minedby (Block Miner)

Run

$ go mod init
$ go run main.go

DevRun

$ make dev

Web Side

http://localhost:8080/web Web Interface 

REST Side

GET http://localhost:8080/blockfeed
POST http://localhost:8080/blockfeed

Unit Test

if you want to reproduce new field use a Unit Test

$ cd platform
$ go test

JS Injection

await fetch('/blockfeed', {
	method: 'POST',
	headers: {'content-type': 'application/json'},
	body: JSON.stringify({
		number: '1',
		minedby: '2Miners'
	})
})

About

Go-based Ethereum Block List Web API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published