Here are some libraries for interacting with an Ethereum node. They are grouped by language, and roughly according to their last commit, with any appropriate brief notes. Javascript has been included since they are alternatives to web3.js and provide value to the overall list.
Javascript
https://github.com/AugurProject/ethrpc with IPC support, last commit 1 day ago
https://github.com/tarrencev/ethjs written in ES6, RPC calls return a promise/stream, last commit 10 days ago
Python
https://github.com/ConsenSys/ethjsonrpc all 62 JSON-RPC methods, last commit 11 days ago
https://github.com/pipermerriam/ethereum-rpc-client RPC, last commit Jan 2 2016
https://github.com/pipermerriam/ethereum-ipc-client IPC, last commit Jan 4 2016
C# .NET
https://github.com/LawrenceBotley/EthereumRpc-NET appears to have majority of RPC done, last commit Dec 13 2015
Ruby
https://github.com/tymat/ethereum-ruby
appears to be minimal and from 2 years ago
For other languages, general JSON-RPC libraries are available as a starting point.
https://en.wikipedia.org/wiki/JSON-RPC#Implementations
http://json-rpc.org/wiki/implementations
Filters work a little bit different. Filters require LOG
s to be emitted from an EVM execution (i.e. a contract). Solidity makes this easy for you by allowing you to fire event
s (compiled event
s generate LOG
s).
Let's take the following contract:
contract T {
event res(uint indexed out)
function echo(uint in) {
res(i);
}
}
When the method echo
is invoked on the contract it fires the solidity event res
. These events can be caught using the eth_newFilter
and queried using eth_getFilterChanges
.
When creating a filter for a specific event (e.g. res
) we need to derive the event signature first. Signatures are generated using the first 4 bytes of the keccak
hash of the event's definition (i.e. res(uint)
): keccak("res(uint)")
. This then becomes the first argument for the eth_newFilter
's topics.
Any of the arguments in the definition of the event that have the indexed
keyword (as in the example contract listed above) can also be used to filter on. Let's say we only want to catch events for the number 6, we would then construct the following JSON-RPC:
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"address": "0xaddress", topics:["KECCAK_HASH", "0x6"], "fromBlock":"latest","toBlock":"latest"}],"id":2}' localhost:8545 {"id":2,"jsonrpc":"2.0","result":"0x0"}
Now whenever the method echo(6)
is invoked on the contract you'll be able to query the result using the eth_getFilterChanges
.
Please see the solidity docs on events for more information.
Best Answer
The most easily-accessible source of "public" Ethereum nodes is probably Infura (https://infura.io/). There is also something called QuickNode (https://quiknode.io/), but I think their nodes are time limited. Infura's nodes are open to the public, but I've seen mention that it may not be forever.