Open kelvinolumeni opened 7 months ago
import { Network, Alchemy } from 'alchemy-sdk';
const settings = { apiKey: "K65KESvPum3ui73Jk6wOxxREAh8a2buu", network: Network.ETH_MAINNET, };
const alchemy = new Alchemy(settings);
// get the latest block const latestBlock = alchemy.core.getBlock("latest").then(console.log);
package main
import ( "context" "fmt" "log"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" )
func main() { client, err := ethclient.Dial("https://eth-mainnet.g.alchemy.com/v2/K65KESvPum3ui73Jk6wOxxREAh8a2buu") if err != nil { log.Fatal(err) }
// Get the latest known block block, err := client.BlockByNumber(context.Background(), nil) if err != nil { log.Fatal(err) } fmt.Println("Latest block:", block.Number().Uint64())
}
import { Network, Alchemy } from 'alchemy-sdk';
const settings = { apiKey: "K65KESvPum3ui73Jk6wOxxREAh8a2buu", network: Network.ETH_MAINNET, };
const alchemy = new Alchemy(settings);
// get the latest block const latestBlock = alchemy.core.getBlock("latest").then(console.log);
package main
import ( "context" "fmt" "log"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" )
func main() { client, err := ethclient.Dial("https://eth-mainnet.g.alchemy.com/v2/K65KESvPum3ui73Jk6wOxxREAh8a2buu") if err != nil { log.Fatal(err) }
}