https://medium.com/@walkert/fun-building-shared-libraries-in-go-639500a6a669
https://www.darkcoding.net/software/building-shared-libraries-in-go-part-2/
See also, http://libraryofalexandria.io/cgo/
cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.
So, Here collect materials.
| // RLP encoded transaction | |
| const rawTxHex = '0xed8205fc843b9aca00825208944592d8f8d7b001e72cb26a73e4fa1806a51ac79d88016345785d8a000080808080' | |
| // using rlp package to decode values | |
| const rlp = require('rlp') | |
| const decoded = rlp.decode(rawTxHex) | |
| console.log(decoded) | |
| /* | |
| [ <Buffer 05 fc>, | |
| <Buffer 3b 9a ca 00>, |
| import timeit | |
| import threading | |
| import asyncio | |
| import contextlib | |
| import requests | |
| from aiohttp import ClientSession | |
| from web3.providers.base import JSONBaseProvider | |
| from web3.providers import HTTPProvider |
| const puppeteer = require('puppeteer'); | |
| const spawn = require('@expo/spawn-async'); | |
| const v4 = require('uuid').v4; | |
| const UserAgent = require('user-agents'); | |
| const faucet = 'https://explorer.certik.foundation/faucet'; | |
| const address_query = 'input[name=address]'; | |
| const button_click = 'form button[type=submit]'; |
| type Point struct { | |
| GasPriceX *big.Int | |
| EthProfitY *big.Int | |
| } | |
| func (b *Bot) MaxProfitPossible(p1, p2 Point) *big.Int { | |
| rise := new(big.Int).Sub(p2.EthProfitY, p1.EthProfitY) | |
| run := new(big.Int).Sub(p2.GasPriceX, p1.GasPriceX) | |
| slope := new(big.Float).Quo( | |
| new(big.Float).SetInt(rise), |
Geth (Go-Ethereum) as of March 2021 takes about 350 GiB of space on a fast/snap sync, and then grows by ~ 10 GiB/week. This will fill a 1TB SSD in ~6 months, to the point where space usage should be brought down again with an offline prune.
Happily, Geth 1.10.x introduces "snapshot offline prune", which brings it back down to about its original size. It takes roughly 4 hours to prune the Geth DB, and this has to be done while Geth is not running.
Caveat that while several folx have used offline pruning successfully, there is risk associated with it. The two failure modes we have seen already are:
153: cumulative: 12469376 gas: 21000 contract: 0x0000000000000000000000000000000000000000 status: 1 tx: 0xfbbf56fd9eb3fb2e1d05f0a0f19a0ccfaeb84df1fed01273ec5ee3b0c1acb011 logs: [] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 state:
Get the value of COMP earned for an address that uses the Compound protocol. This can be done using the Lens contract with JSON RPC or another Smart Contract. If you do an eth_call with JSON RPC, it is free (no gas costs).
getCompBalanceMetadataExt method in the Lens contract
https://etherscan.io/address/0xd513d22422a3062Bd342Ae374b4b9c20E0a9a074#code| pragma solidity ^0.8.1; | |
| library D { | |
| function str_concat(string memory _a, string memory _b) | |
| internal | |
| pure | |
| returns (string memory _concatenatedString) | |
| { | |
| return str_concat(_a, _b, "", "", "", "", "", ""); | |
| } |